Calculator Community > Grammer

Grammer Tutorial

<< < (3/3)

Xeda112358:
Okay, I added it :) It seems to have a different format after a certain point, though, and I could figure out why :/ Also, I put it under general tutorials.

Xeda112358:
So here is a little note on programming when it comes to creating a variable. When you want to use some RAM for long term (like saving scores and data and whatnot), you should store to an appvar or a program with a weird name. This way, it wont be as easy to access the data for inexperienced calc users.

However, if you only need the data for the duration of the game, you should use Temporary Programs because these get deleted automatically by the OS. This means it won't eat up RAM with useless data and it does a few other useful things (Send( will not delete an existing var, so if the var exists at 17 bytes and you need 47, you will have an issue).

Also note that if you do this, you will want to name it something weird, that way you can be sure no program will have that name. For example, creating a temp prog with a name BuF-1 is good since programs don't use lowercase letters or the inverse power under normal circumstances.

So to create an ___ variable named BuF with 7 bytes:

--- Code: ---Send(7,"UBuF     ;Creates an AppVar
Send(7,"EBuF     ;Creates a Program
Send(7,"FBuF     ;Creates a Protected Program
Send(7,"VBuF     ;Creates a Temp Program

--- End code ---
So I hope this helps!

Navigation

[0] Message Index

[*] Previous page

Go to full version