Can I call variables from any folder on CPLUA? And can I stored on CPLUA any variable to any folder to then use it on the main?
Variables
Started by
Colombia
, Nov 10 2007 02:05 AM
1 reply to this topic
#1
Posted 10 November 2007 - 02:05 AM
#2
Posted 16 February 2008 - 04:48 PM
I already know how to store and use variables than we created on the main on CPLua.
Stored any variable on the main in any folder
Example:
Current folder (Temp)
56=>var
Now open CPLua then write this:
cas.setfolder("Temp")
print(cas("var"))
This code can help you to see your desirable variable.
If you have a CPLua code and you need to save it on any folder to later use on the main, write this
cas("56=>var")
the only problem with this is: The variables are stored as userdata.
I don`t know how to change type. Example userdata To table, or userdata To string
The only things that I know is how to change userdata to number
Example (userdataTonumber):
x=cas(input("x: "))
--The variable x is stored as userdata
print(type(x))
m=x(0)
--We change x to m and then change also the type. Userdata to number
print(type(m))
Stored any variable on the main in any folder
Example:
Current folder (Temp)
56=>var
Now open CPLua then write this:
cas.setfolder("Temp")
print(cas("var"))
This code can help you to see your desirable variable.
If you have a CPLua code and you need to save it on any folder to later use on the main, write this
cas("56=>var")
the only problem with this is: The variables are stored as userdata.
I don`t know how to change type. Example userdata To table, or userdata To string
The only things that I know is how to change userdata to number
Example (userdataTonumber):
x=cas(input("x: "))
--The variable x is stored as userdata
print(type(x))
m=x(0)
--We change x to m and then change also the type. Userdata to number
print(type(m))
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users