Post Reply 
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
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: How can I maintain a variables value when editing a Program or App - cyrille de brébisson - 12-18-2014 07:13 AM



User(s) browsing this thread: 2 Guest(s)