Post Reply 
App development on the Prime
09-29-2024, 10:57 PM
Post: #6
RE: App development on the Prime
(09-29-2024 01:11 PM)CheshireChris Wrote:  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.

What does AVars(“Lat”):=53; do that Lat:=53; doesn't?

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: App development on the Prime - toml_12953 - 09-29-2024 10:57 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: 2 Guest(s)