home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
progm
/
qlib.zip
/
QB1.MAN
< prev
next >
Wrap
Text File
|
1991-02-05
|
63KB
|
1,429 lines
QQ
QB1 ROUTINES & FUNCTIONS 1
════════════════════════════════════════════════════════════════════════════════
ANAM$ ANAM$ (N$,L%) QB1...........FUNCTION
ANAM$ takes a string N$ and checks it for length L. If N$ is longer
then L ANAM$ reduces the first word in the string to an initial and
a period, for example ANNAM$("Johann Browzalwoski",16) would return
J. Browzalwoski. If the abreviated string is still longer than L
then only the first L letters of the string are returned.
ARG$ ARG$ (N%) QB1...........FUNCTION
ARG$(N%) returns field N from the string A$ set by ARGS(A$,S$).
ARGS% ARGS% (A$,S$) QB1...........FUNCTION
ARGS%(A$,S$) separates the string A$ into fields using S$ as a field
separator, stores the fields, and returns the number of fields. A
string must be separated by ARGS before it is accessible to ARG$.
ARKEY ARKEY (P%,R%,C%) QB1........SUB ROUTINE
ARKEY moves the cursor via the arrow keys. P is the key code,
H is the row and C is the column. Key codes are read in the values
used by KEYIN.
ASCII ASCII QB1........SUB ROUTINE
Prints a full screen ASCII chart
ASCNUM$ ASCNUM$ (F$) QB1...........FUNCTION
Turns a string of characters into a string of numbers which are the
decimal ASCII values of the characters. Each number is separated
by a space. ASCNUM("AB") would return 65 66.
ASF% ASF% (A$) QB1...........FUNCTION
ASF(A$) opens a sequential file for appending and returns the file
number as the value of ASF.
BKEY BKEY QB1........SUB ROUTINE
Sets the key combinations CTL END, CTL BKSP, and CTL ALT DEL to abort
programs. BKEY should be called in the main module with all modules
compiled using the /V option for BKEY to have effect throughout the
program. If BKEY is called in the main module and a break sequence
is entered in a module not compiled with /V the program will not end
until the main module is accessed again.
QB1 ROUTINES & FUNCTIONS 2
════════════════════════════════════════════════════════════════════════════════
BOFM% BOFM% QB1...........FUNCTION
BOFM returns the number of the last print line on a page. This
function is only valid if the printer has been defined with PRTDEF.
BOXC BOXC QB1........SUB ROUTINE
BOXC closes boxes opened with BOXO.
BOXO BOXO (T%,B%,C%,W%) QB1........SUB ROUTINE
BOXO opens a box in the screen.
T% is the starting row of the box.
B% is the ending row.
C% is the starting column.
W% is the width of the box.
CCNV$ CCNV$ (A$) QB1...........FUNCTION
CCNV parses a line of text and replaces any control characters found
with the ASCII notation ^CHAR where CHAR is the character designator.
The modified line is returned as the function value.
CDIR$ CDIR$ (D$) QB1...........FUNCTION
CDIR$ returns the value of the current directory path for drive D$
in the same manner that the DOS command CD D$ would return it. If
D$ is nul then the current drive is assumed. If D$ is an invalid
drive then a null string is returned.
CDRV% CDRV% QB1...........FUNCTION
CDRV% returns the value of the current disk drive in numeric format
with 0 being drive A and 25 being drive Z. To get the current drive
in ASCII just use the command D$=CHR$(CDRV%+65).
CELSIUS# CELSIUS# (F) QB1...........FUNCTION
CELSIUS# returns the temperature in Celsius for F degrees Fahrenheit.
CENTER% CENTER% (A$) QB1...........FUNCTION
CENTER(A$) returns the value of the left margin on the screen to
print the string A$ centered on an 80 character display.
QB1 ROUTINES & FUNCTIONS 3
════════════════════════════════════════════════════════════════════════════════
CHDRV% CHDRV% (DL%) QB1...........FUNCTION
CHDRV changes the current drive to DL where DL is a valid drive
number from 0 to 25 with 0=A, 1=B, etc. If DL is an invalid drive
or a drive change is not made then CHDRV returns a 0 else it returns
a value of 1.
CKDIR% CKDIR% (A$) QB1...........FUNCTION
CKDIR checks the validity of directory A$ and returns either a true
or false depending upon the existence of the directory.
CKDRV% CKDRV% (DR%) QB1...........FUNCTION
CKDRV checks the validity of drive number DR and returns either a
true or false depending upon the existence of the drive.
CKFILE CKFILE (F$) QB1........SUB ROUTINE
CKFILE checks for the existence of file F$ and aborts the program
with an error message if the file does not exist.
CLEAN$ CLEAN$ (F$) QB1...........FUNCTION
CLEAN$(F$) strips all ASCII 0 characters from the string F$. This
can be used to clean up strings from TYPE fields which are padded
with the ASCII 0 character.
CLKTIME$ CLKTIME$ (T) QB1...........FUNCTION
CLKTIME$ returns an HR:MN time format for a decimal time. For
example CLKTIME$(4.5) would return 04:30.
CLMENU CLMENU QB1........SUB ROUTINE
CLMENU clears data from the exisiting menu when using the function
MENU. CLMENU should be called each time before reloading the menu
with the LDMENU sub routine.
CMETER# CMETER# (I) QB1...........FUNCTION
CMETER# returns the number of centimeters in I inches.
CMON$ CMON$ (A$) QB1...........FUNCTION
CMON converts three letter month notations to numeric strings in the
manner of CMON$("Feb") which returns a value of 02.
QB1 ROUTINES & FUNCTIONS 4
════════════════════════════════════════════════════════════════════════════════
CMOV CMOV (P%,H%,V%,T%,B%,L%,R%) QB1........SUB ROUTINE
CMOV moves the cursor inside a box. P is the input code, H is the
row, V is the column, T is top of box, B is bottom of box, L is the
left side and R is the right side.
COLBG% COLBG% (N%) QB1...........FUNCTION
COLBG returns the BASIC background color value for the color N set by
the COLORINT or COLORCFG routines. The values for N are:
1 - Normal
2 - Highligt
3 - Reverse
COLFG% COLFG% (N%) QB1...........FUNCTION
COLFG returns the BASIC foreground color value for the color N set by
the COLORINT or COLORCFG routines. The values for N are as in COLBG.
COLORATB COLORATB (F%,B%) QB1...........FUNCTION
COLORATB returns the DOS color attribute for the BASIC color F,B
where F is foreground and B is background.
COLORBAS COLORBAS (A%,F%,B%) QB1........SUB ROUTINE
COLORBAS takes the DOS color attribute A and returns the BASIC color
equivalent as F = foreground and B = background.
COLORCFG COLORCFG QB1........SUB ROUTINE
COLORCFG displays a color chart showing the 128 available attributes,
and prompts the user to set the systems default colors for normal,
highlight, and reverse video. The system is then set with COLORSET
to the normal attribute.
COLORINT COLORINT (NF%,NB%,HF%,HB%,RF%,RB%) QB1........SUB ROUTINE
COLORINT is used to set default colors for the system and enables the
use of several display options that reduce repetitive coding. The
difference between COLORINT and COLORCFG are that COLORCFG responds
to user input while COLORINT sets programmer defined colors. The
values for COLORINT in BASIC format are:
NF = Normal foreground NB = Normal background
HF = Highlight foreground HB = Highlight background
RF = Reverse foreground RB = Reverse background
QB1 ROUTINES & FUNCTIONS 5
════════════════════════════════════════════════════════════════════════════════
COLORMAP COLORMAP QB1........SUB ROUTINE
COLORMAP displays the 128 non-blinking DOS color attributes in their
colors.
COLORSET COLORSET (N%) QB1........SUB ROUTINE
COLORSET sets the current color to N using the values recorded by
COLORCFG or COLORINT where N is 1, 2, or 3 for normal, highlight, and
reverse color.
COLPR COLPR (R%,C%,A%,D$) QB1........SUB ROUTINE
COLPR locates at R,C and prints string D$ using the color value A
where A is either 1, 2, or 3 as defined by COLORSET. The system is
then returned to the color in effect before COLPR was called.
CONCAT$ CONCAT$ (F$,N%) QB1...........FUNCTION
CONCAT$ concatenates a string F$ onto itself N times. Thus the
command X$=CONCAT$("X0",10) returns X$ as X0X0X0X0X0X0X0X0X0X0.
COORD COORD (X%,H%,V%) QB1........SUB ROUTINE
COORD returns the row H and column V of the cursor based on the
absolute screen address of X which is from 0 to 4000 in steps of 2.
COPY COPY (S$,D$) QB1........SUB ROUTINE
COPY copies source file S$ to destination file D$.
CPRINT CPRINT (R%,C%,D$,N1%,N2%,R1%,R2%) QB1........SUB ROUTINE
CPRINT prints the string D$ at R,C in colors R1,R2 then resets the
system to N1,N2.
CURZ CURZ (N%) QB1........SUB ROUTINE
CURZ sets the cursor size N with 0 being the smallest size and 12
the largest size cursor.
CVBASE CVBASE (BN%,NM%,B1%,B2%) QB1........SUB ROUTINE
CVBASE takes a decimal number NM and using a base of BN returns
B1 the number of base units in the number, and B2 the remainder.
Thus CVBASE 8,16,X,Y would return X=2 and Y=0.
QB1 ROUTINES & FUNCTIONS 6
════════════════════════════════════════════════════════════════════════════════
D2B D2B (D%,B1%,B2%) QB1........SUB ROUTINE
D2B takes a decimal number D and returns its 256 base value in the
manner of CVBASE.
DATERR DATERR (E$,M$,D$) QB1........SUB ROUTINE
DATERR is an internal procedure for datemath functions. It prints an
error message on receiving ERROR in E$. M$ is the function in which
the error occurred, and D$ is the bad date string.
DAYNUM% DAYNUM% (A$,B$) QB1...........FUNCTION
DAYNUM returns the value of the difference in days between two dates,
A$ and B$ which must be expressed in either the YYMMDD format or the
YYYYMMDD format. Invalid dates halt program.
DECTIME DECTIME (T$) QB1...........FUNCTION
DECTIME returns HR:MN time in hours in decimal format. For example
DECTIME("04:30") would return 4.5.
DEFPRT DEFPRT (F$) QB1........SUB ROUTINE
DEFPRT is an input routine for defining printer codes in the file
F$. DEFPRT reads in the codes in the file if it exists, then loops
in an input screen for additions or modifications, and saves the
changes in the file upon exit. All code fields only accept valid
three digit ASCII code numbers. The program automatically pads one
and two digit numbers, and automatically spaces between numbers.
DEFPRT creates files for use by the printer code routine PRTDEF.
DELIN DELIN (P%,R%,C%,D$,I%,L%) QB1........SUB ROUTINE
DELIN performs DELETE and INSERT operations on a field using the with
the following parameters:
P% is the signal sent to DELIN.
-83 = Delete character
-82 = Insert space
4 = Delete to end of field
8 = Backspace and delete character
R% is row
C% is the screen column
I% is the field location
L% is the field length.
D$ is the filed string.
QB1 ROUTINES & FUNCTIONS 7
════════════════════════════════════════════════════════════════════════════════
DNUM# DNUM# (N$,D%) QB1...........FUNCTION
DNUM takes a number in string format N$ and a value indicating the
number of decimal places D and returns N$ in decimal to D places and
the value of DNUM as the double precision value of N$.
DRIVE$ DRIVE$ (N%) QB1...........FUNCTION
DRIVE$ returns the letter of drive N if N is a valid drive number
from 0 to 25. DRIVE$ also appends the colon to the drive. For
example DRIVE$(0) would return A:. An invalid number returns a null.
DRIVN% DRIVN% (D$) QB1...........FUNCTION
DRIVN returns the drive number for a valid drive letter A to Z and a
-1 for an invalid character. DRIVN is not case sensitive.
DSUM DSUM (N,P$,P%) QB1........SUB ROUTINE
N is the input number
P$ is number in string format
P is the specified string length
DSUM takes a number and rounds it to a two place decimal number. It
then creates a string with the two decimals padded with zeros if they
are blank. If the length of the string is less than P then the front
of the string is padded by spaces to give the required length.
DVDR% DVDR% (A$,DV$,DR$) QB1...........FUNCTION
DVDR takes a string A$ and divides it into a drive DV$ and directory
DR$. If an invalid drive or directory is encountered DVDR returns
a false value, otherwise a true is returned.
EDCK% EDCK% (A$,I%) QB1...........FUNCTION
EDCK returns an edit value for the character at MID$(A$,I,1).
The values are:
Character Value
═════════ ═════
A-Z 1
0-9 2
space 3
. 4
- 5
, 6
% 7
$ 8
any punct. 9
fail 0
QB1 ROUTINES & FUNCTIONS 8
════════════════════════════════════════════════════════════════════════════════
ENVCL ENVCL QB1........SUB ROUTINE
ENVCL clears the environment string of all variables except the PATH
and COMSPEC variables. It then sets the fields ENVT and ENVF which
hold the values of the total environment space available for use, and
the current amount of space free. ENVCL must be invoked prior to the
use of ENVFR or ENVSET functions.
ENVFR% ENVFR% QB1...........FUNCTION
ENVFR returns the number of bytes free in the environment space.
ENVSET% ENVSET% (A$) QB1...........FUNCTION
ENVSET(A$) checks to see if there is enough space in the environment
string to set A$, and if there is it sets it and adjusts the space
counter by the number of bytes added or deleted. ENVSET returns a
true value of -1 if successful, or a false value of 0 if it fails.
EXINT EXINT (IR%,AH%,AL%,BH%,BL%,CH%,CL%,DH%,DL%, QB1........SUB ROUTINE
BP%,SI%,DI%,FG%,DS%,ES%)
EXINT performs a system interrupt request where IR is the interrupt
and AH thru ES are the registers with AX thru DX split into high and
low. On the return the register parameters contain the values of the
registers as modified by the interrupt call.
EXIST% EXIST% (A$) QB1...........FUNCTION
EXIST checks for the existence of the file A$ and returns TRUE
or FALSE as -1 or 0 per BASIC protocol so that the statement
IF EXIST(A$) THEN XYZ will execute XYZ if A$ is a valid file.
FAHREN# FAHREN# (C) QB1...........FUNCTION
FAHREN# returns the Farhrenheit temperture for C degrees celsius.
QB1 ROUTINES & FUNCTIONS 9
════════════════════════════════════════════════════════════════════════════════
FED$ FED$ (D$,N%) QB1...........FUNCTION
FED$ is a edit filter which returns an edited version of D$ using
code N. Edit codes are:
1. All uppercase
2. All lower case
3. If a valid YYYYMMDD or YYMMDD date is entered it is returned
else a nul string is returned.
4. If a valid HR:MN time is entered then it is returned in 24
hour notation, else a nul string is returned.
5. If a valid HR:MN time is entered then it is returned in 12
hour notation, else a nul string is returned.
6. String is converted to its numeric value and a two place
decimal number is then returned as a string.
7. String is converted to its numeric value then returned as
a string with a minimum of two digits, left padding a zero
onto numbers less than 10.
8. String is converted to its numeric value then returned as
a string with a minimum of three digits, left padding one or
two zeros when necessary.
9. Evaluates for either Y or N in either case. If Y or N then
it returns the upper case value else nul string is returned.
0. Any other value ignores edits and returns input string.
FEET# FEET# (M) QB1...........FUNCTION
FEET# returns the value of M meters in feet.
FILOC$ FILOC$ (A$) QB1...........FUNCTION
FILOC$ searches for the file A$ as input, then in all paths in the
PATH environment for PATH\A$. If a file is located FILOC exits with
the full path of the file, otherwise FILOC exits as an empty string.
FIN FIN QB1........SUB ROUTINE
FIN sets the video to black background, clears the screen, and ends
the program.
FLIST% FLIST% (N$) QB1...........FUNCTION
FLIST does a DIR on the string N$ then loads all of the files listed
into an array accessed by FLST$. FLIST returns the number of records
in the array. Files are sorted in ASCII order and the limit is 200.
FLST$ FLST$ (N%) QB1...........FUNCTION
FLST$(N) returns the Nth record in the FLIST array.
QB1 ROUTINES & FUNCTIONS 10
════════════════════════════════════════════════════════════════════════════════
FMT$ FMT$ (N%) QB1...........FUNCTION
FMT$(N) returns the Nth format set by the command SETFORM. IF the
Nth format does not exist then the format is set to &.
GALLON# GALLON# (L) QB1...........FUNCTION
GALLON# returns the value of L liters in gallons.
GETCOL GETCOL (X%,F%,B%) QB1........SUB ROUTINE
GETCOL looks into screen address X, an odd number for attributes,
and returns the BASIC values F for foreground and B for background.
Using the function SPOT the address for the cursor would be SPOT+1.
GETFDAT GETFDAT (F$,D$(),BR%,BE%,EE%,TR%,RL%) QB1........SUB ROUTINE
GETFDAT opens file F$ the loads it into array D$() starting at array
record BR. Each file record read is put into an array element. The
routine starts at element BE and sequentially places new records into
the array record until element EE has been filled. Then the record
is incremented and the process repeats until either an EOF is reached
or record limt RL is reached. The file is closed and the number of
the last array record loaded is returned as TR.
GETW% GETW% (A$) QB1...........FUNCTION
GETW returns the character width for character A$ set by SETW.
GRAM# GRAM# (OZ) QB1...........FUNCTION
GRAM# returns the value in grams of OZ ounces avoirdupois.
HMOVE HMOVE (P%,I%,L%,TB%) QB1........SUB ROUTINE
HMOVE moves the cursor horizontaly within a field without altering
the field. Parameters are:
P is the input signal.
-77 = Right Arrow
-75 = Left Arrow
-15 = Back Tab / Shift Tab
9 = Tab
I is the location in the string.
L is the string length.
TB is the tab increment value.
QB1 ROUTINES & FUNCTIONS 11
════════════════════════════════════════════════════════════════════════════════
HOURS HOURS (T1$,T2$) QB1...........FUNCTION
HOURS returns the number of hours in decimal format between times
T1$ and T2$ where the times are expressed in 24 hour HR:MN format.
INCH# INCH# (CM) QB1...........FUNCTION
INCH# returns the value in inches of CM centimeters.
INCODE% INCODE% (D$,L%) QB1...........FUNCTION
INCODE is a special input routine for ASCII three digit codes where
D$ is the string containing the codes and L is the length of the
string. Input takes numbers only and fills cells of three digits
with spaces between up to the length of the string. Space and Tab
jump cursor to next cell. Left Arrow moves cursor left, Enter, Down
Arrow, and Up Arrow record string and exit. Del deletes cell, and
Esc exits without recording. INCODE returns the ASCII value of the
exiting signal in accordance with the KEYIN routine. Down arrow is
changed to Enter.
INFLD% INFLD% (F$,L%) QB1...........FUNCTION
INFLD takes a string F$ and a string length L and goes into an input
routine until the string end is reached or a control key is entered.
If the string end is reached the control code 13 is automatically
called to end input. Upon return the modified string is in F$ and
the value of the control key is in INFLD. Key values are those used
in KEYIN. ASCII 32 to 126 are treated as text, all other codes are
treated as control codes.
INLINE$ INLINE$ QB1...........FUNCTION
INLINE$ reads input from redirection until the CHR$(10) character is
encountered, or input is null, then returns the input as value.
Unlike LINE INPUT, INLINE does not echo the input string.
JULCV$ JULCV$ (Y%,JD%) QB1...........FUNCTION
JULCV converts a Julian date into a date string in the format YYMMDD
or YYYYMMDD depending upon the year input. Two digit years before
51 are increased by 2000. Those of 51 to 99 are increased by 1900.
Y is the year.
JD is the Julian date in that year.
QB1 ROUTINES & FUNCTIONS 12
════════════════════════════════════════════════════════════════════════════════
JULIAN% JULIAN% (Y$) QB1...........FUNCTION
JULIAN returns the Julian date for a YYYYMMDD or YYMMDD date format.
Six digit dates are converted to eight digit ones by adding 2000 to
years 00-50 and 1900 to years 51-99. Invalid date halts program.
KEYIN% KEYIN% QB1...........FUNCTION
KEYIN activiates an INKEY loop and then returns the ASCII decimal
value of the input key. For two digit key codes such as ALT+KEY,
CTL+KEY, Arrow keys, PGUP, etc. the minus value of the second digit
is returned.
KEYSET KEYSET QB1........SUB ROUTINE
KEYSET sets function keys 1-10 to ASCII 201 to 210.
KGRAM# KGRAM# (P) QB1...........FUNCTION
KGRAM# returns the value of P pounds in kilograms.
KMETER# KMETER# (M) QB1...........FUNCTION
KMETER# returns the value of M miles in kilometers.
LDATE$ LDATE$ (A$) QB1...........FUNCTION
LDATE converts a date in either the YYMMDD, YYYYMMDD or basic DATE$
format into a formal date in the form Mon. DD, YYYY.
LDMENU LDMENU (A$) QB1........SUB ROUTINE
LDMENU A$ adds the name in string A$ to the current menu when the
MENU function is being used. A maximum of 20 entries are allowed,
and entries may be made periodically in response to program options.
LEAPYR% LEAPYR% (Y%) QB1...........FUNCTION
LEAPYR evaluates the year Y which must be in the YYYY format, and
returns a 1 if it is a leap year or a 0 if it is not.
LITER# LITER# (G) QB1...........FUNCTION
LITER# returns the value of G gallons in liters.
QB1 ROUTINES & FUNCTIONS 13
════════════════════════════════════════════════════════════════════════════════
LOFM% LOFM% QB1...........FUNCTION
LOFM% returns the value of the page length or length of form set in
the PRTDEF routine.
MENU% MENU% (H$) QB1...........FUNCTION
MENU draws a menu on the screen with up to 20 entries, and prints
H$ across the top as the menu title. Each entry is matched to a
letter, and MENU returns the uppercase ASCII value of the key pressed
if it is a valid selection, or if it is the ESC key. Prior to using
the MENU function a menu must first be loaded with LDMENU.
METER# METER# (F) QB1...........FUNCTION
METER# returns the value of F feet in meters.
MILES# MILES# (KM) QB1...........FUNCTION
MILES# returns the value of KM kilometers in miles.
MKFPATH$ MKFPATH$ (D$,F$) QB1...........FUNCTION
MKFPATH$ checks D$ for a valid directory name construction and F$
for a valid file name construction. If both are valid then MKFPATH$
returns them combined in a valid file path, otherwise it returns a
null string. Construction only is checked, directory and file
existance are not verified.
MLITER# MLITER# (OZ) QB1...........FUNCTION
MLITER# returns the value of OZ fluid ounces in mililiters.
MON$ MON$ (A$) QB1...........FUNCTION
MON evaluates a number string and returns the English version of the
month represented by the number. For example 01 returns Jan. and 06
returns June.
MONITOR& MONITOR& QB1...........FUNCTION
MONITOR returns the value of the monitor offset.
QB1 ROUTINES & FUNCTIONS 14
════════════════════════════════════════════════════════════════════════════════
MORSE MORSE (A$) QB1........SUB ROUTINE
MORSE returns the Morse Code sound for letter A$. All twenty-six
English letters, digits 0-9, and standard Morse Code punctuation are
accepted. Invalid characters return no sound. See MORSESP
MORSESP MORSESP (S%) QB1........SUB ROUTINE
MORSESP S% sets the speed of the MORSE sub routine. Valid values for
S% are 1, 2, or 3. If MORSESP is not called MORSE defaults to 2.
On a 286 machine at 8mhz the average transmission speed was 1=12 wpm,
2=25wpm and 3=40wpm.
MSG MSG (M$) QB1........SUB ROUTINE
MSG takes a message M$ and prints it in reverse video in the center
of the screen for about two seconds before restoring the screen.
NEWDATE$ NEWDATE$ (YY$,D%) QB1...........FUNCTION
NEWDATE returns the new date of Y$ + or - D where Y$ is a valid date
in the YYMMDD or YYYYMMDD format and D is the number of days before
or after the date Y$. Invalid date halts program.
NUMASC$ NUMASC$ (F$) QB1...........FUNCTION
NUMASC$(F$) takes a string of numbers separated by spaces and
returns their ASCII character equivalents. Thus the statement
NUMASC$("65 66") would return AB.
NUMPAD$ NUMPAD$ (N,L%) QB1...........FUNCTION
NUMPAD returns the string value of L digits from the right of number
N. If the length of N is less than L then N is padded with leading
zeros until it is the length of L. Thus NUMPAD$(4,3) returns 004.
OBF% OBF% (F$) QB1...........FUNCTION
OBF opens file F$ in the binary mode and returns the file number.
OZADP# OZADP# (G) QB1...........FUNCTION
OZADP# returns the value of G grams in ounces avoirdupois.
QB1 ROUTINES & FUNCTIONS 15
════════════════════════════════════════════════════════════════════════════════
OZFLD# OZFLD# (ML) QB1...........FUNCTION
OZFLD# returns the value of ML mililiters in fluid ounces.
PADC$ PADC$ (D$,L%,C%) QB1...........FUNCTION
PADC$ returns string D$ padded equally on left and right with ASCII
character C to a total string length of L. For example the call
PADC$("exit",10,42) would return ***exit***.
PADL$ PADL$ (D$,L%,C%) QB1...........FUNCTION
PADL$ returns string D$ padded on the left with ASCII character C
to make a total string length of L.
PADR$ PADR$ (D$,L%,C%) QB1...........FUNCTION
PADR$ returns string D$ padded on the right with ASCII character C
to make a total string length of L.
PATHCK% PATHCK% (P$) QB1...........FUNCTION
PATHCK checks the PATH environment for directory P$. If it is found
then a 1 is returned else a 0 is returned.
POUND# POUND# (KG) QB1...........FUNCTION
POUND# returns the value of KG kilograms in pounds.
PRTCD$ PRTCD$ (N%) QB1...........FUNCTION
PRTCD$ returns the print code for the code value N when the system
has been set with PRTDEF. Valid values for N are:
00 - Initialization string 10 - Bold
01 - Condensed print 11 - Bold Off
02 - Data quality 12 pitch 12 - Underline
03 - Letter quality 12 pitch 13 - Underline Off
04 - Data quality 10 pitch 14 - Italics
05 - Letter quqlity 10 pitch 15 - Italics Off
06 - Double Height 16 - Top Margin in lines
07 - Double Height Off 17 - Bottom Margin in lines
08 - Elongate 18 - Left margin toggle
09 - Elongate Off 19 - Page Length in Lines
QB1 ROUTINES & FUNCTIONS 16
════════════════════════════════════════════════════════════════════════════════
PRTDEF PRTDEF (F$) QB1........SUB ROUTINE
PRTDEF looks for the file F$ and if it is found it reads the printer
codes from it for use by PRTCD$, and the values of top margin, bottom
margin, and page length.
PRTSC PRTSC QB1........SUB ROUTINE
PRTSC prints a screen dump in the manner of CTRL PRINT.
REGH% REGH% (VX%) QB1...........FUNCTION
REGH returns the high bit value of VX. To find AH you would give the
command AH%=REGH%(AX%).
REGL% REGL% (VX%) QB1...........FUNCTION
REGL returns the low bit value of VX in the same manner that REGH
returns the high bit.
REGX% REGX% (VH%,VL%) QB1...........FUNCTION
REGX returns the full byte of the combined high and low bits, thus
you can find the value of AX by using AX%=REGX%(AH%,AL%).
REPRT REPRT (F%,N%,S$) QB1........SUB ROUTINE
REPRT prints the string S$ N times into file number F. F must first
be opened in either the write or append mode.
ROMAN$ ROMAN$ (N%) QB1...........FUNCTION
ROMAN$(N) returns the roman numeral for the number N if it is less
than 10000.
ROUND ROUND (N,P%) QB1........SUB ROUTINE
ROUND rounds number N to decimal place P.
RSF% RSF% (A$) QB1...........FUNCTION
RSF(A$) opens a sequential file for reading and returns the file
number as the value of RSF.
QB1 ROUTINES & FUNCTIONS 17
════════════════════════════════════════════════════════════════════════════════
SCLOAD SCLOAD (F$,S%) QB1........SUB ROUTINE
SCLOAD takes file F$ and BLOADs it at line S.
SCOUNT% SCOUNT% (A$,B$) QB1...........FUNCTION
SCOUNT parses string A$ and returns the number of occurances of the
string B$.
SCRNX% SCRNX% (N%) QB1...........FUNCTION
SCRNX% returns the value of parameter N as set with the SETSCRN
command. Parameters are:
1 = Top line
2 = Bottom line
3 = Left column
4 = Right column
SCROLL SCROLL (D%,N%,A%) QB1........SUB ROUTINE
SCROLL is used in programs that set the video with SETSCRN. It moves
N number of lines in the view port in direction D (6 up 7 down) with
an attribute of A expressed in DOS video code.
SCSAVE SCSAVE (F$,S%,E%) QB1........SUB ROUTINE
SCSAVE saves a screen from line S to line E into file F$ using the
BSAVE command.
SDATE$ SDATE$ (A$) QB1...........FUNCTION
SDATE converts a date in either the YYMMDD, YYYYMMDD or basic DATE$
format into a formal date in the form Mon. DD.
SETFORM SETFORM (F$) QB1........SUB ROUTINE
SETFORM reads the file F$ for up to 20 format lines to be used in
PRINT USING statements. These formats are placed in an array that
is accessed by the FMT$(N) function. All empty slots are filled with
the & format.
QB1 ROUTINES & FUNCTIONS 18
════════════════════════════════════════════════════════════════════════════════
SETSCRN SETSCRN (T%,B%,L%,R%) QB1........SUB ROUTINE
SETSCRN sets the view port from top line T to bottom line B with
width from left column L to right column R. In conjunction with the
SCROLL command this enables view port control over both vertical and
horizontal areas. BASIC scrolling commands ignore the horizontal
limits, so lines must be moved with SCROLL rather than PRINT. The
QB.LIB library must be available at link time if this routine is to
be used as it calls routines from there.
SETW SETW (N%) QB1........SUB ROUTINE
Sets the character width for Tandy DMP2100p and DMP2110 12 point
elite and 10 point courier characters to be accessed by GETW. Values
for N are 12 for elite and 10 for courier.
SFM$ SFM$ (L%) QB1...........FUNCTION
SFM$ returns a text formating string for the PRINT USING command
which outputs a string of L spaces in length. If L is 0 then the
string is formatted to variable length.
SMOD$ SMOD$ (A$,B$,C$) QB1...........FUNCTION
SMOD$ returns the string A$ where all occurances of string B$ have
been changed to string C$. If C$ is null then B$ is removed from
the string.
SORTA SORTA (BR%,ER%,F%,A$(),BE%,EE%,FG%) QB1........SUB ROUTINE
SORTA sorts a two dimension array using the following:
BR is the beginning record to sort
ER is the ending record to sort
F is the field or array element to compare in sorting
A$() is the array to sort.
BE is the first element of affected elements
EE is the last element of affected elements.
FG is the display flag
SORTA starts at array record BR and sorts down to record ER using
element F as the comparison field. When swapping data in the sort
only array elements BE through EE are affected. Normally BE is the
first element in the array and EE is the last. The display flag
toggles a sorting countdown on the screen at whatever point you have
positioned the cursor. FG=0 is display off and FG=1 is display on.
Since SORTA uses a converging two record at a time algorithm, the
countdown is deincremented by two.
QB1 ROUTINES & FUNCTIONS 19
════════════════════════════════════════════════════════════════════════════════
SPOT% SPOT% QB1...........FUNCTION
SPOT reads the current cursor position and returns the absolute
screen address.
SPRINT SPRINT (R%,C%,D$) QB1........SUB ROUTINE
SPRINT locates at R,C and prints D$.
STRCHR% STRCHR% (S$,C$,F%,L%) QB1...........FUNCTION
STRCHR searches string S$ for the substring C$ and returns F% as the
first occurance of the substring, L% as the last occurance, and the
function value as the total number of occurances.
SWAPA SWAPA (AA$(),AB$(),RA%,RB%,BE%,EE%) QB1........SUB ROUTINE
SWAPA swaps records between two arrays where AA$() and AB$() are the
arrays, RA is the record number in AA$(), RB is the record number in
AB$(), BE is the beginning element to swap, and EE is the ending
element. Elements BE to EE must exisit in both arrays.
SWAPSCN SWAPSCN (F$) QB1........SUB ROUTINE
SWAPSCN saves the current screen and replaces it with the binary file
F$ using BLOAD. The routine then waits for the ESC key to be entered
and returns the original screen.
TIMEMATH TIMEMATH (T$,H,NT$,D) QB1........SUB ROUTINE
TIMEMATH takes a valid 24 hour HR:MN time string and adds H hours in
decimal notation to it. NT$ is the new time string returned in HR:MN
format, and D is the number of days variation. For example the call
TIMEMATH "23:00",2,NT$,D would return NT$ as 01:00 and D as 1 since
adding 2 hours to 23:00 would be 01:00 the next day. To subtract use
a minus H value, day variation will be returned in a negative number.
If the new time is on the same day the D value is 0.
QB1 ROUTINES & FUNCTIONS 20
════════════════════════════════════════════════════════════════════════════════
TITLE TITLE (PN$,VR$,CR$,M%) QB1........SUB ROUTINE
A$ is the program title.
B$ is the program version number.
C$ is the copywrite date
A is the toggle for Microsoft disclaimer.
TITLE reads the program title and version and prints them on the
screen in a box along with company information. If the toggle "A"
is set to 1 then the Microsoft runtime disclaimer is also displayed.
Microsoft disclaimer must be used for non stand alone programs that
utilize BRUN45.EXE to execute. Company information is hard coded
into the routine, so the TITLE.BAS file must be modified and
recompiled each time company information changes. Input strings are
limited to 40 characters.
TMCK$ TMCK$ (D$,N%) QB1...........FUNCTION
TMCK$ returns D$ in HR:MN notation using a 12 hour clock if N is 12
or a 24 hour clock if N is any other value. Conversions can be made
from 24 hour to 12 hour format or vice versa. An invalid time will
return a null string. For example the call TMCK$("23:00",12) returns
11:00pm while TMCK$("1:30pm",24) returns 13:00.
TOFM% TOFM% QB1...........FUNCTION
TOFM returns the number of the first print line on a page. This
function is only valid if the printer has been defined with PRTDEF.
UPL$ UPL$ (A$) QB1...........FUNCTION
A$ is a string. UPL converts the first letter of every word in the
string to an uppercase letter and returns the converted string.
VPNAM% VPNAM% (N$) QB1...........FUNCTION
VPNAM checks N$ for a valid path or file name and returns a 1 if
valid and 0 if invalid. VPNAM does not check existance, and removes
a trailing \ if it is not the root directory.
WDNAM$ WDNAM$ (A%) QB1...........FUNCTION
WDNAM returns the full English name of a week day based on its day
number. For example WDNAM$(1) returns Sunday.
WDNUM% WDNUM% (A$) QB1...........FUNCTION
WDNUM returns the day number of a day name in the reverse of WDNAM.
QB1 ROUTINES & FUNCTIONS 21
════════════════════════════════════════════════════════════════════════════════
WKDAY% WKDAY% (Y$) QB1...........FUNCTION
WKDAY returns the number of the day of the week represented by the
date Y$ where Y$ is either a valid YYMMDD or YYYYMMDD format date.
Invalid date halts program.
WRTFDAT WRTFDAT (F$,D$(),BR%,BE%,EE%,TR%) QB1........SUB ROUTINE
WRTFDAT opens file F$ and writes array D$() to the file starting with
array record BR and ending with array record TR using array elements
BE to EE. Blank array records are skipped over. Each array record
is written to the file as a file record with the elements as fields
separtated by commas in the manner of the WRITE statement.
WSF% WSF% (A$) QB1...........FUNCTION
WSF(A$) opens a sequential file for writting and returns the file
number as the value of WSF.
YESNO$ YESNO$ QB1...........FUNCTION
YESNO enters an INKEY$ loop and waits for the input of either an
N or Y in either case. The input is then returned as an uppercase
letter N or Y.
YMD$ YMD$ (A$,P$) QB1...........FUNCTION
YMD converts an English date Month xx, xxx into a YYMMDD format date.
Month can be either spelled out or three letter abreveiation.
YRCK$ YRCK$ (D$) QB1...........FUNCTION
YRCK evaluates a YYMMDD or YYYYMMDD date and returns a YYYYMMDD
string if it finds a valid date. If the date is invalid then the
string "ERROR" is returned. Six digit dates with years less than
51 are converted to century 20 while dates 51 to 99 are converted
to century 19.
YYMMDD$ YYMMDD$ (P$) QB1...........FUNCTION
YYMMDD$ returns the YYMMDD format of the current Basic DATE$, and
P$ is the separator to use between elements. Thus for the date
01-10-1991 YYMMDD$("") returns 910110, YYMMDD$(".") returns 91.01.10
and YYMMDD$("-") returns 91-01-10, etc.
QB1 ROUTINES & FUNCTIONS - Table of Contents i
════════════════════════════════════════════════════════════════════════════════
ANAM$ . . . . . QB1...........FUNCTION . . . . . 1
ARG$ . . . . . QB1...........FUNCTION . . . . . 1
ARGS% . . . . . QB1...........FUNCTION . . . . . 1
ARKEY . . . . . QB1........SUB ROUTINE . . . . . 1
ASCII . . . . . QB1........SUB ROUTINE . . . . . 1
ASCNUM$ . . . . . QB1...........FUNCTION . . . . . 1
ASF% . . . . . QB1...........FUNCTION . . . . . 1
BKEY . . . . . QB1........SUB ROUTINE . . . . . 1
BOFM% . . . . . QB1...........FUNCTION . . . . . 2
BOXC . . . . . QB1........SUB ROUTINE . . . . . 2
BOXO . . . . . QB1........SUB ROUTINE . . . . . 2
CCNV$ . . . . . QB1...........FUNCTION . . . . . 2
CDIR$ . . . . . QB1...........FUNCTION . . . . . 2
CDRV% . . . . . QB1...........FUNCTION . . . . . 2
CELSIUS# . . . . . QB1...........FUNCTION . . . . . 2
CENTER% . . . . . QB1...........FUNCTION . . . . . 2
CHDRV% . . . . . QB1...........FUNCTION . . . . . 3
CKDIR% . . . . . QB1...........FUNCTION . . . . . 3
CKDRV% . . . . . QB1...........FUNCTION . . . . . 3
CKFILE . . . . . QB1........SUB ROUTINE . . . . . 3
CLEAN$ . . . . . QB1...........FUNCTION . . . . . 3
CLKTIME$ . . . . . QB1...........FUNCTION . . . . . 3
CLMENU . . . . . QB1........SUB ROUTINE . . . . . 3
CMETER# . . . . . QB1...........FUNCTION . . . . . 3
CMON$ . . . . . QB1...........FUNCTION . . . . . 3
CMOV . . . . . QB1........SUB ROUTINE . . . . . 4
COLBG% . . . . . QB1...........FUNCTION . . . . . 4
COLFG% . . . . . QB1...........FUNCTION . . . . . 4
COLORATB . . . . . QB1...........FUNCTION . . . . . 4
COLORBAS . . . . . QB1........SUB ROUTINE . . . . . 4
COLORCFG . . . . . QB1........SUB ROUTINE . . . . . 4
COLORINT . . . . . QB1........SUB ROUTINE . . . . . 4
COLORMAP . . . . . QB1........SUB ROUTINE . . . . . 5
COLORSET . . . . . QB1........SUB ROUTINE . . . . . 5
COLPR . . . . . QB1........SUB ROUTINE . . . . . 5
CONCAT$ . . . . . QB1...........FUNCTION . . . . . 5
COORD . . . . . QB1........SUB ROUTINE . . . . . 5
COPY . . . . . QB1........SUB ROUTINE . . . . . 5
CPRINT . . . . . QB1........SUB ROUTINE . . . . . 5
CURZ . . . . . QB1........SUB ROUTINE . . . . . 5
CVBASE . . . . . QB1........SUB ROUTINE . . . . . 5
D2B . . . . . QB1........SUB ROUTINE . . . . . 6
DATERR . . . . . QB1........SUB ROUTINE . . . . . 6
DAYNUM% . . . . . QB1...........FUNCTION . . . . . 6
DECTIME . . . . . QB1...........FUNCTION . . . . . 6
DEFPRT . . . . . QB1........SUB ROUTINE . . . . . 6
DELIN . . . . . QB1........SUB ROUTINE . . . . . 6
DNUM# . . . . . QB1...........FUNCTION . . . . . 7
DRIVE$ . . . . . QB1...........FUNCTION . . . . . 7
DRIVN% . . . . . QB1...........FUNCTION . . . . . 7
DSUM . . . . . QB1........SUB ROUTINE . . . . . 7
DVDR% . . . . . QB1...........FUNCTION . . . . . 7
EDCK% . . . . . QB1...........FUNCTION . . . . . 7
ENVCL . . . . . QB1........SUB ROUTINE . . . . . 8
ENVFR% . . . . . QB1...........FUNCTION . . . . . 8
QB1 ROUTINES & FUNCTIONS - Table of Contents ii
════════════════════════════════════════════════════════════════════════════════
ENVSET% . . . . . QB1...........FUNCTION . . . . . 8
EXINT . . . . . QB1........SUB ROUTINE . . . . . 8
EXIST% . . . . . QB1...........FUNCTION . . . . . 8
FAHREN# . . . . . QB1...........FUNCTION . . . . . 8
FED$ . . . . . QB1...........FUNCTION . . . . . 9
FEET# . . . . . QB1...........FUNCTION . . . . . 9
FILOC$ . . . . . QB1...........FUNCTION . . . . . 9
FIN . . . . . QB1........SUB ROUTINE . . . . . 9
FLIST% . . . . . QB1...........FUNCTION . . . . . 9
FLST$ . . . . . QB1...........FUNCTION . . . . . 9
FMT$ . . . . . QB1...........FUNCTION . . . . . 10
GALLON# . . . . . QB1...........FUNCTION . . . . . 10
GETCOL . . . . . QB1........SUB ROUTINE . . . . . 10
GETFDAT . . . . . QB1........SUB ROUTINE . . . . . 10
GETW% . . . . . QB1...........FUNCTION . . . . . 10
GRAM# . . . . . QB1...........FUNCTION . . . . . 10
HMOVE . . . . . QB1........SUB ROUTINE . . . . . 10
HOURS . . . . . QB1...........FUNCTION . . . . . 11
INCH# . . . . . QB1...........FUNCTION . . . . . 11
INCODE% . . . . . QB1...........FUNCTION . . . . . 11
INFLD% . . . . . QB1...........FUNCTION . . . . . 11
INLINE$ . . . . . QB1...........FUNCTION . . . . . 11
JULCV$ . . . . . QB1...........FUNCTION . . . . . 11
JULIAN% . . . . . QB1...........FUNCTION . . . . . 12
KEYIN% . . . . . QB1...........FUNCTION . . . . . 12
KEYSET . . . . . QB1........SUB ROUTINE . . . . . 12
KGRAM# . . . . . QB1...........FUNCTION . . . . . 12
KMETER# . . . . . QB1...........FUNCTION . . . . . 12
LDATE$ . . . . . QB1...........FUNCTION . . . . . 12
LDMENU . . . . . QB1........SUB ROUTINE . . . . . 12
LEAPYR% . . . . . QB1...........FUNCTION . . . . . 12
LITER# . . . . . QB1...........FUNCTION . . . . . 12
LOFM% . . . . . QB1...........FUNCTION . . . . . 13
MENU% . . . . . QB1...........FUNCTION . . . . . 13
METER# . . . . . QB1...........FUNCTION . . . . . 13
MILES# . . . . . QB1...........FUNCTION . . . . . 13
MKFPATH$ . . . . . QB1...........FUNCTION . . . . . 13
MLITER# . . . . . QB1...........FUNCTION . . . . . 13
MON$ . . . . . QB1...........FUNCTION . . . . . 13
MONITOR& . . . . . QB1...........FUNCTION . . . . . 13
MORSE . . . . . QB1........SUB ROUTINE . . . . . 14
MORSESP . . . . . QB1........SUB ROUTINE . . . . . 14
MSG . . . . . QB1........SUB ROUTINE . . . . . 14
NEWDATE$ . . . . . QB1...........FUNCTION . . . . . 14
NUMASC$ . . . . . QB1...........FUNCTION . . . . . 14
NUMPAD$ . . . . . QB1...........FUNCTION . . . . . 14
OBF% . . . . . QB1...........FUNCTION . . . . . 14
OZADP# . . . . . QB1...........FUNCTION . . . . . 14
OZFLD# . . . . . QB1...........FUNCTION . . . . . 15
PADC$ . . . . . QB1...........FUNCTION . . . . . 15
PADL$ . . . . . QB1...........FUNCTION . . . . . 15
PADR$ . . . . . QB1...........FUNCTION . . . . . 15
PATHCK% . . . . . QB1...........FUNCTION . . . . . 15
POUND# . . . . . QB1...........FUNCTION . . . . . 15
PRTCD$ . . . . . QB1...........FUNCTION . . . . . 15
QB1 ROUTINES & FUNCTIONS - Table of Contents iii
════════════════════════════════════════════════════════════════════════════════
PRTDEF . . . . . QB1........SUB ROUTINE . . . . . 16
PRTSC . . . . . QB1........SUB ROUTINE . . . . . 16
REGH% . . . . . QB1...........FUNCTION . . . . . 16
REGL% . . . . . QB1...........FUNCTION . . . . . 16
REGX% . . . . . QB1...........FUNCTION . . . . . 16
REPRT . . . . . QB1........SUB ROUTINE . . . . . 16
ROMAN$ . . . . . QB1...........FUNCTION . . . . . 16
ROUND . . . . . QB1........SUB ROUTINE . . . . . 16
RSF% . . . . . QB1...........FUNCTION . . . . . 16
SCLOAD . . . . . QB1........SUB ROUTINE . . . . . 17
SCOUNT% . . . . . QB1...........FUNCTION . . . . . 17
SCRNX% . . . . . QB1...........FUNCTION . . . . . 17
SCROLL . . . . . QB1........SUB ROUTINE . . . . . 17
SCSAVE . . . . . QB1........SUB ROUTINE . . . . . 17
SDATE$ . . . . . QB1...........FUNCTION . . . . . 17
SETFORM . . . . . QB1........SUB ROUTINE . . . . . 17
SETSCRN . . . . . QB1........SUB ROUTINE . . . . . 18
SETW . . . . . QB1........SUB ROUTINE . . . . . 18
SFM$ . . . . . QB1...........FUNCTION . . . . . 18
SMOD$ . . . . . QB1...........FUNCTION . . . . . 18
SORTA . . . . . QB1........SUB ROUTINE . . . . . 18
SPOT% . . . . . QB1...........FUNCTION . . . . . 19
SPRINT . . . . . QB1........SUB ROUTINE . . . . . 19
STRCHR% . . . . . QB1...........FUNCTION . . . . . 19
SWAPA . . . . . QB1........SUB ROUTINE . . . . . 19
SWAPSCN . . . . . QB1........SUB ROUTINE . . . . . 19
TIMEMATH . . . . . QB1........SUB ROUTINE . . . . . 19
TITLE . . . . . QB1........SUB ROUTINE . . . . . 20
TMCK$ . . . . . QB1...........FUNCTION . . . . . 20
TOFM% . . . . . QB1...........FUNCTION . . . . . 20
UPL$ . . . . . QB1...........FUNCTION . . . . . 20
VPNAM% . . . . . QB1...........FUNCTION . . . . . 20
WDNAM$ . . . . . QB1...........FUNCTION . . . . . 20
WDNUM% . . . . . QB1...........FUNCTION . . . . . 20
WKDAY% . . . . . QB1...........FUNCTION . . . . . 21
WRTFDAT . . . . . QB1........SUB ROUTINE . . . . . 21
WSF% . . . . . QB1...........FUNCTION . . . . . 21
YESNO$ . . . . . QB1...........FUNCTION . . . . . 21
YMD$ . . . . . QB1...........FUNCTION . . . . . 21
YRCK$ . . . . . QB1...........FUNCTION . . . . . 21
YYMMDD$ . . . . . QB1...........FUNCTION . . . . . 21