Lessson 8 - Input and InputStrng
Input and Input string
are invaluable. Input can be used to make a cursor on a
graph screen (AJAM shell) and
InputStrng can be used for player names, etc. First, Input.
When the Ti-86 encounters Input in a program, it displays a cursor on the graph screen, preferably over a picture you have made. When the cursor is moved, and Enter pushed, the Ti-86 updates the x and y coordinates of the pointer and continues through the program. Using If and Then statments (Lesson 6) you can make the program run another program if the x and y are equal to something. An example is as follows. Don't forget to set the graph size. This program will say Smile! if an area in the upper right hand corner of the screen is pushed.
:120->xMax
;Establishes graph window
:1->xMin
:1->xScl
:60->yMax
:1->yMin
:1->yScl
:ClDrw
;Clears graph screen
:Lbl T
:RcPic
BACKRND ;Diplays your backround
:Input
;Places cursor
:If
y>52
;When enter is pressed, the program checks if y is greater than
52. If it isn't, it skips
:Then
to the end of the then statement. If y is greater than 52,
then the program goes on
:If
x>110
to check if x is greater than 110. If x is greater than
110, then it diplays the
:Then
statement, otherwise, it continues to the end of its then
statement and goes to "T"
:Disp "Smile!"
:End
:End
:Goto T
This program establishes a "hotbox" in the upper right of the screen. A programmer can make many of these boxes and therefore run many programs instead of displaying messages. This technique is also very effective for maps on RPG games. Have fun!
There is also the InputStrng command which I use to store player names, etc. This is the basic format:
:InpSt "Enter your name:",NAME1
This will store
whatever the user enters to the string NAME1. You can
analyze the length of this string using If and tell the user if
their name is too long. That's that.