|
We're glad you came by, but you might find what you're looking for elsewhere. TI-Basic Developer is not the site it once was. While its information on commands and other calculator features remains almost second-to-none, its forum, archives, and even hosting service, Wikidot, have been decaying for years. The calculator community would love to see what you're working on, or help you in your next coding adventure, but TI-Basic Developer is no longer the place to do it. Instead, you should head over to Cemetech (primarily American) or TI-Planet (primarily international). Both are active, well-established forums with their own archives, chatrooms, reference material, and abundant coding tools and resources. We'll see you there, we hope. |
Locks the specified variables
Lock var1, var2, etc
Menu Location
This command can't be found in any menu besides the command catalog.
This command works on all calculators.
X byte(s)
The lock command prevents a variable's value from changing. In programs and functions, lock is usually used to stop a variable from undesirably changing. If a variable is universally defined (like files in folders), the lock command has a popular purpose of making the variable constant (unchanging) throughout use in sets of programs.
input "Input var1 here: ",var1
lock var1
text "You can no longer change var1."
© var1 can now be used as a constant variable.
©... <program statements that require the value of var1>
prgm2() ©var1 may not change in any other programs.
unlock var1Note: the © command will turn any code written until the next ':' into comments. (neat-freaks love this.)
Comments are very helpful for people who forget, especially when dealing with tricky commands and code. Using comments for the lock command will help you remember to unlock the variable when the time comes to delete it.
