List Info

Thread: Get variable from LUA




Get variable from LUA
country flaguser name
Poland
2007-08-12 12:30:00
Hello!
How can I retrieve variable declared by: 
luabind::globals(L)["my_variable"] = value;?

------------------------------------------------------------
----------
Jak najszybciej dostac sie na wymarzona plaze?
Znajdz trase ekspresowa 

>>>http://link.interia.pl/f
1b0d


------------------------------------------------------------
-------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and
a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
luabind-user mailing list
luabind-userlists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/luabind-us
er

Re: Get variable from LUA
country flaguser name
Australia
2007-08-13 00:47:59
You can access the variable within lua by simply accessing
the "my_variable" 
variable.
ie.

Lua:
my_variable:doIt();

You can access the variable from C++ using something called

"luabind::object" and "object_cast" as
described in section 9 of the doco 
(http://www.rasterbar.com/products/luabind/docs.html#ob
ject)

soo something like:
C++:
int value = 17;
luabind::globals(L)["my_variable"] = value;
luabind::object
tmpObject(luabind::globals(L)["my_variable"]);
int otherValue = object_cast<int>(tmpObject);

In my previous experience I believe you could also do
simply:
int otherValue = tmpObject;

But that may have changed...
Hope that helps!

--Josh

----Original Message Follows----
From: "[Deus]" <liptonteainteria.pl>
Subject: [luabind] Get variable from LUA


Hello!
How can I retrieve variable declared by:
luabind::globals(L)["my_variable"] = value;?

------------------------------------------------------------
----------
Jak najszybciej dostac sie na wymarzona plaze?
Znajdz trase ekspresowa

 >>>http://link.interia.pl/f
1b0d


------------------------------------------------------------
-------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and
a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
luabind-user mailing list
luabind-userlists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/luabind-us
er

____________________________________________________________
_____
Advertisement: Win Dad the Footy Final with Cadbury
Favourites! 
http://a.ninemsn.com.au/b.aspx?URL
=http%3A%2F%2Fbs%2Eserving%2Dsys%2Ecom%2FBurstingPipe%2FadSe
rver%2Ebs%3Fcn%3Dtf%26c%3D20%26mc%3Dclick%26pli%3D243221%26p
i%3D0%26ord%3D%25%25RANDOM%25%25&_t=765445318&_r=hot
mail_email_tagline_Aug07_Cadburys&_m=EXT


------------------------------------------------------------
-------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and
a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
luabind-user mailing list
luabind-userlists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/luabind-us
er

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )