How can I maintain a variables value when editing a Program or App
|
12-18-2014, 07:13 AM
Post: #5
|
|||
|
|||
RE: How can I maintain a variables value when editing a Program or App
Hello,
Nice creatives solutions to the problem! I am having a hard time finding other ones, so you guys are doing good... Have you thought about using a note? You could, upon program completion, create a note that contains a sequence of assignments "var1:=value; ....." and create either a function called at program start, or called by hand when you just recompiled the program (actually, even better, upon variable initialization) that would reload everything... something like the function bellow would save the variables (I think, I have not tested it). call/use it when exiting your program... local MyRememberedVarList= { 'var1', 'var2', 'var3' ... } Notes("MyProgramNave_SavedVars"):= SIGMALIST(EXECON("""&1:=+&2;\n""", MyRememberedVarList, eval(MyRememberedVarList)); Now, for the reloading, as the LAST global variable declared in your program (non exported), do: RELOAD:= IFTE(POS(Notes, "MyProgramNave_SavedVars"), 0, EXPR(Notes("MyProgramNave_SavedVars"))); This will cause, upon program compilation, the IFTE command to be executed. And that command should reload all program variables automaticaly... unless I messed up somewhere... convoluted hey! Cyrille |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
How can I maintain a variables value when editing a Program or App - Bob Frazee - 12-17-2014, 06:52 PM
RE: How can I maintain a variables value when editing a Program or App - Han - 12-17-2014, 07:33 PM
RE: How can I maintain a variables value when editing a Program or App - Snorre - 12-17-2014, 07:37 PM
RE: How can I maintain a variables value when editing a Program or App - Han - 12-17-2014, 08:16 PM
RE: How can I maintain a variables value when editing a Program or App - cyrille de brébisson - 12-18-2014 07:13 AM
RE: How can I maintain a variables value when editing a Program or App - Didier Lachieze - 12-19-2014, 09:03 AM
RE: How can I maintain a variables value when editing a Program or App - Bob Frazee - 12-21-2014, 11:35 PM
RE: How can I maintain a variables value when editing a Program or App - Didier Lachieze - 12-22-2014, 09:42 AM
RE: How can I maintain a variables value when editing a Program or App - Bob Frazee - 01-24-2015, 01:41 AM
|
User(s) browsing this thread: 2 Guest(s)