Home » Extra libraries, Code snippets, applications etc. » U++ Esc Interpreter, Esc Macros and templates » How to add global var to Esc from cpp-files?
Re: How to add global var to Esc from cpp-files? [message #25527 is a reply to message #25526] |
Sat, 27 February 2010 23:09 |
|
Sc0rch wrote on Sat, 27 February 2010 20:30 | Hello all.
How to add global var to Esc from cpp-files? Is there opportunity/functions to do this?
Thank you!
Anton.
|
Hi Anton,
I'm not sure if it is possible directly. I tried some time ago and did not succeed. But I can show you a workaround that I used. The trick was a function to set the variable before anything else executes.
ArrayMap<String, EscValue> global;
Vector<EscValue> args;
Scan(global,"SetX(){:X=yourvalue;}");
p=global.Find("SetX");
if(p>=0) Execute(global, NULL, global[p],args);
//the rest of your code
Regards,
Honza
PS: I haven't tested the code, just extracted it from my older project... Hope it works.
|
|
|
Goto Forum:
Current Time: Sun May 05 20:17:54 CEST 2024
Total time taken to generate the page: 0.01406 seconds
|