This App is No Longer Maintained. Visit the Replacement at StrokesPlus.net

StrokesPlus Forum
                       
StrokesPlus Forum
Home | Profile | Active Topics
Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 About
 Did you know...
 DYK: Lua State Persistence
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Rob

USA
2615 Posts

Posted - 12/19/2011 :  03:55:18  Show Profile  Visit Rob's Homepage
Did you know:

The Lua script engine state is persistent the entire time StrokesPlus is running. So if you set a variable in one action, it will still exist and have the same value stored an hour later and can be referenced in a completely separate action.

Note, however, to ensure all variables are checked/initialized if you're going to use them across actions as referencing a variable which hasn't been assigned/declared will likely cause StrokesPlus to crash.

Rob

USA
2615 Posts

Posted - 12/19/2011 :  09:36:40  Show Profile  Visit Rob's Homepage
Note that this only applies to a global variable.

If you define the variable in Lua using local, it will not persist.

This is for the current script only:

local strMsg = "Test"

This will be available for all actions:

strMsg = "Test"
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
StrokesPlus Forum © 2011-2018 Rob Yapchanyk Go To Top Of Page
Snitz Forums 2000