Contact - please use subject="pc99 page" to avoid spam trap!
This page contains articles on the TI99/4a. There is a brief linked index to help you find something useful.
Web article Three- published April 1999
3. To turn off the QUIT key (FCTN =): CALL LOAD(-31806,16)
Note: Now you must use "BYE" to quit BASIC and get back to the
title screen.
4. In an IF-THEN-ELSE statement if you refer to a variable without
any other type of relationship then this means "does not equal
zero"
8. To get TRUE random numbers install this line into your program:
CALL PEEK(-31880,A,B)::CALL INIT::CALL LOAD(-31808,A,B)
9. To erase the program from memory but not erase the screen (and
not disturb any assembly routines in lower memory: CALL INIT::CALL LOAD(-31952,255,231,255,231)
10. The manual tells you that there are 16 different character sets
that you can redefine and change colors on. Actually there are
17 - Set #0 is never mentioned.
11. When LISTing a program and you see a line reference to "32767"
this means (unless you actually used that line #) that you
resequenced the program while you had a GOTO (or GOSUB, etc) to
a non-existing line.
12. To LIST a portion of a program to the printer then enter the
following command:
18. Instead of using the IMAGE statement you can define a variable
in the image you would like the output to look and then say
"USING variable name".
eg - 100 F$="###.##"
110 DISPLAY AT(12,1):USING F$:A
Of course, unlike the IMAGE statement which can be anywhere in
the program, the variable would have to be defined BEFORE using
it in a DISPLAY AT or PRINT statement.
19. When using the DISPLAY AT statement you can use TAB to properly
locate where further information is to be displayed.
eg: To set up the following display
MAIN MENU:
1 - Edit
2 - Add
3 - Exit
you can set up each line with an individual DISPLAY AT
statement or you can do the following:
DISPLAY AT(5,5):"MAIN MENU";TAB(7);"1 - Edit";TAB(7);"2 -
Add";TAB(7);"3 - Exit"
This will put the information on 4 separate lines because
when the computer tries to perform the TAB(7) it finds that
that location has been already bypassed on the present row
and therefore it automatically goes to the next row.
22. Another method to save memory by reducing the size of a program
is to replace a constants used with a variable. This is
assuming that that constant is used a number of different times
in the program.
23. When you are editing a program and accidently erase a line by
pressing FCTN 3 to get the line back simply type in a single
quote mark and then press ENTER. This gives a syntax error and
the erased line is back because the change was not syntactically
correct and thus not acceptable. The putting in of the quote
mark must be done before moving from the line that was erased.
Includes:
Hints and Tips from Bill Sponchia;
graphics programming listings;
Jim Swedlow:
TI Bits; and
Number systems- hex, dec, bin, nibbles.
HINTS, TIPS & ANSWERS (HTA)
BASIC & EXTENDED BASIC
100 CALL INIT::CALL LOAD(-31952,255,0,255,0)
110 END
2. The following program should be saved in the MERGE format as a
handy utility:
1 CALL CLEAR
2 OPEN #1:"DSKn.",INPUT,RELATIVE,INTERNAL !!n = disk drive #
3 INPUT #1:A$,J,J,K
4 DISPLAY "SIZE=";K;" USED= ";J-K
5 FOR LOOP= 1 TO 127
6 INPUT #1:A$,A,J,K
7 IF LEN(A$)=0 THEN 10
8 DISPLAY A$;TAB(12);J
9 NEXT LOOP
10 CLOSE #1
11 INPUT "NAME OF PGM TO DELETE ELSE TYPE GO ":DEL$
12 IF DEL$="GO" THEN 15
13 DELETE "DSKn."&DEL$ !!n = disk drive #
14 GOTO 11
15 STOP
When programming this program can be used to catalog a diskette
without getting out and loading in a disk manager. It is also
written to allow for the deleting of files from the diskette. To use just merge in with the program you are presently working
on (of course it is assumed you started it a line 100 and did
not use lines 1 to 15).
eg - IF X THEN 140 ELSE 100 - means If X does not equal 0 then
go to 140 but if it equals 0
then go to 100.
5. When using XB prescan it will enable you to run programs that
the computer will normally reject. Two things that I have been
able to do are - (a) mixing FOR-TO statements and IF-THEN-ELSE
statements under one line number; and (b) input two NEXT's but
have only one FOR. Here is the program showing these:
100 J=0
110 !@P-
120 FOR J=1 TO 20 :: IF J/2=INT(J/2) THEN PRINT J ELSE NEXT J
130 IF J>19 THEN 150
140 NEXT J :: !@P+
150 END
6. To automatically return to the Master Title Screen (or Menu for
Vermenu users) instead of "END" insert the following:
CALL INIT::CALL PEEK(2,A,B)::CALL LOAD(-31804,A,B) or
CALL INIT::CALL LOAD(31804,0,36)
7. To restrict a CALL KEY statement to taking only one input at a
time, no matter how long a particular key is held down -
100 CALL KEY(0,K,S)::IF S<1 THEN 100
By restricting the status to +1 this will overcome the problem
of the sometimes repeating key.
LIST "filename":line number range
eg: LIST "PIO":130-240 - will LIST to PIO lines 130 to 240
(inclusive)
13. deleted. sjs.
14. deleted. repeat of no 3 above! sjs
15. Did you know that you could identify your GOSUB routines within
the program without using the "!" or REM statement. You are
allowed to put one word (string) after the GOSUB line number.
Here's an example program:
10 CALL CLEAR::PRINT "HERE I GO.."
20 GOSUB 50 DELAY_ROUTINE ::PRINT "I'M BACK!"
30 END
50 FOR T=1 TO 400::NEXT T::RETURN
16. Here are some interesting redefinitions for characters. To use
them the proper format is "CALL CHAR(##,string) where "##"
stands for the number of Character to be redefined and "string"
is one of the following (or any other that you may have).
000804027F020408 = right arrow
00102040FE402010 = left arrow
081C2A4908080800 = up arrow
0008080B492AC108 = down arrow
00FF = solid line
0000FE2828282828 = pi symbol
00083C4848483C08 = cent sign
0002020404482810 = check mark
21. When programming in XB it pays in two ways to squeeze as many
statements as you can into each program line. The first reason
is that it saves memory by eliminating line numbers; the second
is that it speeds up execution by eliminating the need for the
program to process extra lines of code.
17. The IMAGE statement (eg - 100 IMAGE ###.##) can be used with the
DISPLAY AT statement using the following format -
DISPLAY AT(5,12):USING 100:A
20. Did you know that you could delete a file when you close it.
The statement is: CLOSE #1:DELETE
24. If you need to know if CALL INIT has already been executed in
your program put in the following lines:
10 CALL PEEK(8198,A,B)::IF A=170 AND B=85 THEN xxx ELSE CALL
INIT !!xxx = line number to go to if CALL INIT
already executed.
25. Here's a use of the MIN and MAX statements:
MIN - If a variable is restricted to being no higher than 6 you
would normally say IF A>6 THEN A=6 however you can say
A=MIN(A,6)
MAX - If a variable is restricted to being no lower than 6 you
would normally say IF A<6 THEN A=6 however you can say
A=MAX(A,6)
26. You can LIST a program to disk by stating LIST "DSKn.program".
This gives a D/V 80 file which is then readable by TI-Writer.
This can be helpful for putting program listings in documents
and allows you to use RS to amend or FS to locate something in a
long program.
27. Here's a short program to write DATA lines which can then be
merged into another program.
100 ON WARNING NEXT
110 DISPLAY AT(10,1)ERASE ALL:"ENTER FIRST LINE NUMBER:":: ACCEPT
AT(10,25)BEEP VALIDATE(DIGIT)SIZE(4):LN
120 DISPLAY AT(12,1):"ENTER INCREMENT":: ACCEPT AT(12,17)BEEP
SIZE(3)VALIDATE(DIGIT):I
130 DISPLAY AT(14,1):"ENTER FILENAME:":: ACCEPT AT(14,16)BEEP
VALIDATE(UALPHA,DIGIT)SIZE(10):FN$
140 OPEN #1:"DSK1."&FN$,VARIABLE 163
150 DISPLAY AT(2,6)ERASE ALL:"PRESS ENTER TO END":: DISPLAY
AT(22,1):"ENTER A LINE OF DATA:":: LINPUT D$
160 IF D$="" THEN 190
170 PRINT #1:CHR$(INT(LN/256)&CHR$(LN-256*INT(LN/256))&CHR$(147)&D$&CHR$(0)
180 LN=LN+I:: GOTO 150
190 PRINT #1:CHR$(255)&CHR$(255)
200 CLOSE #1:: END
This will save your DATA lines in a Merge format almost ready to
be merged into you program. Before this can be done you must do
the following:
i) type NEW and press ENTER to clear memory
ii) MERGE in the saved DATA lines. (ie - MERGE DSK1.filename
iii) EDIT each DATA line by retyping (typing over) the word DATA
iv) SAVE the edited DATA lines in the MERGE format (ie - SAVE
DSK1.filename, MERGE)
It is now ready to be put into you program.
THIS ARTICLE HAS BEEN PUT TOGETHER FROM MANY SOURCES BY BILL SPONCHIA.
==============================================================
Return to top of page