home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-387-Vol-3of3.iso
/
s
/
shlp106.zip
/
SHLP1.EXE
/
DEMOSLIB.BAS
next >
Wrap
BASIC Source File
|
1991-12-30
|
5KB
|
170 lines
'***************************************************************************
'* DEMOSHLB.BAS Copyright 1991 by Robert Pitcher - SimpleWare *
'* *
'* Be sure to start QuickBASIC as follows *
'* *
'* QB /L SHELP *
'* *
'* A demo to show the use of the routines contained in the *
'* Simply Help! library for QuickBASIC *
'***************************************************************************
DEFINT A-Z
'Declare Simply Help! Library routines
DECLARE SUB SHelp (FilNam$, Scrn%, ErFlag%)
DECLARE SUB SHelpM (FilNam$, Scrn%, ErFlag%)
DECLARE SUB SHelpOvr (FilNam$, Scrn%, ErFlag%, OvrPos%, Wcx%, Tcx%, Lcx%, Hcx%)
DECLARE SUB SHelpOvrM (FilNam$, Scrn%, ErFlag%, OvrPos%, Wcx%, Tcx%, Lcx%, Hcx%)
DECLARE SUB SHelpGI (FilNam$, Scrn%, Array%())
DECLARE SUB SHelpGT (FilNam$, Scrn%, ErFlag%, Lins%, T$())
COLOR 7, 0
Nam$ = "SHELP.EXE" 'File to display
VIEW PRINT
GOSUB BackScrn 'Draw a background
'----- Show the routine SHelp
PRINT "Press any key to call the routine - Shelp ";
GOSUB GetCh 'Press a key
Scrn = 1 'Number of screen to display.
CALL SHelp(Nam$, Scrn, Er) 'Display the screen
IF Er GOTO ShError
'----- Show the over ride routine
GOSUB ClearMiddle
PRINT "Press any key to call the routine - ShelpOvr ";
GOSUB GetCh
Scrn = 5 'Display screen 5
PosFlag = -1 'Set to 0 to use default positions in file
BoxColor = 7 'Set colors for mono screen
TextColor = 7 'To use defaults set Colors to -1
LinkColor = 15
HiColor = 15
LOCATE 2, 2 'Display all screens in upper left corner
CALL SHelpOvr(Nam$, Scrn, Er, PosFlag, BoxColor, TextColor, LinkColor, HiColor)
IF Er GOTO ShError
'----- Try the Get Text routine
GOSUB ClearMiddle
PRINT "Press any key to call the routine - ShelpGT ";
GOSUB GetCh
DIM Txt$(25) 'String array to hold text
Scrn = 7 'Number of screen
CALL SHelpGT(Nam$, Scrn, Er, Lins, Txt$()) 'Get the text
IF Er GOTO ShError
COLOR 7, 0
CLS 'Display the text returned
PRINT " TEXT FROM SCREEN # 7:"
PRINT STRING$(79, "-")
FOR i = 1 TO Lins
PRINT Txt$(i)
NEXT
PRINT STRING$(79, "-")
'----- Show the Get Info routine
LOCATE 25, 1, 1
PRINT " Press any key to call the routine - ShelpGI ";
GOSUB GetCh
DIM Info%(15) 'Array to hold information
'Try less than 15
Info(0) = 2 'Set element 0 to number of screen
CALL SHelpGI(Nam$, Er, Info()) 'Get the info
IF Er GOTO ShError
CLS
'----- Display the information returned
PRINT
PRINT " Compiler Version: "; Info(1) / 100
PRINT " File Type: ";
IF Info(2) = 0 THEN PRINT "Standard Help" ELSE PRINT "EXE File"
PRINT
PRINT " Number of screens: "; Info(3)
PRINT " Number of links: "; Info(4)
PRINT
IF Info(0) THEN
PRINT
PRINT " Information on Screen number: "; Info(0)
PRINT
PRINT " Top line of window: "; Info(5)
PRINT " Left column of window: "; Info(6)
PRINT " Lines in window: "; Info(7)
PRINT " Width of window: "; Info(8)
PRINT " Box type: "; Info(9)
PRINT " Shadow: "; Info(10)
PRINT " Number of links: "; Info(11)
PRINT " Auto linking: "; Info(12)
PRINT " Box color: "; Info(13)
PRINT " Text color: "; Info(14)
PRINT " Link color: "; Info(15)
END IF
LOCATE 25, 4
PRINT "Press any key to exit. ";
GOSUB GetCh
COLOR 7, 0
CLS
END
GetCh:
a$ = INPUT$(1)
IF a$ = CHR$(27) THEN
COLOR 7, 0
CLS
END
END IF
RETURN
BackScrn:
CLS
COLOR 1, 7
PRINT STRING$(1999, 177);
ClearMiddle:
FOR i = 1 TO 5
LOCATE 10 + i, 15
PRINT SPACE$(50);
NEXT
LOCATE 13, 17, 1
RETURN
ShError:
COLOR 7, 0
CLS
PRINT "An error has occured within a Simply Help! routine. "
PRINT
SELECT CASE Er
CASE -1
PRINT "Invalid help file"
CASE -2
PRINT "Invalid screen number"
CASE -3
PRINT "Not enough elements"
CASE ELSE
PRINT "BASIC error code:"; Er
END SELECT
END