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.
Defines a set of lines as executable program code.
Func
function code
EndFunc
Menu Location
Press:
- Catalog ([2nd] + 2 on 92/+/v200) to access the catalog menu
- F to scroll to the F section
- Use arrows to navigate to Func
Or type Func using the keyboard
This command works on all calculators.
4 bytes
This command is used at the beginning/end of a function to tell the calculator to interpret it as code. Without these commands at the start and end of a function, the interpreter will pass a syntax error. Note that unlike Programs, functions cannot write to the screen, so there can be no IO commands or Draw commands. In addition, you cannot edit global variables in Functions, so you have to declare a variable as local using Local before initializing them. However, the reason you may want to use functions instead of programs is that unlike programs, you can return a value from a function. You can either use the Return command, or the function will return whatever the last value was before you quit the function.
:test()
:Func
://code to run goes here
:EndFunc
Advanced Uses
Using the local and define commands, you can create local submethods in your programs. Assuming the following code is inside a program block already, the syntax would be:
:Local test
:Define test()=Func
://function code goes here
:EndFunc