here is a good was to deal with highscore appvars:

place this at the beginning of your program:

Code:
:"appvNAME"→Str1
:GetCalc(Str1)→θ
:!If θ
:UnarchiveStr1
:GetCalc(Str1)→θEnd
:!If θ
:GetCalc(Str1,[desired size])→θEND


this first checks to see if appvNAME exists in RAM. if not, it attempts to unarchive appvNAME. if it is not found in the archive, the appv is created and made [desired size] bytes long. the pointer to the beginning of appvNAME is stored in theta, so accessing/storing is as easy as {θ+[n]} or S→{θ+[n]}

at the end of your program simply add
:Archive Str1
for safe-keeping
shmibs wrote:
here is a good was to deal with highscore appvars:

place this at the beginning of your program:

Code:
:"appvNAME"→Str1
:GetCalc(Str1)→θ
:!If θ
:UnarchiveStr1
:GetCalc(Str1)→θEnd
:!If θ
:GetCalc(Str1,[desired size])→θEND


this first checks to see if appvNAME exists in RAM. if not, it attempts to unarchive appvNAME. if it is not found in the archive, the appv is created and made [desired size] bytes long. the pointer to the beginning of appvNAME is stored in theta, so accessing/storing is as easy as {θ+[n]} or S→{θ+[n]}

at the end of your program simply add
:Archive Str1
for safe-keeping


I gotta try that too!! Oh my god, it looks good, thank you!

I changed it to this, though:


Code:
:"appvPongHS"->Str1
:GetCalc(Str1)->T
:!If T
:Unarchive Str1
:GetCalc(Str1)->T
:End
:!If T
:GetCalc(Str1),8)->T
:End
  
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
Page 2 of 2
» 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