Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous messageGo to previous message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

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.
 
Read Message
Read Message
Read Message
Previous Topic: Problem with script translation
Next Topic: Creating classes for Esc and using in Esc.
Goto Forum:
  


Current Time: Sun May 05 20:17:54 CEST 2024

Total time taken to generate the page: 0.01406 seconds