home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.whtech.com
/
ftp.whtech.com.tar
/
ftp.whtech.com
/
compuserve
/
Basic
/
DISPLA.YAT
< prev
next >
Wrap
Text File
|
2006-10-19
|
9KB
|
191 lines
100 GOTO 130 :: BLANKLINE,C,FLAG,I,K,L,R,S,EA$,H$,I$,M$,M1$,M2$,O$,TM$ :: CALL C
LEAR :: CALL KEY :: CALL VCHAR
110 DEF C$(I)=CHR$(I)
120 !@P- REVISED 85/04/02
130 TM$=CHR$(128)&CHR$(135)&CHR$(128)&CHR$(162)&CHR$(135)&RPT$(CHR$(213),15)&CHR
$(128)&CHR$(135)
140 DISPLAY AT(1,1)ERASE ALL:"DISPLAY/AT: ""FAIRWARE""" :: DISPLAY AT(2,2):"by
Barry Albert Traver"
150 DISPLAY AT(3,5):"Genial Computerware" :: DISPLAY AT(4,5):"835 Green Valley D
rive"
160 DISPLAY AT(5,5):"Philadelphia, PA 19128" :: DISPLAY AT(7,5):"If this program
is worth"
170 DISPLAY AT(8,1):"it to you, please send $1 to" :: DISPLAY AT(9,1):"me and I
will put you on my"
180 DISPLAY AT(10,1):"mailing list to receive news" :: DISPLAY AT(11,1):"of othe
r programs and of any"
190 DISPLAY AT(12,1):"future upgrades of this one." :: DISPLAY AT(13,1):"Thank y
ou."
200 DISPLAY AT(15,5):"Like ""Freeware,"" this is" :: DISPLAY AT(16,1):"an exampl
e of User/Supported"
210 DISPLAY AT(17,1):"(""U/S"") software. Feel free" :: DISPLAY AT(18,1):"to sh
are it with others. It"
220 DISPLAY AT(19,1):"is a free program, although" :: DISPLAY AT(20,1):"a donati
on is encouraged and"
230 DISPLAY AT(21,1):"will encourage the author to" :: DISPLAY AT(22,1):"write m
ore!"
240 DISPLAY AT(24,1):"(Press any key to continue.)"
250 CALL KEY(0,K,S):: IF S=0 THEN 250
260 DISPLAY AT(1,1)ERASE ALL:"DISPLAY/AT by B.A. Traver" :: DISPLAY AT(4,1):"Her
e are the choices:"
270 DISPLAY AT(7,1):"1 Read instructions." :: DISPLAY AT(9,1):"2 Set up blank TI
-Writer"
280 DISPLAY AT(11,5):"file." :: DISPLAY AT(13,1):"3 Convert prepared TI-Writer"
290 DISPLAY AT(15,5):"file to program in" :: DISPLAY AT(17,5):"MERGE format."
300 DISPLAY AT(19,1):"4 End program." :: DISPLAY AT(22,1):"What is your choice (
1, 2,"
310 DISPLAY AT(24,3):"3, or 4)?"
320 CALL KEY(0,K,S):: IF S=0 THEN 320 ELSE IF K<49 OR K>52 THEN 320
330 ON K-48 GOTO 340,710,930,1370
340 ! INSTRUCTIONS
350 DISPLAY AT(1,1)ERASE ALL:"DISPLAY/AT by B.A. Traver" :: DISPLAY AT(3,6):"Pro
grammer: Do you"
360 DISPLAY AT(4,1):"like to program in Extended" :: DISPLAY AT(5,1):"BASIC but
hate to compute"
370 DISPLAY AT(6,1):"the DISPLAY AT statements?" :: DISPLAY AT(7,1):"Well, now y
ou can use your"
380 DISPLAY AT(8,1):"TI-Writer to compose your" :: DISPLAY AT(9,1):"screen and l
et this program"
390 DISPLAY AT(10,1):"write the Extended BASIC" :: DISPLAY AT(11,1):"program for
you (in MERGE"
400 DISPLAY AT(12,1):"format)!" :: DISPLAY AT(14,6):"The TI-Writer includes"
410 DISPLAY AT(15,1):"many convenient features," :: DISPLAY AT(16,1):"such as fu
ll screen control"
420 DISPLAY AT(17,1):"of the cursor. The screen" :: DISPLAY AT(18,1):"you are n
ow viewing made use"
430 DISPLAY AT(19,1):"of those features in its" :: DISPLAY AT(20,1):"composition
. This program"
440 DISPLAY AT(21,1):"converted the TI-Writer file" :: DISPLAY AT(22,1):"to DISP
LAY AT statements."
450 DISPLAY AT(24,1):"(Press any key to continue.)"
460 CALL KEY(0,K,S):: IF S=0 THEN 460
470 DISPLAY AT(1,1)ERASE ALL:"DISPLAY/AT by B.A. Traver" :: DISPLAY AT(3,6):"Aft
er you have created"
480 DISPLAY AT(4,1):"a blank TI-Writer file to" :: DISPLAY AT(5,1):"work with (u
sing option 2),"
490 DISPLAY AT(6,1):"load it into the TI-Writer" :: DISPLAY AT(7,1):"text editor
and prepare your"
500 DISPLAY AT(8,1):"program screen. (Erase any" :: DISPLAY AT(9,1):"guidelines
that enter your"
510 DISPLAY AT(10,1):"workspace while editing in" :: DISPLAY AT(11,1):"fixed mod
e; those outside"
520 DISPLAY AT(12,1):"won't hurt anything.)" :: DISPLAY AT(14,6):"When you have
finished,"
530 DISPLAY AT(15,1):"save your screen to disk," :: DISPLAY AT(16,1):"using eith
er the Save File"
540 DISPLAY AT(17,1):"(""SF"") or Print File (""PF"")" :: DISPLAY AT(18,1):"opti
on. (This program can"
550 DISPLAY AT(19,1):"handle either.) If you use" :: DISPLAY AT(20,1):"a differ
ent filename, your"
560 DISPLAY AT(21,1):"original blank file will be" :: DISPLAY AT(22,1):"availabl
e again."
570 DISPLAY AT(24,1):"(Press any key to continue.)"
580 CALL KEY(0,K,S):: IF S=0 THEN 580
590 DISPLAY AT(1,1)ERASE ALL:"DISPLAY AT by B.A. Traver" :: DISPLAY AT(3,6):"Opt
ion 3 will do your"
600 DISPLAY AT(4,1):"programming work for you," :: DISPLAY AT(5,1):"and you can
observe on the"
610 DISPLAY AT(6,1):"screen the progress of the" :: DISPLAY AT(7,1):"program. T
he result will be"
620 DISPLAY AT(8,1):"a program on disk in MERGE" :: DISPLAY AT(9,1):"format, com
plete with all"
630 DISPLAY AT(10,1):"those DISPLAY AT statements" :: DISPLAY AT(11,1):"you hate
to write."
640 DISPLAY AT(13,6):"After entering NEW, you" :: DISPLAY AT(14,1):"can merge th
at new file into"
650 DISPLAY AT(15,1):"memory, RESequence it as you" :: DISPLAY AT(16,1):"think b
est, and then save it"
660 DISPLAY AT(17,1):"to disk in MERGE format once" :: DISPLAY AT(18,1):"more fo
r later use in your"
670 DISPLAY AT(19,1):"Extended BASIC program when" :: DISPLAY AT(20,1):"you want
to make use of it."
680 DISPLAY AT(22,6):"Enjoy!" :: DISPLAY AT(24,1):"(Press any key to continue.)"
690 CALL KEY(0,K,S):: IF S=0 THEN 690
700 GOTO 260
710 ! MAKE BLANK TI-WRITER FILE
720 DISPLAY AT(1,1)ERASE ALL:"DISPLAY AT by B.A. Traver" :: DISPLAY AT(3,6):"Thi
s option creates a"
730 DISPLAY AT(4,1):"special blank TI-Writer file" :: DISPLAY AT(5,1):"for you,
including special"
740 DISPLAY AT(6,1):"tab settings. Here are your" :: DISPLAY AT(7,1):"choices:"
750 DISPLAY AT(9,1):"1 File With Guidelines (use" :: DISPLAY AT(10,4):"fixed mod
e without word"
760 DISPLAY AT(11,4):"wrap with this file)." :: DISPLAY AT(13,1):"2 File Without
Guidelines"
770 DISPLAY AT(14,4):"(use standard word wrap" :: DISPLAY AT(15,4):"mode with th
is file)."
780 DISPLAY AT(17,1):"What is your choice (1 or" :: DISPLAY AT(18,3):"2)?"
790 CALL KEY(0,K,S):: IF S=0 THEN 790 ELSE IF K<49 OR K>50 THEN 790
800 DISPLAY AT(18,7):CHR$(K)
810 DISPLAY AT(20,1):"What do you want to name" :: DISPLAY AT(21,3):"your file?"
820 DISPLAY AT(23,1):"DSK"
830 ACCEPT AT(23,4)SIZE(12):O$ :: O$="DSK"&O$ :: ON ERROR 1180 :: OPEN #1:O$,OUT
PUT :: DISPLAY AT(22,1):"" :: ON ERROR STOP
840 ON K-48 GOTO 850,880
850 ! FILE WITH GUIDELINES
860 M$="USE FIXED MODE (CTRL-0)."
870 FOR I=1 TO 24 :: PRINT #1:"|"&RPT$(" ",28)&"| "&SEG$(M$,I,1):: NEXT I :: GOT
O 900
880 ! FILE WITHOUT GUIDELINES
890 FOR I=1 TO 24 :: PRINT #1:RPT$(" ",29):: NEXT I
900 PRINT #1:TM$
910 CLOSE #1
920 GOTO 1340
930 ! MAKE MERGE FILE
940 DISPLAY AT(1,1)ERASE ALL:"DISPLAY/AT by B.A. Traver" :: DISPLAY AT(5,1):"Wha
t is the name of the file"
950 DISPLAY AT(6,1):"you prepared by using the" :: DISPLAY AT(7,1):"TI-Writer?"
:: DISPLAY AT(10,1):"DSK"
960 ACCEPT AT(10,4)SIZE(12):I$ :: I$="DSK"&I$ :: ON ERROR 1170 :: OPEN #1:I$,INP
UT :: DISPLAY AT(9,1):"" :: ON ERROR STOP
970 DISPLAY AT(14,1):"What is the name of the file"
980 DISPLAY AT(15,1):"you want to create in MERGE" :: DISPLAY AT(16,1):"format?"
:: DISPLAY AT(19,1):"DSK"
990 ACCEPT AT(19,4)SIZE(12):O$ :: O$="DSK"&O$ :: ON ERROR 1190 :: OPEN #2:O$,VAR
IABLE 163,OUTPUT :: DISPLAY AT(18,1):"" :: ON ERROR STOP
1000 DISPLAY AT(24,2):"Press <enter> to proceed."
1010 CALL KEY(0,K,S):: IF S=0 THEN 1010 ELSE IF K<>13 THEN 1010
1020 CALL CLEAR :: CALL VCHAR(1,3,95,672)
1030 L=10 :: FLAG=1
1040 FOR R=1 TO 24
1050 IF EOF(1)THEN DISPLAY AT(R,1):"" :: GOTO 1120
1060 LINPUT #1:M$
1070 IF M$=TM$ THEN DISPLAY AT(R,1):"" :: GOTO 1120
1080 GOSUB 1200
1090 IF BLANKLINE=1 THEN 1120
1100 GOSUB 1260
1110 GOSUB 1310
1120 NEXT R
1130 IF FLAG=2 THEN PRINT #2:M1$&C$(0)
1140 PRINT #2:C$(255)&C$(255)
1150 CLOSE #1 :: CLOSE #2
1160 GOTO 1340
1170 DISPLAY AT(9,1):"DISK ERROR - TRY AGAIN:" :: RETURN 960
1180 DISPLAY AT(22,1):"DISK ERROR - TRY AGAIN:" :: RETURN 830
1190 DISPLAY AT(18,1):"DISK ERROR - TRY AGAIN:" :: RETURN 990
1200 ! ANALYZE LINE
1210 M$=SEG$(M$,2,28):: DISPLAY AT(R,1):M$ :: IF M$="" OR M$=CHR$(13)OR M$=RPT$(
" ",28)THEN BLANKLINE=1 :: RETURN ELSE BLANKLINE=0
1220 C=1
1230 IF SEG$(M$,1,1)=" " THEN M$=SEG$(M$,2,LEN(M$)-1):: C=C+1 :: GOTO 1230 ELSE
1240
1240 H$=SEG$(M$,LEN(M$),1):: IF H$=" " OR H$=CHR$(13)THEN M$=SEG$(M$,1,LEN(M$)-1
):: GOTO 1240 ELSE 1250
1250 RETURN
1260 ! COMPUTE LINE
1270 IF L=10 AND FLAG=1 THEN EA$=C$(239)&C$(236)ELSE EA$=""
1280 M$=C$(199)&C$(LEN(M$))&M$
1290 M$=C$(162)&C$(240)&C$(183)&C$(200)&C$(LEN(STR$(R)))&STR$(R)&C$(179)&C$(200)
&C$(LEN(STR$(C)))&STR$(C)&C$(182)&EA$&C$(181)&M$
1300 RETURN
1310 ! PRINT LINE
1320 IF FLAG=1 THEN M1$=C$(0)&C$(L)&M$ :: FLAG=2 :: RETURN
1330 IF FLAG=2 THEN M2$=M$ :: PRINT #2:M1$&C$(130)&M2$&C$(0):: L=L+1 :: FLAG=1 :
: RETURN
1340 DISPLAY AT(10,9)ERASE ALL:"A C T I O N" :: DISPLAY AT(12,6):"C O M P L E T
E D"
1350 DISPLAY AT(24,1):"Press any key for main menu."
1360 CALL KEY(0,K,S):: IF S=0 THEN 1360 ELSE 260
1370 ! END PROGRAM
1380 CALL CLEAR :: END