XEQ: compile and execute a character string (H)
⇒Home
⇒Contents
⇒more on Programming
⇒ Example of a XEQ call in "Runtime_evaluation" (RosettaCode)
result = XEQ(string [, *error_label] )
executes string under script control
string must be a
⇒ valid expression
*error_label is an optional label to jump to if an error occurs. Without this label an error message is shown in the error case.
string is translated and executed only when XEQ is called
variables of the current script procedure can be used. Non existent variables are allocated while the string is executed and deallocated then
XEQ
will not execute
GOTO
or multiline constructs like
DO
,
CALL
,
IF
..
THEN
string can be generated by the script, it can be stored in a file to be recalled later
the toolbar tool 1+1 is an example how XEQ works and what it can do. Copy (Ctrl+C) and paste (Ctrl+V) to script i you like.
examples:
result = XEQ( "a = b + c" )
a is set only if it is available in the calling procedure, else "b + c" is stored in result
x = XEQ( "CALL my_subroutine", *999)
! will jump to
⇒ label
999
execute 1 command out of a filed list:
OPEN
(FIle="my_list.txt")
READ
(FIle="my_list.txt", Row=6) string
XEQ(string)
! executes row 6 of file my_list.txt
How your donation will be used, and how to get a HicEst key code in return
©2000-2010 Georg Petrich, HicEst Instant Prototype Computing. All rights reserved.
Impressum