TI-Basic 84 Programming/Book Conventions
Conventions
editA number of conventions are used in this book. Learning these conventions will aid in the learning process.
As this is a book designed to teach one how to program TI-Basic programs, there will be several pieces of code throughout the chapter. Thus, special boxes have been designed so that one can easily find where certain portions of code exist.
There are three main code boxes: Syntax, Examples, and Output.
Syntax
editSyntax is the way a command must be stated. For example, the output function has certain restrictions. There must first be a Y coordinate, an X coordinate, and then what is to be outputted. To inform one of all these restrictions, this book would display them in the following fashion:
Output(Row,Col,Stuff
- Where Row is a number or real variable that will determine the vertical position of Stuff.
- Row can be a number between 1 and 8 (there are 8 lines of text on the screen)
- Where Col is a number or real variable that will determine the horizontal position of Stuff.
- Col can be a number between 1 and 16 (there are 16 characters across the screen)
- Where Stuff is a string, number, equation, or variable of any type, that is to be displayed at the specified location.
Examples
editExamples are just that, Examples. They are examples of the commands in use, sometimes only containing one command, sometimes containing more. Often there are more than one example for a given function, with different variations in the way the command can be used. Examples are formatted as follows
<BEGIN>
- Disp "HELLO WORLD"
The previous example will always display HELLO WORLD.
<END>
Usually, but not always, there will be some sort of explanation either before or after the example.
Output
editOutput is merely used to show one how certain programs or functions would look on the calculator. If there is an example prior to the Output box, it is implied that the program was executed from the homescreen, but that the program name is not present (i.e. there is no pgrmPROGRAM display for each output). Outputs are displayed as follows:
<BEGIN>
HELLO WORLD
<END>
Calculator vs Computer
editCode
editIt should be noted that the calculator screen can only show a certain amount of characters (16 characters monochrome calculators, and 22 characters for color calculators). This constraint is ignored in this book. In other words, while the code would be like this on the calculator:
- Disp "Hello, Wo
rld!","My name i s Bob"
It is still written this way in this guide:
- Disp "Hello, World!","My name is Bob"
Commands
editIt must be understood that to "type" commands (commands are all code other than strings and mathematical functions) like Disp for example, are not written by typing each character (D then i then s then p), but rather by accessing the token Disp in one of the menus built into the calculator. Most instructions are only found in certain menus.
The Disp instruction, for example, can be found by pressing PRGM, then moving to the I/O menu, and then either pressing 3 or scrolling down to it and pressing Enter. Each keypress, in order. ((NOTE: This assumes you are already in the Program Editor, this makes a big difference))
In this book, in order to shorten the commands, the above would be shown as PRGM:I/O:3.
These are the exact keys that are pressed in order to access the command, separated by a colon ':'. If a command is accessed by pressing the second key, the menu has the menu name listed first, then the actual key text listed in parenthesis.
So, in order to find Pxl-On(, the instructions would be 2nd:DRAW(PRGM):POINTS:5. the 2nd key is pressed, followed by the DRAW menu (which is really the secondary PRGM), then one navigates to POINTS, then presses 5 or finds the function Pxl-On(, on the list.
It should also be noted that most instructions can also be accessed through the Catalog, 2nd:CATALOG(0).