Post Reply 
App development on the Prime
09-29-2024, 01:11 PM (This post was last modified: 09-29-2024 01:13 PM by CheshireChris.)
Post: #2
RE: App development on the Prime
Another problem I faced was how to read the value of an app variable if it existed, and create it if it didn’t exist, so I could do one-time initialisation of my data, but not overwrite the value the user had entered on subsequent runs. The solution I came up with, to do this for a variable called “Lat” (the user’s geographical latitude) was this:

Code:

// If variable “Lat” doesn’t exist, create it with a default value
IF POS(AVars,“Lat”)==0 THEN
  AVars(“Lat”):=53;
END;

This uses the fact that AVars used with no parameters returns a list of currently existing app variables.

Chris
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: App development on the Prime - CheshireChris - 09-29-2024 01:11 PM
RE: App development on the Prime - Jase - 09-29-2024, 05:29 PM
RE: App development on the Prime - Tyann - 10-01-2024, 06:40 PM
RE: App development on the Prime - Jase - 10-01-2024, 10:54 PM
RE: App development on the Prime - komame - 10-02-2024, 04:46 AM



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