BBS: Inland Empire Archive Date: 05-30-92 (12:31) Number: 135 From: JEFF FREEMAN Refer#: NONE To: ALL Recvd: NO Subj: Jdibas 2/5 Conf: (2) Quik_Bas
This message was from JEFF FREEMAN to ALL, originally in conference (V) V-TREK and was forwarded to you by JEFF FREEMAN. ------------------------- >>> Continued from previous message SUB JCenter (T$, CRLF) IF T$ = Null$ THEN Tabs = 40 ELSE Tabs = 40 - CINT(LEN(T$) / 2) END IF JPrint CHR$(27) + "[" + LTRIM$(STR$(Tabs)) + "C" + T$, True END SUB SUB JCls IF JDI.Ansi = False THEN C$ = CHR$(12) ELSE C$ = CHR$(27) + "[2J" JPrint C$, False JDI.LineCount = 0 CLS END SUB SUB JColor (FC, Bc) IF JDI.Ansi = False THEN EXIT SUB IF (JDI.FC = FC) AND (JDI.Bc = Bc) THEN EXIT SUB JPrint CHR$(27) + "[3;0m", False JDI.FC = FC JDI.Bc = Bc BlinkMode = False: High = False M$ = CHR$(27) + "[3" IF FC > 16 THEN BlinkMode = True: FC = FC - 16 IF FC > 8 THEN High = True: FC = FC - 8 M$ = M$ + LTRIM$(STR$(FC)) + ";4" + LTRIM$(STR$(Bc)) IF High THEN M$ = M$ + ";1" IF BlinkMode THEN M$ = M$ + ";5" M$ = M$ + "m" JPrint M$, False END SUB FUNCTION JEXIST (F$) JDI.FileExists = True ON ERROR GOTO FileNotFound JDI.EFNum = FREEFILE OPEN F$ FOR INPUT AS #JDI.EFNum CLOSE #JDI.EFNum ON ERROR GOTO 0 'remove this line to enable error-trapping 'ON ERROR GOTO ErrorInDoor 'set this to your error trapping routine JEXIST = JDI.FileExists END FUNCTION FUNCTION JInKey$ C$ = INKEY$ IF JDI.IsLocal OR C$ <> Null$ THEN JInKey$ = C$ EXIT FUNCTION ELSE IF DataWaiting THEN JInKey$ = CHR$(ReadChar) END IF END FUNCTION SUB JInPut (P$, In$, W) JDI.LineCount = 0: In$ = Null$ JPrint P$, False IF W <= 0 THEN W = ABS(W): WW = True JDInputMain: DO: M$ = JInKey$: LOOP UNTIL M$ <> Null$ IF WW AND LEN(In$) > (W - 8) AND M$ = CHR$(32) THEN M$ = CHR$(13) IF W = 0 THEN In$ = M$ JDI.EchoMode = False EXIT SUB END IF SELECT CASE M$ CASE IS = CHR$(13) JPrint Null$, True JDI.EchoMode = False JDI.AllCaps = False EXIT SUB CASE IS < CHR$(9) GOSUB JDIBackspace END SELECT IF M$ < CHR$(32) OR M$ > CHR$(128) OR LEN(In$) = W THEN GOTO JDInputMain IF JDI.AllCaps THEN M$ = UCASE$(M$) IF JDI.EchoMode = 0 THEN JPrint M$, False IF JDI.EchoMode = 1 THEN JPrint JDI.EchoChar, False In$ = In$ + M$ IF WW AND LEN(In$) = W THEN JDI.AllCaps = False JDI.EchoMode = False EXIT SUB END IF GOTO JDInputMain JDIBackspace: IF LEN(In$) = 0 THEN RETURN IF LEN(In$) = 1 THEN In$ = Null$ ELSE In$ = LEFT$(In$, LEN(In$) - 1) END IF BackSpace 1 RETURN END SUB SUB JLines (L) CRLF$ = CHR$(10) + CHR$(13) FOR Ln = 1 TO L CR$ = CR$ + CRLF$ NEXT Ln JPrint CR$, False JDI.LineCount = JDI.LineCount + L END SUB SUB JLocate (R, C) IF JDI.Ansi = False THEN EXIT SUB C$ = CHR$(27) + "[" + LTRIM$(STR$(R)) + ";" + LTRIM$(STR$(C)) + "H" JPrint C$, False END SUB SUB JOpen (F$, Mode$, FileNum, RecLen) FileNum = FREEFILE IF Mode$ = "I" THEN IF NOT JEXIST(F$) THEN FileNum = 0 EXIT SUB END IF END IF IF RecLen = 0 THEN RecLen = 128 OPEN Mode$, FileNum, F$, RecLen END SUB SUB JPrint (T$, CRLF) IF CRLF THEN IF JDI.Pauses THEN JDI.LineCount = JDI.LineCount + 1 IF JDI.LineCount > 23 THEN HitAKey END IF IF CRLF THEN T$ = T$ + CHR$(10) + CHR$(13) IF T$ <> Null$ THEN Transmit T$ PRINT #JDI.LFNum, T$; END IF END SUB FUNCTION JRND (Lo, Hi) RANDOMIZE TIMER JRND = FIX((Hi - Lo + 1) * RND + Lo) END FUNCTION FUNCTION JTrim$ (T$)
Books at Amazon:
Back to BASIC: The History, Corruption, and Future of the Language
Hackers: Heroes of the Computer Revolution (including Tiny BASIC)
Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution
The Advent of the Algorithm: The Idea that Rules the World
Moths in the Machine: The Power and Perils of Programming
Mastering Visual Basic .NET