Dear TI'ers, The following GB/2Liners are the result of a personal challenge to write as much coding as possible in just two lines of Extended Basic, and have a fully functioning utility. All you have to do is type in these routines EXACTLY as they are printed. Please be aware that there is a special key stroke that will allow you to type code beyond the normal four screen line limit. However I am sorry to admit that I am unable to recall what it is at this time. After all, these routines were written some time ago. (The original listed programs were scanned as text, and then edited with Microsoft's Word. I may have missed a few scanning errors, but I tried to minimize this problem.) Please contact me if you have any questions. Closing Routine for all GB/2Liners: 100 CALL SCREEN(8):: FOR I=1 TO 12 :: CALL COLOR(I,2,1):: NEXT I :: PRINT : : :"WHICH ONE?": : :"1. LOAD MENU": :"2. QUIT" :: ON ERROR 110 :: CLOSE #2 :: !"FINI"(C)1989 G.W.BERNASEK 110 CALL KEY(0,K,S):: IF S=0 THEN 110 ELSE IF K=49 THEN RUN "DSK1.LOAD" ELSE IF K<>50 THEN 110 ELSE CALL CLEAR :: END This routine will place a message in the center of the screen: 100 CALL CLEAR :: DEF C=INT(40-(LEN(MSG$)/2)):: INPUT "ENTER A MESSAGE-":MSG$ :: !"AUTO-CENTERING ROUTINE" (C)1989 G.W.BERNASEK 110 OPEN #1:"PIO.LM="&STR$(C):: PRINT #1:MSG$ :: CLOSE #1 :: RUN "DSK1.FINI" This routine will set left margins at any desired distance: 100 CALL CLEAR :: INPUT "ENTER A LEFT MARGIN NUMBER-":C :: !"A VARIABLE LEFT MARGIN SETTER" (C)1989 G.W.BERNASEK 110 OPEN #1:"PIO.LM="&STR$(C):: PRINT #1:C :: CLOSE # :: RUN "DSK1.FINI" This routine calls Lotto numbers: 100 CALL CLEAR :: INPUT "ENTER:0-SCREEN or 1-PRINTER ":P :: CALL CLEAR :: DIM N(45) :: OPEN #1:"PIO" :: PRINT #P:"TI-LOTTO": : : :: J=1 :: RANDOMIZE :1 !"MICROLOTTO" (C)1989 G.W.BERNASEK 110 D=INT(RND#44)+1 :: IF D=N(D)THEN 110 ELSE N(D)=D :: IF J<7 THEN PRINT #P:N(D );" ";:: J=J+1 :: GOTO 110 ELSE PRINT : : :: CLOSE #1 :: RUN "DSK1.FINI" This routine will sort twenty five randomly drawn numbers: 100 CALL CLEAR :: DIM I(25):: RANDOMIZE :: PRINT "AS DRAWN:": : :: FOR J=1 TO 25 :: N=INT(RND#25)+1 :: PRINT N;" ";:: I(N)=I(N)+N :: NEXT J :: !"MINISORT" (C)1989 G.W.BERNASEK 110 PRINT : :"SORTED:": : :: FOR J=1 TO 25 :: FOR K=1 TO I(J)/J :: PRINT J;" ";: : NEXT K :: NEXT J :: RUN "DSK1.FINI" This routine will set Epson compatible printer commands: 100 CALL CLEAR :: P$=CHR$(27)&CHR$(64):: DISPLAY AT(:,1):"ACCEPT OR CHANGE CONTROLS:" :: DISPLAY AT(5,1):P$ :: !"PRINTERSET" (C)1989 G.W.BERNASEK 110 ACCEPT AT(5,1)SIZE(-28):P$ :: OPEN #1:"PIO" :: PRINT #1:P$ :: CLO$E #1 :: RUN "DSK1.FINI" This routine will reset the operational speed of complicated X-basic programs: 100 ON ERROR 110 :: OPEN #1: "CS7" :: !"RATEMAINT" (C)1989 G.W.BERNASEK 110 RUN "DSK1.FINI" This routine rounds up randomly drawn numbers from 8 to zero decimal places: 100 CALL CLEAR :: RANDOMIZE :: N=RND#10 :: PRINT N,"( AS DRAWN )" :: FOR D=8 TO 0 STEP -1 :: R=INT(N*10^D+5)/10^D :: PRINT R,"(";D;"PLACES )" :: NEXT D :: PRINT "ANOTHER ONE?Y/N" :: !"ROUNDING" (C)1989 G.W.BERNASEK 110 CALL KEY(0,K,S):: IF S=0 THEN 110 ELSE IF K=78 THEN RUN "DSK1.FINI" ELSE 100 A very handy DV80 file text reading routine: 100 CALL CLEAR :: INPUT "PUT DV8O DISK IN DRIVE AND ENTER : ":F$ :: INPUT "TO:<0>-SCREEN or <1>-PRINTER":P :: PRINT "HOLD DOWN ANY KEY TO PRINT.": : : :: OPEN #2:F$,INPUT 110 CALL KEY(0,K,S):: IF 6=0 THEN 110 ELSE IF EOF(2)THEN CLOSE #2:: END :: ELSE OPEN #1:"PIO" :: LINPUT #2:T$ :: PRINT #P:T$ :: CLOSE #1 :: GOTO 110 :: !"TEXTREAD1" (C) 1989 G.W. BERNASEK Same text reading routine, but uses two disk drives: 100 CALL CLEAR :: INPUT "PUT DV8O DISK IN DRIVE#2 ANDENTER : ":F$ :: INPUT ('TO:<0>-SCREEN or <1>-PRINTER":P :: PRINT "HOLD DOWN ANY KEY TO PRINT.": : : :: OPEN #2:F$,INPUT 110 CALL KEY(0,K,S):: IF S=0 THEN 110 ELSE IF EOF(2)THEN RUN "DSKl.FINI" ELSE OPEN #1:"PIO" :: LINPUT #2:T$ :: PRINT #P:T$ :: CLOSE #1 :: GOTO 110 :: !"TEXTREAD2" (C)1989 G.W.BERNASEK This routine runs any typed message across the bottom of the screen: 100 CALL CLEAR :: INPUT "PUT DATA DISK IN DRIVE ENTER :":F$ :: OPEN #2:F$,INPUT :: LINPUT #2:T$ :: CALL CLEAR :: !"TINYCRAWL1" (C)1989 G.W.BERNASEK 110 FOR J=28 TO 1 STEP -1 :: DISPLAY AT(24,J):SEG$(T$,1,29-J):: NEXT J :: FOR I= 1 TO LEN(T$)+1 :: DISPLAY AT(24,1):SEG$(T$,I,28):: NEXT I :: LINPUT #2:T$ :: IF EOF(2)THEN CLOSE #2 :: END :: ELSE 110 This is the same routine, but uses two disk drives: 100 CALL CLEAR :: INPUT "PUT DATA DISK IN DRIVE#2 ENTER :":F$ :: OPEN #2:F$,INPUT :: LINPUT #2:T$ :: CALL CLEAR :: !"TINYCRAWL2" (C)1989 G.W.BERNASEK 110 FOR J=2B TO 1 STEP -1 :: DISPLAY AT(24,J):SEG$(T$,1,29-J):: NEXT J :: FOR I=1 TO LEN(T$)+1 :: DISPLAY AT(24,1):SEG$(T$,I,28):: NEXT I :: LINPUT #2:T$ :: IF EOF(2)THEN RUN "DSK1.FINI" ELSE 110 This routine will dump screen characters on to a printer: 100 OPEN #1:"PIO" :: FOR R=1 TO 22 :: FOR C=: TO :0 :: CALL GCHAR(R,C,X):: !"TINYDUMP" (C)1989 G.W.BERNASEK 110 X$=X$&CHR$(X):: NEXT C :: PRINT #1:X$ :: X$="" :: NEXT R :: CLOSE #1 :: RUN "DSK1.FINI" This routine is a basic line editor (Good for typing quick notes.): 100 CALL CLEAR :: PRINT "1. PUT DATA DISK IN DRIVE. 2. EDIT OR ACCEPT EACH LINE .3. ""E"" ADDED TO FILE NAME." :: INPUT "[DSK1.NAME]?":F$ :: OPEN #2:F$,INPUT :: OPEN #1: F$&"E",OUTPUT, VARIABLE 110 LINPUT #2:T$ :: IF EOF(2)THEN CLOSE #1 :: CLOSE #2 :: END :: ELSE DISPLAY AT(23,1):T$ :: ACCEPT AT(23,1)BEEP SIZE(-28):T$ :: PRINT #1:T$ :: PRINT :: GOTO 110 :: !"TINYEDIT1" (C)1989 G.W.BERNASEK Same as above, but uses two disk drives: 100 CALL CLEAR :: PRINT "1. PUT DATA DISK IN DRIVE#2.2. EDIT OR ACCEPT EACH LINE.3. ""E"" ADDED TO FILE NAME." :: INPUT "[DSK2.NAME]?":F$ :: OPEN 2:F$,INPUT :: OPEN #1: F$&"E",OUTPUT, VARIABLE 110 LINPUT #2:T$ :: IF EOF(2)THEN CLOSE #1 :: RUN "DSKI.FINI" :: ELSE DISPLAY AT (23,1):T$ :: ACCEPT AT(23,1)BEEP SIZE(-28):T$ :: PRINT #1:T$ :: PRINT :: GOTO 110 :: !"TINYEDIT2" (C)1989 G.W.BERNASEK This routine will create a full disk of DV80 files: 100 CALL CLEAR :: PRINT "1. PUT DATA DISK IN DRIVE. 2. TYPE AND ENTER EACH LINE .:. ENTER ""E"" ALONE TO EXIT.": : :: INPUT "[DSK1.NAME]?":F$ :: !"TINYFILER1" (C)1989 G.W.BERNASEK 110 ACCEPT AT(23,1)BEEP SIZE(28):D$ :: IF (D$="E")+(D$="e")THEN END ELSE OPEN #1 :F$,APPEND,VARIABLE :: PRINT #1:D$ :: CLOSE #1 :: PRINT :: GOTO 110 Same routine as above, but uses two disk drives: 100 CALL CLEAR :: PRINT "1. PUT DATA DISK IN DRIVE#2.2. TYPE AND ENTER EACH LINE .:. ENTER ""E"" ALONE TO EXIT.": : :: INPUT "[DSK2.NAME]?":F$ :: !"TINYFILER2" (C)1989 G.W.BERNASEK 110 ACCEPT AT(23,1)BEEP SIZE(28):D$ :: IF (D$="E")+(D$="e")THEN RUN "DSK1.FINI" ELSE OPEN #1:F$,APPEND,VARIABLE :: PRINT #1:D$ :: CLOSE #1 :: PRINT :: GOTO 110 Enjoy! Glenn Bernasek GBBasics@aol.com