home *** CD-ROM | disk | FTP | other *** search
QuickBASIC Tokenized Source | 1991-08-26 | 28.0 KB | 554 lines |
- RegType
- flags
- @ INTERRUPTq
- intnumX
- inregZ
- outreg
- DosVer
- DiskSpace
- DriveL
- UseDrive
- MuzKeyL
- BlinkBar(
- NumbChar.
- charK
- DosPrint
- WindowR
- Window.Stroll
- lines
- BackColorA
- PrGraph~
- ScrMode
- Lmargin
- InRegs
- outregs
- NMALLOC4
- INCLUDEX
- ErrHandle:
- SpcDrive
- DefDrive
- ErrRecy
- Demo.StrollWindow.
- Demo.WindowStroll
- RollWind<
- Demo.RollWindb
- menu.window
- border
- CURSOROFF
- bottomv
- Plus.Window
- Text.Displaye
- Title
- colsu
- text.window
- Demo.Main
- MainInfo1
- Demo.Help
- @ Plus.Help
- Plus.Display
- MainHelp
- Plus.Main
- MainMenuList
- SPACEG
- enter
- TABKEY
- left-
- RIGHTe
- PgDnn
- PgUp.
- NULL6
- CTRLD
- CTRLG
- CTRLH[
- CTRLS#
- CTRLV
- BLACKH
- GREENX
- MAGENTA
- YELLOW
- WHITE
- BRIGHT
- FLASH
- BACKGROUND
- NORMAL6
- HILITE;
- FALSEX
- TRUEg
- CURSORON
- MOVELEFT
- MOVERIGHT
- MOVEUP
- MOVEDOWN
- VERTICAL
- HORIZONAL
- Nmenu
- PreMenuL
- Demo.AlarmX
- Demo.BlinkBar
- Demo.
- Demo.DefDrive
- Demo.DosPrint
- Demo.DosVer
- Demo.Muzkey
- Demo.PrGraph
- Demo.SpcDrive
- Demo.UseDrive
- @ Demo.Quit
- HelpBlinkBar1
- HelpDefDrive1
- TotalDrive
- CurDrive
- DriveNam
- Plus.Warningu
- HelpDosVer1
- HelpDosPrint1
- rapidly/
- changing"
- HelpMuzKey}
- HelpMuzKey1
- ErrNR
- HelpPrGraph1c
- HelpPrGraph29
- Graph8
- intpu
- intput
- SUBCALL
- HelpSpcDriveB
- Plus.WindInput
- BACKSPC
- Plus.Alarm
- Warninga
- Sbytes
- PlaySwith
- elsee
- PlayOnC
- HelpUseDrivet
- HelpUseDrive1
- HelpUseDrive2
- HelpRollWindow1|
- HelpRollWind1
- PreTopN
- Totalp
- HelpRollWind
- HLITE
- C1S32M
- F3R7M
- NL12M
- BU3P3
- C1BMO
- NL8H1L3E1L2F1L3G1M
- L1BF1P3g
- BR4C1M\
- BG1F2U3ME
- BR1P1
- BR1P3|
- C3H1M
- U1H2U4BM:
- nDEFINTW
- Alarm3
- MainInfo2
- Plus.Error(
- CodeF
- PrintError!
- DiskError}
- FatalErrorN
- DeviceError
- Plus.
- RegTypeX9
- es/ @
- InterruptX
- InRegsX
- OutRegsX
- Valid
- Demo.GetFileDta
- HelpGetFileDtaG
- HelpGetFileDta1
- GetFileDta
- ErrCode
- FileDta
- FileDta.FileName
- FileType
- DosJunk
- Attr>
- DateR
- SizeO
- FileName
- DtaBufs
- FileListT
- MaxFile
- Counter
- Count]
- DirRow1h
- DirRow2p
- DirCol1
- DirCol2
- FileCountW
- FileCounterU
- DirNum
- Plus.SelectWindow
- FNumy
- ListA
- itemn
- Items
- ItemLen^
- ItemWin
- FileNum+
- exidI
- Cursor%
- WinMax
- WinMin
- PreCursor
- DOWNCursord
- UPCursor
- FilLen
- fileh
- File.Attr@
- Attrib
- Plus.Filter
- AString
- Plus.SkipSpace
- Direc
- instr
- GetDirSpe
- GetDirSpece
- TotalDirve
- GetFileDta3
- GetFileDta4
- HelpGetFileDta4-
- HelpGetFieDta2;
- HelpGetFileDta2
- which
- returns
- number
- repead0
- lSpec
- TempFile
- FilDtaN
- FilDta.FileName
- DriveNum
- DriveSpec
- DirSpec
- NewDrive
- DriveAttrib
- NoMore
- DownArr
- UpArrF
- DownnArr
- LPathx
- TempP
- PathRow
- PathCol
- PathLen
- Lable
- HelpGetFileDta3
- FileCol
- Label
- PRINNT
- CheckDrive
- Plus.CheckDrive
- Plus.ErrDrive
- ErrDrive
- TempErr
- a:intplus.BI'
- Include file for using INTPLUS.BAS
- Definations from QB.BI
- Define the type needed for INTERRUPT
- Define the type needed for INTERUPTX
- Generate a software interrupt, loading all but the segment registers
- Generate a software interrupt, loading all registerse
- If you prefer to use QB.BI which has the similar definations as above:
- --- Delete above lines, use '$INCLUDE: 'qb.bi' instead.
- << Get current DOS version.>>I
- << Get free space on specified drive >>q
- << Change current default drive. Returns total logical drive Number. >>
- << Get current default drive >>.
- << Plays sound for each key user pressed and returns the key >>m
- << Generate a blinking bar till user press a key. >>
- << Print text$ use DOS function. >>r
- << Stroll window in any mode using a DOS function >>
- << Graphics screen dump to dot-matrix printer in mode 1 or 2 only >>
- << Get file information from disk and store in FileDta >>r
- << Get directory information>>
- Define inregs and outregs for INTERRUPT use.n
- Must also copy to the main module if you use this program
- as a secondary module.m
- INTDEMO.BAS: Demo for INTPLUS.BAS
- Note: Must load INTPLUS.BAS together to use. Have the **
- 'INTPLUS.BI' included which has useful defines. *
- You also need to start QB with /L option to use **
- a Quick library which has INTERRUPT routine(s). **
- QB.QLB contains this routine
- * Declarations and definitions for keys
- If you wish to use any subroutines contained in INTDEMO.BAS,
- | following constants must be included or properly defined otherwise.|
- Define names similar to keyboard names with their equivalent key codes.
- Define English names for color-specification numbers. Add BRIGHT to
- any color to get bright version.p
- Miscellaneous symbolic constantso
- --- Number of main memu items
- --- Error handler
- - Main Program start here
- Press a key to continue:e
- - Error Handler
- Program abort on device or fatal error."7
- - Data Section
- " This Demo demonstrates functions and"
- " routines contained in INTPLUS.BAS."
- " 'You may try them on your own risk'"
- " I wrote this Demo program in this"
- " way so I can practice using a good"
- " programming style."
- " Routines in this Demo are also very"
- " useful. They just need a little more"
- " adjustments before you can use."
- " Feel free to use\modify any routines"
- " in INPLUS.BAS and this demo."
- " << FeedBacks: E-mail\GEnie, M.LEI1 >>"
- "IBM-PCRT Search keyword:QTECH"
- "SUB BlinkBar"
- "FUNCTION DefDrive"
- "SUB DosPrint"
- "FUNCTION DosVer"
- "FUNCTION MuzKey"
- "SUB PrGraph"
- "SUB RollWindow"
- "FUNCTION SpcDrive"
- "FUNCTION UseDrive"
- "SUB GetFileDta"
- "<<Quit Demo>>"
- " Choose a sub or function for a demonstration:
- " Use up\down arrows then press <Return> to select a routine"
- " title name for demonstration."
- " BlinkBar(NumbChar, char) is a SUB which displays a blinking bar"
- " rapidly changing Color until a key is pressed by user. "
- " In demo >: CALL BlinkBar(7 * 80, 178)"
- " DefDrive is a integer FUNCTION which returns a value represents"
- " the current default drive."
- " In demo >: CurDrive = DefDrive"
- " DosVer is a integer FUNCTION returns a value which is the current"
- " DOS version times 100."
- " In demo >: Ver% = DosVer%"
- "$"
- " DosPrint(text$) is a SUB which invokes a DOS function to print a"
- " text string."
- " In demo >: CALL DosPrint(Pr$)"
- " Muzkey$ is a string FUNCTION plays a different sound for each key"
- " pressed before returning the value."
- " In demo >: Char$ = Muzkey$"
- " SUB PrGraph (ScrMode, Lmargin, c1, r1, c2, r2) prints graphics screen"
- " images to EPSON or compatible dot-matrix printer in screen mode 1 or 2"
- " In demo >: CALL PrGraph(1, 1, 0, 0, 319, 199)"
- " In this demo, we will go on to display and to print a graph in screen"
- " mode 1. Portion of the graphics screen can be selected by specify"
- " range: c1, r1, c2, r2 parameters in PrGraph."
- " If your monitor does not support CGA mode 1 or you don't have a Epson"
- " or compatible DOT-MATRIX printer, you may press <ESC> to abort now."
- " FUNCTION SpcDrive! (Drive%) returns a SINGLE precision number which is"
- " the free bytes availiable in drive specified by user. [Use with Caution]"
- " In demo >: Sbytes! = SpcDrive!(Drive)"
- " FUNCTION UseDrive (Drive%) sets new default drive and returns a
- " integer value which is the number of total logical drives availiable."
- " In demo >: TotalDrive = UseDrive(Drive)"
- " Now you can check new default drive is set by"
- " sending>: FILES with no parameters at the IMMEDIATE"
- 6 " window within QB environment"
- J "$"
- " SUB RollWind (Lines, r1, c1, r2, c2, BackColor) stolls lines in"
- " vertical direction in a window defined by r1,c1,r2,c2. Backcolor is"
- 8! " the color used to fill the new line(s). Lines : positive means up"
- ! " , negative means down. >>In demo: CALL RollWind(1, 4, 16, 16, 64, 1)"
- ! "$"
- ! " SUB GetFileDta (Spec$, DtaBuf AS FileType, ErrCode%) returns DtaBuf"
- D" " as a file information specified by Spec$. Use it in a loop continue to"
- " " call GetFileDta until ErrCode is not 0. FileType: see INTPLUS.BI."
- " " FUNCTION GetDirSpec$ () returns current directory information"
- " "$"
- 6# " GetFileDta simply returns file DTAs. Demo.GetFileDta "
- x# " demonstrates of how to use returned DTA in a program:"
- # " Demo.GetFileDta repeatly calls GetFileDta to get list of"
- $ " Filenames and stores them in a array which later passes to"
- ($ " Demo.SelectWindow."
- n$ " Demo.SelectWindow is a function allows user to select a"
- $ " item from a window. When a item is select, it's returned as"
- $ " a valid array index number."
- $% " Demo.GetFileDta gets the number, checks if the refered"
- j% " entry is a directory. If so, change to this directory and"
- % " repead above procedures. Otherwise, a file is selected."
- % "$"
- % "File Name:"
- Demo.RollWind
- Use up\down arrows
- Plus.Window
- Display a window enclosed with (r1,c1,r2,c2)r
- Border style is defined by "border", (see below).
- 1 : single bar, 2 : double bar ,3 : solid bar, 0 : clear window
- others : CHR$(border) is used;
- - clear window
- Demo.Main
- Functionn returns a valid main menu item selected by user
- - Display menu\help\etc. screensn
- << DEMO FOR INTPLUS.BAS >>:Introd e
- Future QB uploads"e
- d d d
- DEMOS"d d!e
- - The loop below respond to user`s key strokes.o
- When <Enter> is pressed, menu been selected.r
- - get a key
- - if key length = 2
- --- arrow key?e
- --- display menu cursor
- --- menu been selected
- --- a wrong is pressed
- - return menu selected
- Plus.Display
- Header: noneP
- Call: text.window
- Update: 1/19/91
- Update for INTDEMO (5/20/91)
- Comments: Must in the module contain DATAs that
- contain texts to display.(Terminated by a "$")
- -- Display text in window, center Title$ if availiable
- Plus.Help
- Display Help Screen
- Description"e
- Demo.BlinkBar
- Demo.DefDrive
- Returning value:
- Your current default drive is
- Demo.DosPrint
- Type line(s) of text below:"
- Print the string in DOS:
- Demo.DosVer
- Returning value:
- Current DOS version is
- Demo.Muzkey
- Type characters in the window below: [ESC to quit]
- --- See Plus.WindInput
- Demo.PrGraph
- Current video mode does not support CGA.7
- PrGraph"d
- C1S32M+2,7F3R7M+2,-3NL12M+2,-6L3M+1,6BU3P3,1C1BM-2,4P1,1BM+2,-1M-2,-9NL8H1L3E1L2F1L3G1M-2,9M+1,-4M-2,-3L1BF1P3,1BR4C1M+1,2M+2,-1M-3,-1BM+4,1M+2,1M+1,-2M-3,1BG1F2U3M-2,1BR1P1,1BM-4,2M+3,-1M-2,3M-1,-2BR1P3,1BM+3,1P2,1BM-9,-6C3H1M-2,-1M-1,-4BM+4,6U1H2U4
- T E A"
- T i m e !"
- Adjust printer. Press a key to print:"
- Demo.SpcDrive
- Check space on which drive: ?"
- Invalid drive or Illegal input. Use A,B,C.."7
- There are
- free byes in Drive
- Demo.UseDrive
- - Display Help
- - Get current driveo
- - Get total logical drive number
- Current default drive is :
- Select new default drive from ['A' to '"
- - Get a key and convert to upper caseu
- - Convert to drive numberC
- -- It's valid?
- - If not valid
- Invalid drive or Illegal input. Use A,B,C, etc..7
- - * Change to New Default drive
- Default drive has set to "
- Total numbers of logical drive is "
- - A warning
- Note: UseDrivee
- Demo.Quit
- Plus.Warning
- Display warning message and wait for a key is pressed
- Plus.WindInput
- Get user Input in a window defined by (r1, c1, r2, c2).
- Function returns a string.
- - Play sound for each key stroke?e
- -- no sound
- Plus.Alarm
- A replacement of BEEP.r
- Demo.GetFileDta
- This demo can be used to get a file name from disk. Stored in FileName or
- rename this routine as a function returns a file name as a string.
- If you wish to use this procedure routine in your program:s
- 1. Make sure pre-requested specifications are included:s
- Intplus.BI, constants declared in IntDemo.BAS main module,
- etc...s
- 2. Delete Help lines.S
- 3. Following subroutines are needed. Copy\Move them to your program
- >> Demo.GetFileDta
- --> this routine
- >> Plus.Window
- --> draw windows
- >> Plus.Warning
- --> display warning message
- >> Plus.SelectWindow
- --> select items from window
- >> Routines in INTPLUS.BAS
- 4. Rename subroutines or make any adjustments needed.o
- 5. Change variable values as needed:
- MaxFile, FilLen, Window variables, etc.
- 6. Make bigger changes only after you have got it running in your program.
- - initialize data
- Maxmum file can get, changed it if neededm
- File name length = 13c
- Special attrib for drive
- -- Window location used by Plus.SelectWindow
- -- location to display selected path\file item
- - Arrays\other inits
- hold file namesN
- hold attribs
- -- get default drive
- make legal drive name.
- --- Get Total drives availible
- fill them into the filelist.t
- These drive entries will
- always exist in FileList()e
- and Attrib().
- - Help lines
- -- Display help screen
- -- Display second help screeng
- How it worksd
- -- check drive door,
- -Main procedure
- - loop get file names and store them in FileList()L
- - Get DTAt
- - Exit when Error occors or no more file can be stored
- - Increament file counts
- - Store FileName. Other file informations like
- Date, time, etc also can be stored. See FileDta
- for specificaitions.
- - Store file attrib seperatly, Used later to determine if
- selected file is actual a directory.S
- -- a path name, format it with a "\"
- -- A label, Get Lable$
- -- Decreace file count by 1, so it wont appear in FileList(),r
- -Display Path window
- -- Note: If lable is found previously, it is printed with help msg.
- - get directory informationn
- -- print directory information
- - Select file
- - Examine selected filey
- --- it's a path name then change path
- --- special coded, it's a drive, change drive
- --- A real file name is found, then quit
- - Initialize these variables, and start again.
- - Make a complete file name
- - Simply print this file name. If you modify this procedure to
- a function returns selected file name as a string, FileName$o
- is what should be returned.
- Plus.SelectWindow
- Returns a item number selected by user in a window.
- CALL:
- Plus.Window
- UpDate: 5/21/91
- Comments:Window is specified by (r1,c1)-(r2,c2);
- Items() is array of strings displayed in a window;
- is maximum items in the array
- Up/Down or PgUp/PgDown search are allowed;
- <esc> returns 0 or no item is selected;
- <enter> returns selected item as a array index number
- -- more data indicaters
- -- displayed at frame;
- -- no more data indicater
- clear window
- Plus.Filter
- Plus.ErrDrive
- Check if a given drive is available
- Error using drive
-