programming tools for Windows applications development
  Home  |   SwiftForth Archive  |   SwiftX Archive  |

EVALUATE in Callback Revisited

From: Bob Nash <BNash_at_smud.org>
Date: Wed, 18 Jun 2003 14:12:55 -0700

Some time ago (September 2001 and June 2002) there were discussions =
about using EVALUATE in a callback as part of a turnkeyed app.

According to Rick, the problem is that internal variables and system =
state are not initialized during callbacks, so the search order and =
CONTEXT had to be set before executing EVALUATE in the callback.

There were two solutions. One (from Rick) was to define the callback =
word something like this:

: EVAL DECIMAL ONLY FORTH POSTPONE [ Buffer ZCOUNT ['] MY-EVALUATE =
CATCH IF 2DROP THEN ;

Buffer contained the string to be evaluated and MY-EVALUATE was a =
version of EVALUATE that did not try to write errors to the console.

Another solution (again from Rick) was to execute a special word, =
INHERIT-SEARCHORDER, just before executing the callback switch =
statements:

: INHERIT-SEARCHORDER OPERATOR #ORDER HIS #ORDER #VOCS 3 + CELLS CMOVE =
; \ I'll trust Rick on this one!

I just tried various combos of the above with no success (mostly I got a =
DOS console window that persisted for a while and then went away). The =
evaluated words were simple stack manipulations like : test-word 5 5 + =
; The word didn't seem to execute (nothing on the stack).

Finally, my questions:=20

1. Did anyone get this to work? =20
2. Do you have code snippets you are willing to share?

This is just for my own edification -- no immediate need. Thanks!
----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
For list command help, send subject "help" to sftalk-request_at_forth.com
Message archives are located at http://www.forth.com/archive/sftalk
----------------------------------------------------------------------
This list is a forum for SwiftForth users. For product support and bug
reports, please send email to support_at_forth.com
----------------------------------------------------------------------
Received on Wed Jun 18 2003 - 14:20:15 PDT

This archive was generated by hypermail 2.2.0 : Tue Dec 02 2008 - 03:04:32 PST