Uses Variables?
#1
Posted 06 June 2006 - 11:25 PM
How I can call this variable to my program on another folder????
#2
Posted 07 June 2006 - 11:28 AM
Assume that a variable named "foo" is stored in the "current" folder. Simply use cas("foo"). Unfortunately, this works only for variables stored in the "current" folder, as shown in CP's variable manager. Normally, you could also access variables stored in another folder by using the more general form cas("folder\variable), but this doesn't work as expected. Orwell???I`ve a program on CPLua folder, but i need to use a variable stored on main folder
How I can call this variable to my program on another folder????
#3
Posted 07 June 2006 - 12:47 PM
If you find some Basic functions that do not exist in Lua (like PrintNatural), don't hesitate to propose (in the "Suggestions" topic) the lua functions that you would like to see in the next releases
#4
Posted 07 June 2006 - 01:28 PM
I'm not a CPBasic user as well, but "current folder" is not directly related to CPBasic. It is the folder where variables assigned in the "Main" application will be stored, and can be changed using the Variable Manager. You are right, it's annoying, but how can we access variables from CPLua that are stored to any folder? cas("folder\variable") does not work, while folder\variable is a valid CAS command, used to access variables stored anywhere.To be honest, as I'm not a CPBasic user, I never saw the real utility of the "current folder"... But this could be a case were it is needed. If you need something to set the current folder, just say it: I'm still opened to suggestions
#5
Posted 04 August 2006 - 07:10 PM
local x = 5 -- for example table = { x } export ( table )in ur main prog
require ( dir/name_of_the_file ) print ( table.x ) -- 5
please correct me if I'm wrong
#6
Posted 04 August 2006 - 09:38 PM
Not really, this is not the problem they were speaking about
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users