How can I maintain a variables value when editing a Program or App
|
12-17-2014, 07:33 PM
Post: #2
|
|||
|
|||
RE: How can I maintain a variables value when editing a Program or App
One way I thought about doing this the following:
1. Use a user-created variable. If the variable doesn't exist, prompt the user to create it by typing in something like: SaveData:=0; in the Home view. The app should never proceed if this variable doesn't exist. So how do we test if it exists without compile errors? Via indirection. Code: LOCAL MyData; The AbortApp() routine should display a message telling the user how to create the variable SaveData. It should also contain the KILL command to completely exit the program/app. If there is no error, then all your data is imported into MyData and you can proceed as usual. If MyData is a list of stuff, then MyData(1) will get the 1st element, MyData(2) will get the 2nd element, etc. 2. To save your data, encapsulate everything into a single list and store it into MyData. Now, export using: Code:
Thus you use MyData to access the data, and the EXPR() command to do your importing and exporting. Anytime you change your code, SaveData is unchanged. And compiling doesn't produce errors since there is no direct reference to SaveData. Graph 3D | QPI | SolveSys |
|||
« 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: 1 Guest(s)