create dynamic script to a tableHi,
I am trying to dynamically change the content of the script before adding to a data table using the dt << new script(name, script_content) where script_content is a variable containing the script to be added . However, new script() treats the script_content as a string instead of a variable.
here is an example, the contnet of script "test" in table "Dynamic Script" will show "script_content" instead of "show("First half year")". Could someone help?
if (month(today()) > 6,
script_content = expr(show("Second half year")), script_content = expr(show("First half year")));
dt = New Table("Dynamic Script");
dt << new script ("test", script_content);
thank you very much,
Yuxin Huang
Re: create dynamic script to a tableThank you very much Jim. This is a very smart solution.Re: create dynamic script to a tableHere is how I solve such problems
If( Month( Today() ) > 6,
script_content = Expr(
Show( "Second half year" )
),
script_content = Expr(
Show( "First half year" )
)
);
dt = New Table( "Dynamic Script" );
Eval( Parse( "dt << new script (\!"test\!"," || Char( Eval Expr( script_content ) ) || ";)" ) );