Thursday, 20 November 2008
 
  Home arrow Forum  
Main Menu
Home
News
Forum
Documentation
Download
Links
Administrator
Login Form
Welcome, Guest. Please login or register.
November 20, 2008, 07:15:24 AM
Username: Password:
Login with username, password and session length

Forgot your password?
Load another script
DSLua Community
Welcome, Guest. Please login or register.
November 20, 2008, 07:15:24 AM
1723 Posts in 315 Topics by 5664 Members
Latest Member: GlygievyGal
DSLua Community  |  General DS Programming Chats  |  Code Hashing  |  Load another script « previous next »
Pages: [1]
Author Topic: Load another script  (Read 1063 times)
molster
Waxing Crescent
**
Posts: 19


« on: July 20, 2007, 10:40:54 PM »

Im just now for the firs time using lua (I script in ActionScript (flash)) so I know the basics of coding =)-


anyway, what I wish to know is, is it possible to load another .lua file from a lua file. so instead of a script like

DSLua.WaitForAnyKey()

then just having it end, make it so once hit, it loads a new .lua file. (also, though i dont need this now, when(or if) you load the new script, can you pass all the vars to it?
Logged
Jeremysr
Waxing Gibbous
****
Posts: 254



WWW
« Reply #1 on: July 21, 2007, 12:13:37 AM »

Yes just use this function:

dofile( "file.lua" )

And I *think* it should run it as if the the code in that file was right inside the file you are running. So you should be able to use the same variables between the two files.
Logged
molster
Waxing Crescent
**
Posts: 19


« Reply #2 on: July 21, 2007, 01:45:00 AM »

Thanks! that will help keep my main file looking a lot cleaner.

(ps: your DSlua tutorial site is the best)
Logged
Pages: [1]
« previous next »
    Jump to:  



    (C) 2008 DSLua

    DSLua - Best scripting language for Nintendo DS home-brew!