Omnimaga
Calculator Community => TI Calculators => Axe => Topic started by: yunhua98 on January 01, 2011, 09:49:28 pm
-
I really never made a game that needed a lot of data, but I'm trying now. I need some help on storing to an appvar and reading from it. Can someone give me example code to store a series of 10 ones and zeros. To an appvar and then display the numbers?
-
http://ourl.ca/84305 (http://ourl.ca/84305)
Examine that code, it loads/reads from appvar, but also stores.
I'll edit this post later with the *exact* code that does it, also '|' is the token 2ND + 8 in the calculator. 'appvar'
-
Could you copy and paste that and put it in this topic without code tags? I'm on my iPod now and code tags dontwork.
Edit: actually, I want to be able to store digits in it and read out the individual digits. Like storing numbers in basic to a list and doing L1(C)
-
Basically --
"appvMYDATA"->Str1
Unarchive Str1
!If GetCalc(Str1)
Getcalc(Str1,10)->A
End
1->{A}
Attempts to unarchive the appvar MYDATA, then if it doesn't appear to exist, creates a 10 byte long appvar. The pointer for that appvar is stored to the variable A -- use it like L1 (except smaller).
-
"appvNAME"->Str1
Unarchive Str1
!If getcalc(Str1)->A
Getcalc(Str1,10)->A
For(B,0,9)
0->{A+B}
End
End
-
Plus another End in there somewhere, but that's pretty much it. Also nice job on the optimizing :)
EDIT: Fill(?
EDIT2: squidgetx.
-
Yes i forgot it :D .Fixed now
-
"appvNAME"->Str1
UnArchive
!If GetCalc(Str1)->A
GetCalc(Str1,10)->A
0->{A}r
Fill(A,10)
End
After creating your appvar you can use its pointer that was created by GetCalc (A in this case) as a pointer to free RAM just like you would with L1-L6 (like Michael Lee said)
-
If it works it's a nice optimization :)