Post Reply 
Initializing AVars
11-16-2024, 11:07 PM
Post: #5
RE: Initializing AVars
(11-16-2024 05:33 PM)komame Wrote:  
(11-15-2024 06:15 PM)keldor314 Wrote:  I've noticed that the connectivity kit can be a bit inconsistant about sending AVars with apps, so I'm looking for a way to work around this.
Could you elaborate on the issue you're experiencing with the connectivity kit and AVars? There are many applications that rely on this functionality and seem to work flawlessly. I've never encountered any problems with my applications as well.

If your only goal is to read and write data to the same variables and you simply want to ensure that this information is not lost after the program editing, then the variables should be integrated into the app from the start. They should not be created dynamically in the code but rather defined in the Home view of the application. This approach ensures they are permanently associated with the app and are initialized immediately upon its installation. You can then reference these variables in the program code without needing to use AVars(), as they do not require declaration.

I don't remember my exact steps, but I do know that when I try to send my app from my calculator to the emulator, the AVars aren't copied at least some of the time. This results in the app failing to compile/run until I manually recreate every AVar referenced in the code.

My preferred way of handling this would be to create AVars in the RESET() function, which is called when you reset the app from the app browser, and can also be called from inside START() if needed. This works in isolation, but and usage of an AVar "directly" in an expression anywhere will prevent the app from compiling and running.

The app is a moderately complex parametric 3D grapher, so there are currently about 20 AVars between function definitions and bounding boxes and camera and grid definitions. I expect the number to increase as I add options for drawing axes and bounding boxes, as well as multiple functions to plot.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Initializing AVars - keldor314 - 11-13-2024, 10:02 PM
RE: Initializing AVars - komame - 11-15-2024, 07:03 AM
RE: Initializing AVars - keldor314 - 11-15-2024, 06:15 PM
RE: Initializing AVars - komame - 11-16-2024, 05:33 PM
RE: Initializing AVars - keldor314 - 11-16-2024 11:07 PM
RE: Initializing AVars - komame - 11-17-2024, 06:35 PM



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