Am 09.11.2010 13:58, schrieb Ofer Cornfeld:
Hi,
What is the best way to construct commands such as GMM commands on the fly?
Assuming I have the string containing the GMM command to be executed,
built from other strings or from input file
How can I execute it?
One possibility in principle:
1. use the 'outfile' command
2. use 'print'/'printf' statements to write your gretl commands to the
chosen file
3. use the 'run' and/or 'include' commands to execute the resulting
script file
I guess you will have to worry a bit about path searching and such.
I'm not aware of a way to execute the commands directly from a string
variable instead of a file.
In general I guess it's fair to say that gretl-script is not a
full-fledged programming language built for such "meta programming".
Personally I would probably recommend to use another language like
Python (other choices are possible of course) to build the gretl command
string (or script file) and then call the CLI version of gretl from your
meta Python program to execute the gretl commands.
HTH and good luck,
sven