Omnimaga
Calculator Community => TI Calculators => Axe => Topic started by: Eniripsa96 on April 08, 2011, 10:21:20 pm
-
I tried using an appvar for basically a boolean list in one of my programs, but it kept giving me back bizzare numbers when using {x + appvarName}, where x would be the correspondind byte number, despite me only storing 1s or 0s into each byte. So how do appvars differ from lists when using them with the curly brackets that cause this?
Also, how do you store/recover compiled programs into/from appvars?
-
Two things to be concerned about:
1.) Make sure you're not reading data that you haven't put into the appvar. Don't assume that the appvar starts filled with zeros, because it most likely isn't.
2.) Make sure the appvar is big enough for your purpose. If you're using more data that the appvar can hold, it'll likely lead to an eventual RAM Clear. ;)
Good luck! :)
-
1) yeah, I began with filling each of the 4 bytes I needed with 0s, then if a check was true, then I stored a 1 back into the corresponding byte. However, after doing this for all 4 bytes, reading the results gave back numbers like 253 and crazy numbers like that. I'm not too sure why.
2) Yeah, I haven't had any problems with appvar sizes yet, but I haven't figured out how to store a program into an appvar yet though.
-
I haven't figured out how to store a program into an appvar yet though.
For this, you'll have to make the appvar big enough and then use the copy command. Alternatively, you could just change a program directly into an appvar just by changing the type byte. :)
-
How do you create your app var?
-
Alternatively, you could just change a program directly into an appvar just by changing the type byte. :)
Sorry, but I am unfamiliar with this, could you explain a bit?
How do you create your app var?
I did...
Unarchive "appvarName"
!If
GetCalc("appvarName",4)->A
Else
GetCalc("appvarName")->A
End
yes, I realize this could be optimized, but I was testing appvars to see if i could use them like a list, and that seems to have failed, although I bet I just did something wrong.
EDIT: I tried the copy function to save a program into an appvar, then the appvar into another program (just to try both cases), but then I couldn't run the new program. Is Copy(Y1,A,size) the way I'm supposed to do it, where Y1 is the source, and A is the new program/appvar that I'm storing the data into?