Run Code at Runtime
Brought to you by:
gambas
The ability to run code (as a script) at runtime. For
example to run code written in a text document, like
using the Microsoft Script Control in Visual Basic 6. This
is a very usefull ability and helps to build Data Driven
Applications as you can execute customized code.
Logged In: YES
user_id=29457
Welcome to Gambas viruses !
Logged In: NO
I don't know if that's what you were looking for, but
there's the EVAL function which (more or less) allows the
execution of code at runtime.
Logged In: YES
user_id=693347
No is not what i want. I know what EVAL function does. i
mean a way that during runtime the program read a block of
code (for example a sub from a text file) and then execute it.
That sub it may uses other classes or functions.
That help us to create fully Data Driven Programs. Like the
EVAL function of the CLIPPER.
If EVAL is doing what I mean then I am OK! ;)
Logged In: NO
It seems that EVAL doesn't allow the execution of commands.
I don't understand that. EVAL should treat data as code -
including commands.
If the problem is security, Gambas could have a "taint mode"
like in Perl:
You may not use data derived from outside your program to
affect something else outside your program--at least, not by
accident.
Any variable set to a value derived from tainted data will
itself be tainted, even if it is logically impossible for
the tainted data to alter the variable.
You can "untaint" data and then evaluate it - but you have
to do that explicitly.
More information about Perl's taint mode can be found here:
http://www.perldoc.com/perl5.8.0/pod/perlsec.html