Author Topic: Questions about appvars  (Read 7060 times)

0 Members and 1 Guest are viewing this topic.

Offline Eniripsa96

  • LV2 Member (Next: 40)
  • **
  • Posts: 28
  • Rating: +3/-0
    • View Profile
Questions about appvars
« 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?

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Questions about appvars
« Reply #1 on: April 08, 2011, 10:25:03 pm »
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! :)

Offline Eniripsa96

  • LV2 Member (Next: 40)
  • **
  • Posts: 28
  • Rating: +3/-0
    • View Profile
Re: Questions about appvars
« Reply #2 on: April 08, 2011, 10:27:51 pm »
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.

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Questions about appvars
« Reply #3 on: April 08, 2011, 10:46:01 pm »
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. :)

Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
Re: Questions about appvars
« Reply #4 on: April 08, 2011, 10:58:18 pm »
How do you create your app var?
School: East Central High School
 
Axe: 1.0.0
TI-84 +SE  ||| OS: 2.53 MP (patched) ||| Version: "M"
TI-Nspire    |||  Lent out, and never returned
____________________________________________________________

Offline Eniripsa96

  • LV2 Member (Next: 40)
  • **
  • Posts: 28
  • Rating: +3/-0
    • View Profile
Re: Questions about appvars
« Reply #5 on: April 08, 2011, 11:04:49 pm »
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?
« Last Edit: April 08, 2011, 11:21:39 pm by Eniripsa96 »