|
|
Label: ♦english
♦feature planning
klabim
created at Saturday, 2010-08-21, 17:55:06
1 Replies, 685 Hits
Hi,
how can I share a variable between 2 scripts in an embedded environment? For example: script 1:
global_var : int = 5;
script 2:
io.writeln(global_var)
In the C++ code I load both scripts into the daoVm. I would like to share vars between them. This is done by :
DaoVmProcess_Eval( vmp, ns, src, 1 );
where src is script 1 and src2 is script 2.
Currently I don't see a way to do it. Even if I import script 1 in script 2 the global_var isn't known. Like:
script 2:
DaoVmProcess_Eval( vmp, ns, src2, 1 );
import script 1;
Regards.io.writeln(global_var) Comments
klabim commented at Saturday, 2010-08-21, 18:09:21
Ok, I found it. It can be so easy by reading the documentation :-). I have overseen the keyword global.
Thanks.
|
fu: ... I forgot to say something about the plan for the whole new year in my previous reply. Well, besides w ... (Jan.19,01:40) fu: ... Happy new dragon year (which will start from this sunday)! Actually, it was a busy month (I wish th ... (Jan.18,22:46) ybabel: What's the plan for the new year ? Hello 'vry budy :- ) happy new year (when is the new year for you Fu ?) I saw you come back and comm ... (Jan.18,18:59) |