home *** CD-ROM | disk | FTP | other *** search
-
- GLIB Quick Reference Guide
- Version 1.4
- Released: February 6, 1987
-
- GLIB 1.4 Index
- --------------
- BOXES ........... Outline one of 6 menu type boxes to the screen.
- CHRP ............ Sound the speaker in a CHiRP fashion.
- CLOFF / CLON .... Disengage-engage keyboard Caps Lock.
- CLRKBD .......... Clear keyboard buffer of type-ahead keys.
- CMDLINE ......... Parse the command line into a string array.
- CPUINFO ......... Returns very low level system info, CPU type etc.
- DATE ............ Returns current day, month, year and DOW as integers.
- ** DAYOFYR ......... Returns the current day of the year (1 - 366).
- DFRMAT .......... Date Formatting.
- ** DLIGHT .......... Trigger a floppy disk light on.
- * DIR.............. Returns DOS directory in a string array.
- DLRFRMAT ........ Numeric string formatting to Dollar conventions.
- DLY ............. Delay for x number of seconds.
- DOSV............. Return DOS Version installed.
- DRVSPACE ........ Return total and free drive space.
- ERRMSG .......... Display temporary message with color, sound control.
- EXIST ........... Determines if a file exists on disk or not.
- EXTMEM .......... Return the amount of Extended (AT) memory installed.
- FADE ............ Screen fade or dissolve routine, maintains attributes.
- ** FCOPY ........... Copy a file, as quickly as DOS.
- FILCNT........... Returns the number of files in disk matching a mask.
- FED ............. BASIC text input routine.
- ** FEOF ............ Set file pointer to the end of a file.
- ** FCREAT .......... Create a new file, returning a DOS File handle.
- ** FOPEN ........... Open a disk file, getting a DOS file handle.
- ** FUNIQ ........... Create a unique/temporary file.
- ** FWRITE .......... Write a string to s file opened with a DOS handle.
- ** GETCH ........... Allow input from predefined string.
- GETDSEG ......... Returns BASIC's DS (Data Segment)
- ** GET/SET FATTR ... Get, set or reset file attributes.
- GETSTACK ........ Returns the state of BASIC's Stack.
- GET/SET DRV ..... Get or set the default drive.
- GET/SET VERFY ... Get or set the system VERIFY state.
- GRAPH ........... Produce a Vertical or Horizontal graph from an array.
- ** INCR / DECR ..... Replicate TURBO BASIC functions
- ** INSON / INSOFF .. Toggle insert state on or off
- KBLOOP .......... Enter a blind loop until a key is pressed.
- ** LASTDRV ......... Return last logical drive on the system
- ** LCOUNT .......... Count the number of lines in a text file QUICKLY.
- ** LNAMEF .......... Swap names to last-name-first format.
- MDLY ............ Delay processing for a number of milliseconds.
- ** MCSRINC / MCSRDEC Decrement mouse cursor flag
- ** MCSRON / MCSROFF Mouse cursor on or off.
- ** MGETXY .......... Get mouse cursor location
- ** MLONG /MNORM .... Set / reset mouse Mickey Factor.
- ** MPRESS .......... Get number of mouse button presses.
- ** MRELEASE ........ Get number of mouse button releases.
- ** MSETXY .......... Set mouse cursor location
- ** MSETXRNG / MSETYRNG: Define/limit mouse work area.
- ** MTYPE ........... Test for mouse existence, get number buttons
- NFRMAT .......... Extensive Numeric string formatting.
- NLOFF / NLON .... Disengage-engage Keyboard Num Lock
- PCASE ........... Convert string to proper case.
- ** PGETCH .......... GETCH with centered prompt.
-
-
-
- PINIT ........... Initialize the printer.
- PFILE ........... Send a disk file to printer.
- PRTSCRN ......... Print the current display on the printer.
- PSTAT ........... Return the printer status.
- QUIKPRT ......... Another implementation of BYTE's QPRINT routine.
- RAMFREE ......... Returns memory installed in the system.
- ** RINSTR .......... Returns LAST position of a char in a string
- ** READSCRN ........ Quickly read a string from the CRT at currect location
- RSTSCRN / SVSCRN. Restores a screen previously saved by SVSCRN
- U-,D- SCROLL .... Scroll a portion of the screen up or down.
- SCROLLER ........ Scroll the screen left or right.
- SCRLOFF / SCRLON. Set Scroll Lock Off.
- SCRNDUMP ........ Dump the current display to disk.
- SETERR .......... Sets DOS "ERRORLEVEL" code upon program termination.
- SINFO ........... Equipment info: RAM, parallel, serial, EGA and VGA.
- ** SYSTIME ......... Return system time as integers.
- TFRMAT .......... Time formatting
- ** VFNAME .......... Test a string to see if it is a valid filename.
- ** VIDOFF .......... Turn CRT off.
- ** VIDON ........... Turn CRT back on.
- WDW ............. Windowing subroutine with sound, color control.
-
- * DIR is actually a facade for a FINDF and FNEXT Functions
- ** NEW with this release.
-
-
-
-
-
- GizLib Function Summary
- Version 1.4
-
-
- VIDEO Routines:
- BOXES, ERRMSG, FADE, GRAPH, QUIKPRT, SCROLL, SCROLLER, SVSCRN,
- RSTSCRN, SCRNDUMP, WDW, VIDON, VIDOFF, READSCRN, PGETCH
-
- STRING Manipulation Routines:
- CMDLINE, DFRMAT, DLRFRMAT, NFRMAT, PCASE, TFRMAT, RINSTR,
- LNAMEF, VFNAME
-
- DATA Entry/Formatting Routines:
- DFRMAT, DLRFRMAT, ERRMSG, FED, KBLOOP, NFRMAT, WDW
-
- HARWARE Info Routines:
- CPUINFO, SINFO, EXTMEM, RAMFREE
-
- KEYBOARD Routines:
- CLON, CLOFF, NLON, NLOFF, SCRLON, SCRLOFF, CLRKBD, GETCH, PGETCH
-
- PRINTER Services:
- PFILE, PINIT, PSTAT, PRTSCRN
-
- DOS and BIOS Sevice Routines:
- DATE, DIR, DOSV, DRVSPACE, EXIST, FILCNT, SCROLL, SCROLLER, SETERR,
- GETDRV, SETDRV, GETVERFY, SETVERFY, SYSTIME, FOPEN, FCLOSE,
- FCREAT, FWRITE, FUNIQ, FCOPY
-
- MISC Routines:
- CHRP, DLY, GETSTACK, GETDSEG, MDLY, DAYOFYR
-
-
- Mouse Routines:
- MCSRON, MCSROFF, MSETCSR, MSETXY, MGETXY, MSETXRNG, MSETYRNG,
- MPRESS, MRELEASE, MTYPE, MCSRINC, MCSRDEC, MLONG, MNORM
-
-
-
- BOXES: Send a box or frame to the screen via fast printing method.
- box=[1 - 5] : frame=[1-4] : color=[1-31]
- CALL boxes(box%,frame%,color%)
-
-
- CHRP: Sound speaker in quick ascending or descending "chirp".
- 1=up, 0=down
- m=1 A "chirp" of the called tone
- CALL CHRP(m)
-
-
- CLON / CLOFF: Toggle caps lock.
- CALL CLON ' toggles CAPS lock ON
- CALL CLOFF ' toggles CAPS lock off
-
-
- CLRKBD: Clear keyboard buffer of waiting keystrokes.
- CALL clrkbd
-
-
- CMDLINE: Parse the command line into a string array using space as a
- delimiter.
- DIM arg$(x) : q=0
- CALL cmdline(arg$(),q)
-
-
- CPUINFO: Get specific hardware configuration info. See also SINFO.
- idcode=0 : mhz=0 : cpu=0 : ndp=0
- CALL cpuinfo(idcode%, mhz%, cpu%, ndp%)
-
-
- DATE: Get date from system clock as integers (vs the string DATE$). m=0 : d=0 : y=0 : w=0
- CALL date(m, d, y, w)
-
- DAYOFYR: Get the day count for this year as of today.
- DECLARE FUNCTION dayofyr%
-
- DFRMAT: Format valid date integers to user friendly string.
- CALL dfrmat(m, d, y, dt$)
- Returns date formatted as "January 3, 1987"
-
-
- DIR: Fills string array with filenames matching a passed mask.
- See also FILCNT.
-
- CALL dir(mask$, file$() )
-
- DIR.SUB is required (and provided) to simulate this
- interface using separate DOS calls to fill the array.
-
-
- DLIGHT: Trigger a floppy drive light for demo realism.
- DECLARE FUNCTION dlight%(drive%)
-
-
-
-
- DLRFRMAT: Format numerical string to specifications via a passed mode.
- INPUT "Enter amount", nst$
- mode=0 : decimalpt=0
- CALL dlrfrmat(nst$, mode%, decimalpt%)
- IF m=0 THEN PRINT nst$ ELSE GOTO getinfo
- ' prints "$12.34"
-
-
- DLY: Delay processing a given number of seconds.
- sec=3 : CALL dly(sec%)
-
-
- DOSV: Returns the DOS version as a whole number.
- ver=0
- CALL dosv(ver) ' ver= Version * 100
- ver= ver / 100 ' now 310 = 3.1 etc
-
-
-
- DRVSPACE: Get free and or total disk space on designated drive.
- On CALL, drive number to poll, 1= A:, 2=B: etc;
- 0=default, returns as sectors per cluster
-
- drv=0 ' read default drive
- CALL drvspace(drv%, AvailClus, BytesSector, TotalClus,)
- total#=CDBL(drv%)*CDBL(BytesSector)*CDBL(TotalClus%)
- free#=CDBL(drv%)*CDBL(BytesSector%)*CDBL(AvailClus%)
-
-
- ERRMSG: Displays a fully used defined message on any line, with
- built in screen display preservation, sound and color
- control.
-
- msg$= " You goofed. Try again"
- lin = 24
- attr= colors to use. attr=(back_ground*16)+fore_ground
- sfx = Sound. (0=none, 1=low tone).
- CALL errmsg(msg$,lin%, attr%, sfx%)
-
-
- EXIST: Checks for the existance of a file. Returns 0 if it does
- not exist, nonzero if it does.
-
- fil$="MYPROG.DAT" : ex=0
- CALL exist(fil$, ex%)
-
-
- EXTMEM: Returns installed Extended (AT's only) memory.
- mem=0 : CALL extmem(mem%)
-
-
- FADE: Alternative to CLS, decrements each character on the screen by
- 17 until they equal 32 (the space). No parameters are passed.
- CALL fade
-
-
-
- FCOPY: Copy a file about as quickly as DOS can:
- DECLARE FUNCTIOn fcopy%(afil$, bfil$)
- ErrorCode = fcopy(sourcefile$, destfile$)
-
- FCREAT: Create a new file, retrieve DOS file handle
- DECLARE FUNCTION fcreat%(fil$, attrib%, fhandle%)
-
- FOPEN: Open an existing file, retrieving a file handle
- DECLARE FUNCTION fopen%(fil$, mode%, fhandle%)
-
- FEOF: Set file pointer to the end of a file opened with a handle.
- DECLARE FUNCTION feof%(fhandle%)
-
- FWRITE: Write a string to a file opened with a handle.
- DECLARE FUNCTION fwrite%(text$, fhandle%)
-
- FUNIQ: Create a unique or temporary file with a handle.
- DECLARE FUNCTION funiq%(pathfil$, attrib%, fhandle%)
-
-
- FED: See FED.DOC
-
-
- FILCNT: Returns the number of files on disk matching a given mask.
- Very useful in conjunction with DIR.
-
- mask$="*.ARC"
- CALL filcnt(mask$, quan)
- ' quan now holds the number of files matching *.ARC
-
-
- GRAPH.BAS: Draw scaled graphs
- ' produces vertical graph:
- CALL vgraph(elmts%(), basis%, label$(), title$)
-
- ' produces horizontal graph:
- CALL hgraph(elmts%(), basis%, label$(), title$)
-
-
- GETDRV: Get the default drive.
- drv$=" "
- CALL getdrv(drv$)
-
- GETFATTR: Get file attributes.
- DECLARE FUNCTION getfattr%(fil$)
-
- GETVERFY: Get the system VERIFY switch setting.
- CALL getverfy(switch)
-
- INCR/DECR: Replicate Turbo BASIC's native functions:
- DECLARE SUB incr%(x%, y%)
- DECLARE SUB decr%(x%, y%)
- ..
- ..
- incr x,y
- decr j,q
-
-
-
- KBLOOP: Control routine to watch or accept KB input for a specified
- number of seconds, then return with an indicator. Allows for
- time or screen refresh and security KB input.
-
- label1: ' demo for a security routine
- kbin$=SPACE$(3) : LoopTime%=30 : no$=CHR$(225)
- CALL kbloop(kbin$, LoopTime%, no$)
- .
- . Screen refreshes or security routines
- .
- IF kbin$=no$ THEN GOTO label1
-
- LASTDRV: Return last logical drive installed on the system.
- DECLARE FUNCTION lastdrv%
-
- LCOUNT: Quickly count lines in a text file, requires a file handle
- DECLARE FUNCTION lcount%(fhandle%)
-
- LNAMEF: Swap names in a string to first-name-last format.
- DECLARE FUNCTION lnamef%(text$+" ")
-
-
- MCSRON: Unconditionally set mouse cursor on or off.
- MCSROFF CALL mcsron: CALL mcsroff
-
-
- MCSRINC: Increment or decrement the mouse cursor flag
- MCSRDEC CALL mcsrinc: CALL mcsrdec
-
-
- MPRESS: Get number of mouse button presses since last query
- CALL mpress(mleft, mright)
-
-
- MLONG: Set or reset the mouse's mickey factor.
- MNORM CALL mlong: CALL mnorm
-
-
- MRELEASE: Get number of mouse button releases since last query.
- CALL mrelease(mleft, mright)
-
- MGETXY: Set mouse cursor location in 80x25 text modes.
- CALL mgetxy(mrow, mcol)
-
- MSETXY: Set mouse cursor location. Works in 80x25 modes.
- CALL msetxy(12,20)
-
- MSETXRNG: Limit the active mouse arena.
- MSETYRNG CALL msetxrng(1,5,20) ' limit x in 80*25
- CALL msetyrng(0,100, 150) ' limit y via pixel coords
-
- MTYPE: See if mouse is installed, and how many buttons.
- CALL mtype(RatExists)
- IF RatExists...
-
-
-
- MENUCTRL: Traps keyboard input, returning 1 - 10 or 15 indicating
- which number key or Function key was input.
-
- CALL menuctrl(ky)
-
- SELECT CASE ky
- ... etc
-
-
- MDLY: Delay or halt processing for a number of milliseconds.
- CALL mdly(500)
-
-
- NFRMAT: Format numeric strings such as phone, account or social
- security numbers
-
- nstring$ = String to process, returns formatted.
- mode = Level or formattting mode (0-6).
- p = Position of delimieter for mode 6
- CALL nfrmat(nstrng$,mode%,p%)
-
- (See full documentation for possibilities on return.)
-
-
- NLOFF/NLON: Turns on or off the Num Lock key (and LED if applicable).
- CALL nlon ' NUMS on
- CALL nloff ' NUMS off
-
-
- PCASE: Converts string to proper case.
- CALL lcase(text$) ' QB 3
- text$=lcase$(text$) ' QB 4
- CALL pcase(text$) ' Any
-
-
- PFILE: Send a disk file to the first printer.
- fil$="ANYTEXT.FIL"
- CALL pfile(fil$)
-
-
- PINIT: Initialize a designated printer in the range of 1-3.
- ptrnum=1
- CALL pinit(ptrnum)
-
-
- PRTSCRN: Sends the current screen display to the printer.
- CALL prtscrn
-
-
- PSTAT: Returns the status of a given printer 1 - 3.
- ptrnum=1
- CALL pstat(ptrnum)
- IF ptrnum THEN PRINT "Printer is rip-roarin' ready!"
-
-
-
- QUIKPRT: Very fast replacement for BASIC's PRINT statement.
- text$ - Text string to QUIKPRT to the screen
- row - Row of screen to print text to.
- col - Column of screen to print to
- attr - color attributes to use for the text. This is
- calculated in the same manner as the attribute is
- for WDW, ERRMSG and others that use it:
- attr=(BACKGROUND * 16) + FOREGROUND
-
- CALL quikprt(msg$, row%, col%, attr%)
-
-
- RAMFREE: Return RAM installed on machine. See also SINFO, CPUINFO.
- mem=0 : CALL ramfree(mem%)
- PRINT "Free memory amount is: ";mem
-
-
- RINSTR: Return the last occasion of a cahr in a string:
- DECLARE FUNCTION rinstr%(strng$, char$)
-
-
- READSCR: Read characters from the screen, much faster than BASIC's
- SCREEN x,y could HOPE to.
- text$=SPACE$(20)
- LOCATE 12,15
- CALL readscrn(text$) ' read 20 chars from 12,15
-
-
- RSTSCRN / SVSCRN: Screen save and restore from dynamic array.
-
- REM $DYNAMIC
- REDIM scrnarry(6000)
-
- segptr1=VARSEG(scrnarry(1))
- sptr1=VARPTR(scrnarry%(1))
-
- segptr3=VARSEG(scrnarry(4000))
- sptr3=VARPTR(scrnarry%(4000))
-
- CALL rstscrn(segptr1, sptr1)
- CALL svscrn(segptr3, sptr3)
-
-
-
- D-, USCROLL: Scroll a "window" on the screen up or down a given
- number of lines. Scrolled lines are lost.
-
- num - number of lines to scroll up or down
- top and bttm are the top and bottom lines to scroll [1-25]
- lft and rt are the left and right columns to scroll [1-80]
-
- CALL dscroll(num%, top%, lft%, bttm%, rt%)
- CALL uscroll(num%, top%, lft%, bttm%, rt%)
-
-
- SCRLOFF/SCRLON: Turns the scrtoll lock keys on or off.
- CALL scrloff
- CALL scrlon
-
-
-
- SCRNDUMP: Saves the surrent screen to a disk file.
- OPEN "scrndump.fil" FOR APPEND AS #6
- CALL scrndump(6)
- CLOSE #6
-
-
- SCROLLER: Scroll the screen left or right.
- CALL scroller(5)
- CALL scroller(-15)
-
-
- SETERR: Terminates program execution and sets return code.
- ercode = 5
- CALL seterr(ercode%)
-
-
- SETFATTR: Set file attributes.
- DECLARE FUNCTION setfattr%(fil$)
-
- SINFO: Returns basic hardware configuration:
- RAM installed, serial and parallel ports, EGA RAM, and if VGA
- is installed.
-
- CALL sinfo(mem, ser, par, ega, vga)
-
- Note: EGA returns as RAM Kb amount: 64k, 128k, 256k or 0 for
- no EGA. VGA returns 0/1 as yes or no, one is installed. All
- GLIB video routines automatically check if EGA is instaled and
- act accordingly.
-
-
- SYSTIME: Read the system clock and convert to hours, minutes, seconds
- and hundredths. Faster than parsing TIME$.
- CALL systime(h, m, s, hh)
-
-
- TFRMAT: Formats time to 12 hour clock. Mode indicates label on/off.
- CALL tfrmat(nutime$, mode)
- PRINT nutime$
-
-
-
- VFNAME: Test a string to see if it is a valid filename.
- DECLARE FUNCTION vfname%(fil$, DosCode%)
- LINE INPUT "", fil$
- InvalidCahr=vfname(fil$, DosCode)
-
-
-
- VIDOFF: Turn off the CRT beam for mono, EGA, and CGA.
- CALL vidoff
-
- VIDON: Turn on CRT beam.
- CALL vidon
-
- WDW: Put window on screen with full color, frame and sound control.
- FR - Frame Style:
- 1 - DBL H / DBL V 2 - DBL H / SGL V
- 3 - SGL H / SGL V 4 - SGL H / DBL V
-
- ATTR - Color attributes for the window. attr= (bg*16)+fg
-
- CALL wdw(top, left, bot, rt, sfx, gro, fr, attr, l$)