masteringmatlab wrote:Is it possible to call one lua script from another? For example, fromYes, you can do this via the dofile command in Lua. For example, if you put the line: dofile("c:\\temp\\junk.lua") in your script, Lua would execute some file called c:\temp\junk.lua You need to put your user-created functions in the beginning of the script so that these functions get defined before you call them in your script. Or can they be separate files in the same directory on disk?If you have a library of lua functions, you can load it at the beginning of a script via a dofile() call. I wasn't planning on changing to Lua 5.0, becuase it isn't clear to me that switching to 5.0 would be a big advantage--if it ain't broke, don't fix it. Only some big increase in functionality would merit forcing everyone to redo scripts for Lua 5 compatibility. As it see it, my main (only serious?) gripe about Lua is its klunky support of complex numbers (For example, see http://www.lua.org/notes/ltn007.html -- there is a different (and possibly better) implementation of complex numbers at http://members.chello.nl/~w.couwenberg/ ) However, I don't think that complex numbers are any easier under Lua 5. However, there will eventually be some fairly mild changes to the FEMM-specific lua functions. In the MDI version of FEMM that I am working on, the Lua functions have to have a prefix added onto them so that Lua knows which type of document the command is supposed to apply to. I had to do this because there are many function names that are duplicated in the pre-and post-processor and in the femm and bela implementations--I had to have some way of differentiating the various implementations. p.s., I am working on lua scripts for drawing PMSMs having arbitraryCool! It will be interesting to check them out. Dave. |