ELBROWSE.BAS 3/5

 BBS: Inland Empire Archive
Date: 02-10-93 (12:52)             Number: 315
From: CORIDON HENSHAW              Refer#: NONE
  To: ALL                           Recvd: NO  
Subj: ELBROWSE.BAS 3/5               Conf: (2) Quik_Bas
Hello All!

===Chop===
Center$ = STRING$((80 - LEN(Text$)) \ 2, " ") + Text$
END FUNCTION

FUNCTION LoadLTHString$ (Filenumber, Offset&)
GET Filenumber, Offset& + 1, Length
LoadBuffer$ = STRING$(Length, 1)
GET Filenumber, , LoadBuffer$
LoadLTHString$ = RTRIM$(LoadBuffer$)
END FUNCTION

FUNCTION NoteParse (Numlines, P$())
    IF Numlines = 0 THEN EXIT FUNCTION
    El = 1
    DO
        L$ = RTRIM$(P$(El))
        IF LEN(L$) > 79 THEN            ' 62 is the wrap point here
            FOR P = 79 TO 1 STEP -1
                IF INSTR(",. ", MID$(L$, P, 1)) > 0 THEN
                    IF LTRIM$(RTRIM$(P$(El + 1))) = "" THEN
                        FOR I = Numlines TO El + 1 STEP -1
                            P$(I + 1) = P$(I)
                        NEXT
                        Numlines = Numlines + 1
                    ELSE
                        IF El + 1 > Numlines THEN Numlines = Numlines + 1
                    END IF
                    P$(El + 1) = RTRIM$(MID$(L$, P + 1)) + " " + P$(El + 1)
                    P$(El) = RTRIM$(LEFT$(L$, P))
                    EXIT FOR
                END IF
            NEXT P
        ELSE
            'P$(El) = S$
        END IF
        El = El + 1
    LOOP UNTIL El > Numlines
NoteParse = Numlines
END FUNCTION

FUNCTION ScrollText (Text$, StartLine, EndLine, CurrItem$)
DIM TextBuffer(1 TO 255)    AS STRING

TextBuffer(1) = Text$
REDIM PRESERVE TextBuffer(1 TO NoteParse(1, TextBuffer())) AS STRING

BaseLine = 1
ExitFlag = -1
GOSUB UpdateScreen

DO
        DO
                Ikey$ = INKEY$
        LOOP UNTIL Ikey$ <> ""
        SELECT CASE Ikey$
                CASE CHR$(0) + "P"'Down
                        BaseLine = BaseLine + 1
                        IF BaseLine > UBOUND(TextBuffer) THEN
                                BaseLine = UBOUND(TextBuffer)
                                BEEP
                        ELSE
                                GOSUB UpdateScreen
                        END IF

                CASE CHR$(0) + "H" 'Up
                        BaseLine = BaseLine - 1
                        IF BaseLine = 0 THEN
                                BaseLine = 1
                                BEEP
                        ELSE
                                GOSUB UpdateScreen
                        END IF

                CASE CHR$(0) + "M" 'Right
                        ExitFlag = 1  'Call for next record
                CASE CHR$(0) + "K" 'Left
                        ExitFlag = 2
                CASE CHR$(0) + "G" 'Home
                        ExitFlag = 3
                CASE CHR$(0) + "O" 'End
                        ExitFlag = 4
                CASE CHR$(27) 'ESC
                        ExitFlag = 0  'Exit
                CASE "S", "s"
                        COLOR 14, 1
                        LOCATE 25, 38
                        PRINT "Search:";
                        SEEKEQ #4, TextInput$(25, 46, 1, 20)
                        IF NOT EOF(4) THEN
                                ExitFlag = 5
                        ELSE
                                LOCATE 25, 38
                                PRINT "Echo not found, press any key";
                                Junk$ = INPUT$(1)
                                LOCATE 25, 38
                                PRINT "                             ";
                                SEEKEQ #4, CurrItem$
                        END IF
                CASE "F", "f"
                        COLOR 14, 1
                        LOCATE 25, 38
===Chop===

Coridon Henshaw \ Sirrus Software

--- GEcho 1.00
 * Origin: TCS Concordia - Mail Only - Toronto, Ontario (1:250/820)
Outer Court
Echo Basic Postings

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