OK, first of all, can I use the run() command in a program?

Secondly, is it possible to do something like this?

Program blah.lua

Code:

run(blah2.lua)
print(a) --remembers variable from blah2.lua


blah2.lua

Code:

a = "Hello World"


Lastly, can I use relative addresses with run()?

If this isnt possible, could there be a way to do something similar in the next version of luazm?
*bump*
1) I believe that if you declare variable 'a' as global before running the other program, it will work.
2) I also believe you can use run() inside a program, but why don't you test it?
3) What do you mean by relative addressing?
I think he means relative paths, like run("utils\\blah.lua") rather than run("\\\\fls0\\myprog\\utils\\blah.lua") (idk if you need the \\fls0\ prefix, point being the \myprog\...)
AHelper wrote:
I think he means relative paths, like run("utils\\blah.lua") rather than run("\\\\fls0\\myprog\\utils\\blah.lua") (idk if you need the \\fls0\ prefix, point being the \myprog\...)
No, relative paths do not work. LuaZM has no concept of the current working directory (CWD).
KermMartian wrote:
1) I believe that if you declare variable 'a' as global before running the other program, it will work.
2) I also believe you can use run() inside a program, but why don't you test it?
3) What do you mean by relative addressing?


OK, I tested it and now I have some requests. First, could you make LuaZM handle CWD's? also, can there be a way to run a program and not discard the variable values after the program ends?

I am trying to come up with a way to make a simple patch that would run LuaFX programs in luazm by defing function variables. Then any LuaFX program could be ported by simply adding a "run('luafx-patch.lua')" line at the top of the luafx program.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement