Is anything wrong here? It keeps crashing on the second run from TI-OS, and the Axe app crash after running this.

Code:
0->S->T->X+1->Y
ClrHome
GetCalc("appvTEMP",2000)->Q
!If Q
Fill(Q,2000,0)
For(A,0,length(P))
   If {P+A}=10
      T++
      0->S
   Else
      Copy(P+A,80*T+Q+S,1)
   End
End
Else
End
Disp P
Repeat getKey
End
ClrHome
Disp Q
Repeat getKey
End
ClrHome


P is a pointer pointing to an AppVar.
Guess Q is too large.
Jeff calc 84 wrote:
P is a pointer pointing to an AppVar.

Can you give what P is actually pointing to? I don't know what exactly its used for, like what's the size and the like?
P is pointing to an AppVar that has a max size of 2000 bytes.
Also, can "presending" the TEMP appvar solve the problem? just asking.
New code:

Code:
0->S->T->X+1->Y
ClrHome
GetCalc("appvTEMP",2000)->Q
If Q
Fill(Q,2000,0)
For(A,0,length(P))
   If {P+A}=10
      T++
      0->S
   Else
      Copy(P+A,80*T+Q+S,1)
   End
End
Else
End
Disp P
Repeat getKey
End
ClrHome
Disp Q
Repeat getKey
End
ClrHome


also might just be that Q overwrote code from 0x0.
Jeff calc 84 wrote:

Code:
GetCalc("appvTEMP",2000)->Q
If Q
Fill(Q,2000,0)

Why is the "If Q" there? Q is always going to equal the pointer to Q so you can safely 'reset' the appvar without risking the device's integrity.

I had to fix this issue for a similar situation with an appvar for a map.
My Code:

Code:
GetCalc("appvMAP")->A
If A=0
GetCalc("appvMAP",400)->A
Fill(A,400,2)
End


Also, if the variable is going to be deleted after program termination, I would set it as a temp variable [2nd]->[9].

Code:
GetCalc("tmpTEMP",2000)->Q

That removes the need to reset it every time you run the program because it will delete itself after program termination.
If you need the variable to persist though the best course of action would be to use an equivalent of my code listed above, the only caveat is that it can bug out if you are coding for a Shell like DoorsCS.

Edit: Fixed Minor grammatical errors (I'm a perfectionist)
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
» Goto page Previous  1, 2, 3 ... 11, 12, 13
» View previous topic :: View next topic  
Page 13 of 13
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement