execute char variable ? ? ?

Samet86

New Member
[h=2]How to execut a line of code in a char variable [/h]
Sample :

DEF VAR prun AS CHAR NO-UNDO.

prun = "MESSAGE 'sample'
VIEW-AS ALERT-BOX INFO BUTTONS OK.".

Now somehow run prun.

Thank You for helping...
 
THe only way I can think of doing that is as follows:

Code:
procedure prun:
  message 'sample' view-as alert-box.
end. 


define variable prun as char no-undo. 

prun = "prun".

run value(prun).
 
If you can dictate the target environment having a development license you could output the contents of your variable to a temp file and run that.
 
To be clear -- there is no general purpose statement to execute a string as code. (Like the javascript eval() command.)
 
Back
Top