Dec 082017
 
Deluxe BASIC library - last PD version.
File BASDX172.ZIP from The Programmer’s Corner in
Category BASIC Language
Deluxe BASIC library – last PD version.
File Name File Size Zip Size Zip Type
BASDX172.DOC 90965 22860 deflated
BASDX172.EXE 16889 7316 deflated
BASDX172.LIB 19637 10470 deflated
BASDX172.NEW 1525 807 deflated
BOXDEMO.BAS 720 410 deflated
FILES.DOC 950 527 deflated
FRAMES.TXT 1756 360 deflated
GRIDDEMO.BAS 1067 530 deflated
OBJECT.LIC 8232 2554 deflated
PROBLEM 4861 516 deflated
SOURCE.LIC 9256 2820 deflated
TPCREAD.ME 199 165 deflated

Download File BASDX172.ZIP Here

Contents of the BASDX172.DOC file








BASIC Deluxe Version 1.72 (FINAL) February 1988 1



A Library of routines written in Assembly language for use
with the Microsoft QuickBASIC and IBM BASIC compilers

BASIC Deluxe

To use BASDLX you will need, either the IBM BASIC or the
Microsoft QuickBASIC compiler and PC-DOS/MS-DOS version 2.0+.
These routines have been tested with the IBM BASIC compiler
version 2.0 and QuickBASIC version 3.0 and have caused no
problems. However, the author is not responsible for any damages
caused by but, not limited to, the use, misuse, non-use or
inability to use BASDLX. These routines are intended to be used
in compiled BASIC only. Do not confuse compiled BASIC with the
BASIC interpreter, BASIC.COM or BASICA.COM that comes with DOS or
GWBASIC. The routines provided in this library have been designed
to run faster than any correspondent BASIC code, take up less
space, increase the capabilities of compiled BASIC and simplify
your programs.

Distribution

BASIC Deluxe may be freely distributed to others via any form
available, either electronic, magnetic, mechanical, optical, etc.
as long as no fee or special consideration is charged and all of
the related files to BASDLX are included together in the
unmodified form. With one exception: If it is distributed by
profit or non-profit "software libraries", it can charge no more
than the cost of the diskette and shipping, all of which shall
not exceed $10. It would be a great courtesy if all "software
libraries" that distribute BASDLX would notify the author in
writing of such intent. SOURCE CODE MAY NOT BE DISTRIBUTED.

Copyright

BASIC Deluxe is protected by the U.S. copyright law and its
foreign provisions. If you use BASDLX in your programs you are
required to obtain a license (which is not expensive). An object
code license costs only $40. While a source & object code license
will cost only $60. Once you have purchased and signed a license
agreement for BASDLX, you have full permission to use BASDLX in
commercial and/or private contexts. Licensees will receive a disk
containing the Object and/or Source code (depending on which
license you purchase). Plus a LASER printed and plastic bound
documentation. All corporations either private or public, profit
or non-profit MUST obtain a license regardless.




BASDLX Copyright (C) 1986,1987,1988 By Gustavo H. Verdun





2 BASIC Deluxe Version 1.72 (FINAL) February 1988

BASIC Deluxe is going commercial

You may have noticed the version header saying "Version 1.72
(FINAL)". This is the last release of BASIC Deluxe under the
ShareWare concept. I, together with other partners have been
working hard to create a new and more comprehensive set of
routines for BASIC Deluxe. Thus, making BASIC Deluxe a full
featured competitive library worthy of commercial markets.

The commercial version of BASIC Deluxe, aside from its
competitive low price, will include many more routines to handle
trivial and non-trivial tasks. (All written in Assembly: fast and
compact.)

Some of the features will include:

Menu routines similar to QuickBASIC and Lotus.

A filer or list, routine that allows the user to see, point,
and select or tag an item or items from the list of choices.
FILER produces a display similar to the file window in
QuickBASIC.

A complete DOS interface routine that allows you to have
complete control over DOS.

A version of GETSTRD but for multi-gets that allows you
design an entire screen full of fields and let mgets worry
about movement from field to field (the movement may be done
both dynamically and fixed, instead of just fixed like other
software (dBASE, Clipper) so, down really moves down and not
the next field in the order.)

BASIC Deluxe will also feature a full set of windowing
routines to manage all windowing trivials.

All input enhancement routines will support the mouse and will
automatically call the KEYSTATS routine to update the key toggles
prompt (if active.) This will make the key status `live' and up
to date making your programs feel, look and behave
professionally.

There are so many features that BASIC Deluxe will offer that this
short summary could not possibly do it justice. Please feel free
to write and inquire for a complete brochure on BASIC Deluxe.






BASDLX Copyright (C) 1986,1987,1988 By Gustavo H. Verdun





BASIC Deluxe Version 1.72 (FINAL) February 1988 3

Limited Special Offer

Everyone who purchases a license to BASIC Deluxe version 1.7
before March 31st, 1988 will receive an exclusive, non-
transferrable $15 rebate coupon valid towards the purchase of the
commercial version of BASIC Deluxe ( Scheduled to be released by
mid-1988 ). Limit one per customer. Not valid (rebate) with any
other offers. Void where prohibited by law.

If you like BASDLX now, you will love the new one even better,
guaranteed or your money back!

Delay of the Commercial Version of BASIC Deluxe

Due to a number of new ideas, latest compiler versions, and a
busy schedule the commercial version of the BASIC Deluxe library
will not be available until mid-1988. Thank you for your
patience. I have extended the rebate offer until the end of March
of 1988.

Trademarks and Registered Trademarks

Microsoft & MS-DOS are registered trademarks of Microsoft
Corporation. IBM, XT, AT are a registered trademarks of
International Business Machines Corporation. dBASE is a
registered trademark of Ashton Tate. Clipper is a trademark of
Nantucket Corporation. Lotus 1-2-3 is a registered Trademark of
Lotus Development Corporation.

BASIC Deluxe is a trademark of Gustavo H. Verdun

What you get when you purchase your license for BASIC Deluxe

o A LASER printed documentation.
o $15 Rebate coupon valid towards the purchase of the
commercial version.
o Complete Object Code to build your own libraries.
( And Source Code if you purchase a Source Code
License.)
o A Library utility to simplify the creation and
management of your user libraries.
o Telephone support.

Birthday!

No, It's not BASIC Deluxe's Birthday (not until November 11th)
but, it is my birthday and I just turned 20. So: "Happy Birthday
to ME!" The age is no lie, honest! ( I'm enjoying my young age
while I can because it's not going to last for ever. )


BASDLX Copyright (C) 1986,1987,1988 By Gustavo H. Verdun





4 BASIC Deluxe Version 1.72 (FINAL) February 1988

A Serious Reminder

For those of you who use BASIC Deluxe and have not yet purchased
a license, shame on you. For those who have, God bless and
encourage others to do the same. I urge you to act according to
the rules. If you use BASIC Deluxe, please pay for it. If not,
give it to someone who will. I'm not concerned as much for the
computer hobbyists as I am for the computer professionals that
use BASIC Deluxe. Professionals, please make yourselves look
good and respectable. We are all in this business together, so
please help make it work! I have every confidence in all of you
and I trust that you understand and abide by the concept that
brings BASIC Deluxe to you! If you use it you must support it!
Thank you, in advance, for your cooperation.

Using BASDLX with the IBM BASIC Compiler
These routines have been incorporated into a library to make them
easily accessible by the LINK.EXE program. All you have to do is
copy BASDLX.LIB to the directory or disk where you keep your
library files. When you link your programs that use routines
from BASDLX, be sure to specify: BASDLX when the linker prompts
you for a Library [.LIB] file(s). Please refer to your DOS manual
for more information on the LINK.EXE program.

Using BASDLX with the Microsoft QuickBASIC Compiler
The BASIC Deluxe library can be used with QuickBASIC by using
BASDLX.EXE library file. Please read your QuickBASIC user manual
for more information on User Libraries. (QB Page 133)

Note: If you need to get a copy of the object code then, send $5
and I'll mail you a disk with the object code to BASDLX version
1.7. Please keep in mind that this is provided only to allow you
to further review the BASDLX library. If you later decide to
purchase a license, your $5 will be credited towards it.

Attention QuickBASIC 3.0 Users
If you need to create a stand alone program using QuickBASIC with
the compile to BCOM30 option, do not use the programming
environment; It has a bug in it! Use the compile from command
line option instead. See page 71 of any QB manual for more
information about QB compile options.
QB program_name /O;
the ";" is a must. It instructs the compiler to use the command
line processor instead of the development environment.

For those who have QuickBASIC 4.0
I have received my update of QB to 4.0 from Microsoft and am
currently updating the routines in to work in the development
environment. I will release them soon.


BASDLX Copyright (C) 1986,1987,1988 By Gustavo H. Verdun





BASIC Deluxe Version 1.72 (FINAL) February 1988 5

Special Notes

The routines provided in this library are available to you by
using the CALL command from compiled BASIC. All numeric variables
passed as arguments to the routines must defined as integers.
This means that you can either globally set all numeric variables
to integers by issuing the DEFINT A-Z command at the beginning of
your program or, you can declare a single variable as integer by
adding a "%" symbol at the end of its name. (i.e. I%)

The variable names used in the examples don't have to be exactly
the same. You may choose other names that would be more ap-
propriate. Keep in mind that the variable types do have to be the
same in the argument list (i.e. strings must be strings, integers
must be integers).

Special Conventions

You may find in the argument list some arguments that are
enclosed in []'s. This is used to indicate that the value for the
argument can be safely entered directly instead of requiring you
to set it to variable. For example: CALL GUN(10) or CALL
GUN(5+5): are both perfectly legal ways to `call' the GUN
routine; Either form will "fire" the gun 10 times. Not all of the
variables in BASDLX may be entered in this way because BASIC
stores the value in a temporary location and immediately upon
return BASIC destroys them, and BASDLX sometimes returns vital
information in that variable.

Any Problems?

These routines have been thoroughly tested and appear to be free
of all bugs. However, if you happen to find any I'll be more than
happy to fix them. Be sure to check that you are CALLing the
routines properly. That is that you are sending the correct
arguments to the routine. One of the most common error that
occurs is when the calling program sends to the routine an
incorrect variable type. Remember that numeric variables must be
declared integer.

Please refer any questions, comments, requests for new routines
or License purchases to the following address:

Gustavo H. Verdun
BASDLX V1.7
6424 Hollins Drive
Bethesda, MD 20817




BASDLX Copyright (C) 1986,1987,1988 By Gustavo H. Verdun





6 BASIC Deluxe Version 1.72 (FINAL) February 1988

Routine Name : ALLDIRS
Arguments : ( Dir.Array$([start%]), Maxdirs%, [Drive$],
Ercd% )
Type : DOS/System
Purpose : Searches and returns all of the available
directory paths of the specified drive in an
array.
Description :

Dir.Array$([Start%]), This is where the directory names found
will be saved. Each element in this ONE dimensional array must be
set to some length. ALLDIRS is not very picky about the minimum
length but if it ever finds a directory path that will not fit in
the space provided it will stop and return with an `out of string
space condition'. DOS limits the maximum length of any directory
path to 64 characters including the drive specifier (i.e. C:),
slashes and string terminator (ASCII 0) So, you will never need
more than a string length of 64 characters per element.

Maxdirs%, tells ALLDIRS the number of elements in
Dir.Array$([Start%]). If ALLDIRS finds more directories than
space is provided then ALLDIRS stops and returns with a `Out of
string space condition'. Upon return from ALLDIRS, Maxdirs%= the
number of directories found.

[Drive$], Specifies the drive to search. The first character in
this string must specify the drive letter all other characters,
if any, are ignored. (ALLDIRS will NOT convert the drive letter
to upper case, you may have to do it separately if it is
important.)

Ercd%, 0 then everything is fine. An error code of -1 = Drive
selected is not valid. -2 = Out of String space.

Example:
DIM dir.array$(50)
FOR i=0 TO 50 : dir$(i)=SPACE$(64) : NEXT
d$="C:" : ercd%=0 : max%=51
CALL AllDirs(dir.array$(0),max%,d$,ercd%)
IF ercd% THEN PRINT "Error :";ercd%
PRINT "Directories found:"
FOR i = 0 TO max% : PRINT dir$(i) : NEXT









BASDLX Copyright (C) 1986,1987,1988 By Gustavo H. Verdun





BASIC Deluxe Version 1.72 (FINAL) February 1988 7

Routine Name : ALLDRIVES
Arguments : ( Number_of_drives% )
Type : DOS/System
Purpose : Returns the total number of logical drives
(Diskette, Fixed, Ram, Etc.) Available.
Description :

This routine will return a minimum of 2 Drives, since any com-
puter is assumed to have the logical drives A: & B: Even if there
is only one physical drive.

Example:

drvs%=0 : CALL AllDrives(drives%)
PRINT "You have ";drives%;" drives available."


Routine Name : ALLFILES
Arguments : ( [Search$], [File_attribute%],
Dir$([Start%]), Max_elements%, Error_code% )
Type : DOS/System
Purpose : Scans drive and returns the specified files
in a string array.
Description :

Search$ specifies the search pattern. if Search$ = "" then the
default "*.*" pattern is used (without the quotes). The search
pattern may contain a drive letter, path, filename and extension.
The * and ? wild cards are accepted. The Search$ must end with an
ASCII 0 character.

File_attribute% specifies the attribute of the files to be
searched for. See: "File Attributes" at the end of this documen-
tation for a detailed explanation.

Dir$([Strt%]) is a one-dimentional array that will contain the
new directory. The [Strt%] parameter is the element number where
the first entry will be stored. All subsequent entries will be
entered in the following elements of the array. Make sure that
every element in the string array is of a minimum length of 12.

Max_elements%, is used to tell the ALLFILES the size of the array
in elements. Upon return from ALLFILES this variable will contain
the number of files found.







BASDLX Copyright (C) 1986,1987,1988 By Gustavo H. Verdun





8 BASIC Deluxe Version 1.72 (FINAL) February 1988

Routine Name : ALLFILES (Continued)

Ercd% is used to return an error, if any. If Ercd%=0 then no
errors have occurred. (Note: A files not found status is recorded
by Max_elements% = 0.)

-1 Bad DOS Version
-2 Out of string space (Either the elements in dir$() are not
set to the minimum string length of 12 or not enough
elements.)


Example :

OPTION BASE 0
DIM dir$(100)
search$="" : attr%=0 : files%=101 ' since option base 1
CALL AllFiles(search$,attr%,dir$(0),files%,ercd%)
IF ercd% THEN PRINT "Directory size exceeded program limits":END
FOR i% = 0 TO files%-1 : PRINT dir$(i%) : NEXT
































BASDLX Copyright (C) 1986,1987,1988 By Gustavo H. Verdun





BASIC Deluxe Version 1.72 (FINAL) February 1988 9

Routine Name : BOX (Argument Order Change. Please Note)
Arguments : ( [Height%], [Width%], [FRAME$], [Color%],
[Mode%] )
Type : Screen/Video
Purpose : Draws a box using the supplied arguments.
Description :

( Author's Note: the arguments order ( [Height%], [Width%] ) were
reversed to maintain a similarity to the Row, Column format that
BASIC uses. Since height refers to the number of rows...)

[Height%], [Width%] : All dimensions are internal.

BOX uses the current cursor location as the top right corner
(frame) of the box.

[FRAME$] Specifies the frame characters. It uses the format
similar to GRID's without all the `T's and `+'.

Character Position Description
----------------------------------------------------------------
Top lines
1 Top left corner
2 Top horizontal
3 Top right corner

Middle lines
4 Left vertical
5 BOX fill character
6 Right vertical

Bottom line
7 Bottom left corner
8 Bottom horizontal
9 Bottom right corner
-----------------------------------------------------------------
[Color%], here, you may specify the color attribute that BOX will
use. The formula for the color value is as follows: Color% =
(BACKGROUND and 7) * 16 + FOREGROUND












BASDLX Copyright (C) 1986,1987,1988 By Gustavo H. Verdun





10 BASIC Deluxe Version 1.72 (FINAL) February 1988

Routine Name : BOX (continued)

[Mode%]:

0 No Grow, `Boxes' pop on screen.
1 Grow from center out.
2 Grow from top right to bottom left
3 Grow from top left to bottom right.
4 Grow from bottom Left to top right.
5 Grow from bottom Right to top left.
6 Grow from top to bottom.
7 Grow from bottom to top.
8 Grow from left to right.
9 Grow from right to left.

Example:

LOCATE 1,1
CALL Box (78,23,FRAME$,7,1)
'rem this will draw a box around the entire screen.


Routine Name : BSORTN (Improved this Version)
Arguments : ( Num_of_elements, Integer_array%(start),
[Order%] )
Type : integer array service
Purpose : Sorts an integer array in ascending order
with negative numbers appearing at the end
in ascending order.
Description :

Integer variables in BASIC can contain numbers between -32,768
and 32,767. This routine does not distinguish between negative or
positive numbers. It will sort the elements in ascending order
with all the negative numbers (if existing) appearing after the
positive numbers in ascending order. Make sure that the array is
of type integer. Unpredictable results may occur if not!

[Order%], if 0 will specify descending order, any other number
will produce ascending order.

Example:
DIM a%(300) : PRINT "Array Before sort:"
FOR i% = 0 TO 300 : a%(i%) = INT(RND(1)*30000)
PRINT a%(i%), : NEXT
enum%=301 : CALL BsortN(enum%,a%(0),1)
' enum%=301 because there are 301 elements in the array (0-300)
PRINT "Array After sort:"
FOR i% = 0 TO 300 : PRINT a%(i%), : NEXT
' the list should be sorted in ascending numerical order!

BASDLX Copyright (C) 1986,1987,1988 By Gustavo H. Verdun





BASIC Deluxe Version 1.72 (FINAL) February 1988 11

Routine Name : BSORTS (Improved this version)
Arguments : ( [Number_of_elements%], Array$(start%),
[Order%] )
Type : String array service
Purpose : Sorts a string array in ascending/descending
alphabetical order.
Description :

The first argument should contain the number of elements to sort
in the array. The second argument is the array itself. be sure to
specify the starting position in the array [i.e. CALL BSORTS
(elements%, a$(0)),1)

IMPORTANT: All of the elements in the array MUST have equal
lengths, if not, unpredictable results will occur to BASIC.

[Order%], if 0 it will be in descending alphabetical order. Any
other value will sort in ascending order.

Example:
DIM a$(10)
a$(0)="First" : a$(1)="Second" : a$(2)="Third" : a$(3)="Fourth"
a$(4)="Fifth" : a$(5)="Sixth" : a$(6)="Seventh" : a$(7)="Eighth"
a$(8)="Ninth" : a$(9)="Tenth"
FOR i%=0 TO 9 : b$=SPACE$(10) : CALL setl(a$(i%),b$)
a$(i%)=b$ : NEXT
' the above line will make all of the elements in the array
' have equal lengths.
PRINT "Array before sort:"
FOR i%=0 TO 9 : PRINT a$(i%) : NEXT
enum%=10 : CALL bsorts(enum%,a$(0),1)
' enum%=10 because there are 10 elements in the array (0-9)
PRINT "Array After sort:"
FOR i%=0 TO 9 : PRINT a$(i%) : NEXT
' the list should be sorted in ascending alphabetical order!


Routine Name : CASESTR
Arguments : (string_var$,[case_val%])
Type : String service
Purpose : Converts string to defined case.
Description :

case_val%, 0 = Convert string to lower case. 1 = Convert string
to upper case, 2 = Swap case (All upper case characters
will be converted to lower case and vice-versa.)

Example:
a$="this will be in caps":case%=1:call case(a$,case%)
print a$

BASDLX Copyright (C) 1986,1987,1988 By Gustavo H. Verdun





12 BASIC Deluxe Version 1.72 (FINAL) February 1988

Routine Name : CASERANGE
Arguments : ( String$, [Start%], [Length%], [Case%] )
Type : String service
Purpose : Converts a portion of a string to defined
case.
Description :

case_val%, is the parameter that specifies what case to convert
to.

0 Convert string to lower case.
1 Convert string to upper case,
2 Swap case (All upper case characters will be converted
to lower case and vice-versa.)

Example:
a$="the word `caps' will be in upper case :caps"
casev%=1:call case(a$,40,4,casev1%):print a$


Routine Name : CNFKEYS
Arguments : ( [Row%], [Column%], [String$], [Scolor%],
[Ifillchar%], [Bcolor%], [KeyCode%] )
Type : Configuration for KEYSTATS
Purpose : Change default settings for each individual
toggle key.
Description :

[Row%], [Column%] specify the location where to write and clear
the toggle key. If [Row%] is -1 then the routine will disable the
trapping of this key (i.e. It may show others when called by
KEYSTATS but not this one.)

[String$], [Scolor%] specify the text to display when the key
toggle is active and the color to write it in. If you place a -1
for the [String$] argument, it will leave the current defined
string untouched.

[Ifillchar%], [Icolor%] specify the ASCII code for the fill
character used to clear the section of the screen when the key
toggle is inactive and the color for this write.










BASDLX Copyright (C) 1986,1987,1988 By Gustavo H. Verdun





BASIC Deluxe Version 1.72 (FINAL) February 1988 13

Routine Name : CNFKEYS (Continued)

[KeyCode%] specifies the key to which the above information apply
to.

[KeyCode%] key Default: text Color Row,Col
-----------------------------------------------------------------
1 Insert " INSERT " 7 1,1
2 Caps " CAPS " 7 1,9
3 Numbers " NUM " 7 1,15
4 Scroll " SCROLL " 7 1,20
-----------------------------------------------------------------
All of the keys have the default [IFillChar%] of ASCII 32 (space)
and [Icolor%] of 7.

Example:

CALL CnfKeys( 1,40,"",7,32,7,1) ' change insert
CALL CnfKeys(-1,0,"",0,0,0,2) ' disable Caps
CALL CnfKeys(-1,0,"",0,0,0,3) ' disable Number
CALL CnfKeys(-1,0,"",0,0,0,4) ' disable Scroll


Routine Name : CNFGSD (Improved this Version)
Arguments : ([overwrite%], [insert%], [frame%], [tab%],
[Delimiters$])
Type : Configuration for GETSTRD
Purpose : Change default settings for GETSTRD.
Description :

[Overwrite%] & [Insert%], (Default is full & half size cursor
respectively) These two arguments contain the cursor shapes that
indicate if overwrite or insert is active. The formula for the
values that must be stored in these two arguments is as follows:
=(START and 31)*256+STOP Where START & STOP are the values for
cursor start & stop scan lines which must be in the range of 0-
31. (See the BASIC LOCATE command for more information on cursor
shapes.) NOTE: a value of zero for these options leaves their
current defaults in effect.

[Frame%], (Default ASCII 95) This argument contains the ASCII
code for the frame character. GETSTRD draws a one line frame of
the length of String$ to let you see the field size. A value of
zero for this option leaves its current default in effect.

[Tab%], (Default 1) Number of spaces to insert for a [TAB] key.
Valid number is in the range of 0-10. A value above 10 leaves the
current default unchanged.



BASDLX Copyright (C) 1986,1987,1988 By Gustavo H. Verdun





14 BASIC Deluxe Version 1.72 (FINAL) February 1988

Routine Name : CNFGSD (Continued)

[Delimiters%] is a two character string that specify the left and
right delimiter characters. The default is "[]" if you enter a
null string (i.e. "" ) here, will leave current defaults
unchanged. These delimiters will be displayed only when you
activate them via the GETSTRD mode argument. (2)

Example:
oc%=(0 and 31)*256+7:ic%=(5 and 31)*256+7
'this is here to show the values of the default cursors.
ic%=0: oc%=0 : frame%=177 : tab%=0
call cnfgsd(ic%, oc%, frame%, tab%,"::")

-In this example: Insert & overwrite cursor values are unchanged.
Frame character is set to ASCII 177. [TAB] key will insert 0
spaces in string (disables [TAB] key). NOTE: If ASCII 32 (space)
is not a valid key in GETSTRD then [TAB] does nothing. The
delimiters have been changed to two colons.


Routine Name : DATESTR
Arguments : ( String$, Length%, [Mode%] )
Type : Date support
Purpose : Reads the date and writes string_space$
with the date in the following format:
week-day month day, year. (i.e. Thursday,
March 12, 1987)
Description :

The first argument, String_space$, must be of at least 30
characters of length. If Length% returns with a zero then there
wasn't enough space in the string variable String_space$. The
Mode% argument tells the routine to either write the full name of
the week-day and month or just the first three letters of
each. If Mode%=0, or any number other than one, then the full
names of the week-day and month will be written. If Mode%=1 then
only the first three characters of the week-day and month will be

written. The Length% argument is used to tell BASIC the true and
final length of String_space$ (This way you easily get rid of the
trailing characters after the year since, the actual length of
String_space$ will vary greatly depending on the date.)
NOTE: String_space$ will never be any longer than 30 characters
of length.






BASDLX Copyright (C) 1986,1987,1988 By Gustavo H. Verdun





BASIC Deluxe Version 1.72 (FINAL) February 1988 15

Routine Name : DATESTR (Continued)

Example:
D$=space$(30):l%=0:mode%=0:call datestr(d$,l%,mode%)
if l%=0 then print "Not enough space in D$!":stop
d$=left(d$,l%):print "Today is ";d$
D$=space$(30):l%=0:mode%=1:call datestr(d$,l%,mode%)
if l%=0 then print "Not enough space in D$!":stop
d$=left(d$,l%):print "Today is ";d$


Routine Name : DLXMOUSE
Arguments : ( Buttons% )
Type : Mouse support
Purpose : Resets mouse and returns the number of
buttons.
Description :

This routine performs three tasks. First, it checks to see if the
mouse is installed by attempting to reset it. If mouse is not
available then buttons% = 0 otherwise it will return the number
of available buttons. Second, depending if mouse is available, it
sets an internal `switch' used, internally, by BASDLX routines to
tell if mouse should be supported. Third, if you set buttons% =
-1 before calling the routine it will automatically `lock-out'
the use of the mouse by any routine in BASDLX. (one may override
a forced lock-out or force a mouse reset from the keyboard by
pressing the [Ctrl]-[Backspace] keys together while inside of a
BASDLX routine that supports a mouse.

Example:
call dlxmouse(b%)
print "You have ";b%;"mouse buttons available."


















BASDLX Copyright (C) 1986,1987,1988 By Gustavo H. Verdun





16 BASIC Deluxe Version 1.72 (FINAL) February 1988

Routine Name : GETKSTATS
Arguments : ( Toggle%, Status% )
Type : Keyboard
Purpose : Checks the toggle key and returns its status.
Description :

Toggle% is the a value from 1 to 4 which refers to the toggle key
code. (SEE KEYSTATS for the Toggle% code)

Status%, returned by GETKSTATS if 0 then the toggle key is
inactive. -1 if active.

Example:

CALL GetKstats( 1, Insert% )
IF Insert% THEN PRINT "Insert is active."



































BASDLX Copyright (C) 1986,1987,1988 By Gustavo H. Verdun





BASIC Deluxe Version 1.72 (FINAL) February 1988 17

Routine Name : GETSTRD (Radically Improved in this Version)
Arguments : ( String$, Length%, Picture$, Pointer%,
Color%, Mode% )
Type : String/Data entry enhancement
Purpose : This routine accepts input from the keyboard
and stores it in the String$ argument
allowing the use of standard editing
commands.
Description :

( Author's Note: To say `Improved' would be an understatement.
This FINAL revision of the GETSTRD routine closes the evolution
process that I wished for it. I always intended for GETSTRD to
offer what it now does: The input validation of GETSTRD has been
radically changed. You can now give GETSTRD a complete PICTURE of
what you want to be entered and how it should look! And it even
handles numbers like a pro! )

String$, This is the space where the input data will be stored.
The field size of the input data will be set to the length of
this string. If there is already some data in the string it will
not be erased. Just be sure to set the Length% to the proper
value to let GETSTRD know that there is already data in the
String$ variable that is ready to be edited. Due to the
limitations that BASIC imposes on assembly language with
variables, the String$ variable must be filled in to the maximum
size of the field.

Length%, If you have a string length that is shorter than the
field size that you have allocated for the data, GETSTRD will be
able to know and upon return tell you the actual length of the
string. This makes it easy to remove the trailing spaces in the
String$ if they are not important. A Length% of zero tells
GETSTRD that it is a `fresh' data field containing no previous
input.

Picture$, This string defines the picture of the field you wish
to input. BEFORE CALLING GETSTRD YOU *MUST* FIRST PASS THIS
STRING THROUGH THE MAKEPICTURE ROUTINE. MAKEPICTURE WILL COMPRESS
THE Picture$ AND TURN ALL THE FUNCTIONS YOU DEFINED TO AN
INTERNAL CODING METHOD. A sample Picture$ could be : "@K (999)-
999-9999" This is what a Picture$ would look like to define a
field for entering a telephone number. Please SEE SECTION:
"Defining Data Field Pictures" at the end of this documentation
for details on functions and template symbols. A Picture$ may not
be of null length. However, the following is valid : Picture$ =
" ". There must always be at least a space in the Picture$. This
definition will define `X' as the valid characters allowed in
each position of the field. (If the @N (i.e. Picture$ = "@N ")
Function is used then the default template is `9'.)

BASDLX Copyright (C) 1986,1987,1988 By Gustavo H. Verdun





18 BASIC Deluxe Version 1.72 (FINAL) February 1988

Routine Name : GETSTRD (Continued)

[Pointer%], On entry, the value of this argument will be the
active offset from which the cursor will be placed. To place the
cursor at the end of the string then, set this value to zero.
Upon exit this argument will contain the last position offset of
the cursor. 1 = the first character in the string.

Color%, here, you may specify the color attribute that GETSTRD
will use. The formula for the color value is as follows:
Color%=(BACKGROUND and 7)*16+FOREGROUND

Mode%, This and the Color% arguments are used by GETSTRD to
define and return codes to and from the routine. The Mode%
argument is a bit based value, in other words each bit in the
value represents a special function. The following table
identifies the each function code and its corresponding function.

Code Function
-----------------------------------------------------------------
1 Exit on extended key. This will force
and exit if any non-editing key is hit.
2 Use Delimiters.
4 Quit. GETSTRD will display everything
and exit.
8 Mouse Exit. This will exit if the mouse
was clicked over an area outside the
input field.
-----------------------------------------------------------------
How Mode% works

A value of zero would result in GETSTRD to ignore all extended
keys, not use delimiters and, ignore the mouse if clicked outside
the field. If you wanted the program to use delimiters and exit
on extended keys the proper mode% would be : 1 + 2 = 3. It's as
simple as adding the codes together. (Just like you add the
status bits for each type of file attribute characteristic in
DOS.)

Mode% upon return from GETSTRD

Mode% Significance
-----------------------------------------------------------------
0 Normal. User pressed Return.

-1 That a normal exit key has been pressed.
The ASCII code of this key will be
returned in Color% (i.e. [ESC] would
look like Mode% = -1 and Color% = 27 )


BASDLX Copyright (C) 1986,1987,1988 By Gustavo H. Verdun





BASIC Deluxe Version 1.72 (FINAL) February 1988 19

Routine Name : GETSTRD (Continued)

-2 An extended exit key has been pressed.
The extended code is in Color%. (i.e.
[PgUp] would look like: Mode% = -2 and
Color$ = 73 )

-3 GETSTRD has encountered and error it
cannot continue. Color% will return the
error code value:

1 Not Text mode GETSTRD cannot
work in a graphics mode.
2 The length of String$ is zero.
GETSTRD has no room to work
with.
3 Picture function not
supported.

non-zero GETSTRD is returning due to a mouse
exit. Mode% = Column and Color% = Row of
where button was clicked. (You will have
to call MBUTTONM to get the status of
the button and which one it is.)
-----------------------------------------------------------------
The following Editing keys are supported:

[LEFT-ARROW] Move cursor one space left.
[RIGHT-ARROW] Move cursor one space right.
[HOME] Move cursor to beginning of line.
[END] Move cursor to the end of field.

( NOTE: The end of the field is determined by the current length
of the input data and not the maximum length of the data field. )

[CTRL]-[RIGHT-ARROW] Move cursor one word right.
[CTRL]-[LEFT-ARROW] Move cursor one word left.
[CTRL]-[HOME] Erase entire input field.
[CTRL]-[END] Erase from cursor position to the end of
the line.
[CTRL]-[BACKSPACE] Forces a mouse reset.

( SEE ALSO DLXMOUSE AND MOUSE NOTES at the end off this
documentation. )

[INS] Set/Clear Insert mode.
[DEL] Deletes character at cursor position.
[BACKSPACE] Deletes character to the left of cursor.
[TAB] Inserts x spaces. (See also CNFGSD)


BASDLX Copyright (C) 1986,1987,1988 By Gustavo H. Verdun





20 BASIC Deluxe Version 1.72 (FINAL) February 1988

Routine Name : GETSTRD (Continued)

GETSTRD supports the mouse as a pointing device. Press ANY of the
mouse buttons and if the mouse is over a valid location in the
field, the cursor will be moved to it. The mouse cursor is now
constantly visible.

Example:

10 ' This example is for mode 0.
12 Mode% = 0 : Attr% = 0
14 A$="" : P$=" (999)-999-9999" ' Picture for phone #.
15 CALL MakePicture(P$,L%,0) 'Throw away error code!
16 P$ = LEFT$(P$,L%) : L% = LEN(A$) : B$=SPACE$(14)
17 CALL SetL(a$,b$) : a$=b$ : PRINT "Enter Phone #";
22 CALL Getstrd(A$,L%,P$,C%,Mode%)
24 A$=LEFT$(A$,L%) : IF Mode%=-1 THEN 18

10 ' This example is for mode 1.
12 Mode%=1 : C%=31 : A$=""
18 L%=LEN(A$) : B$=SPACE$(25) : CALL SetL(A$,B$) : A$ = B$
20 LOCATE 10,5 : PRINT "Enter Name : ";
21 P1$="@K AAAAAAAAAAAAAAAAAAAAAAAAA"
22 CALL MakePicture(P1$,L%,0) : P1$ = LEFT$(P1$,L%)
23 CALL Getstrd(A$,L%,P1$,C%,Mode%)
24 A$ = LEFT$(A$,L%) : IF Mode% = -1 THEN 36
26 L% = LEN(C$) : B$=SPACE$(15) : CALL SetL(C$,B$) : C$ = B$
28 LOCATE 11,5 : PRINT "Enter Phone # ";
29 P$="@K (999)-999-9999" : CALL MakePicture(P$,L%,0)
30 CALL Getstrd(C$,L%,P$,C%,Mode%)
32 A$ = LEFT$(C$,L%) : IF Mode% = -1 THEN 36
34 IF Mode%=72 OR Mode%=80 THEN 18
36 PRINT "Data A: ";A$ : PRINT "Data B: ";C$ : END


















BASDLX Copyright (C) 1986,1987,1988 By Gustavo H. Verdun





BASIC Deluxe Version 1.72 (FINAL) February 1988 21

Routine Name : GLISSANDO
Arguments : ( [Start.Frequency%], [Stop.Frequency%] )
Type : Sound
Purpose : Generates a glissando sound from the starting
frequency to the stopping frequency.
Description :

[Start.Frequency%], [Stop.Frequency%] specify the frequencies.
the routines will determine whether to go up or down in
frequency.

Example:

CALL Glissando (950,650)
' Will produce a sound similar to SideKick(R) of Borland Intl.)
CALL Glissando (-1,15)
' This will produce a glissando from the top frequency to the
lowest (you won't hear it 'till about -32767 but, your pets
might.)
































BASDLX Copyright (C) 1986,1987,1988 By Gustavo H. Verdun





22 BASIC Deluxe Version 1.72 (FINAL) February 1988

Routine Name : GRID (Arguments changed, please note)
Arguments : ( Rows%(start%), Columns%(start2%), [FRAME$],
[Color%], [Mode%] )
Type : Video
Purpose : Draws the specified grid on the screen.
Description :

Author's Note: The order of the arrays was changed (in reference
to the argument list) to make GRID consistent with the BASIC
LOCATE command which works in a Row, Column order.

Rows%(Start%), This array specifies the heights of the Y
(Vertical) range of the grid. Each element in this array contains
the cell Height of its corresponding row. All the cells in a row
will have the same cell height. The last element in this array
must be a -1.

Columns%(start2%), This array specifies the widths of the X
(Horizontal) range of the grid. Each element in this array
contains the cell width of its corresponding column. All cells in
a column will have the same cell width. The last element in the
array must be a -1.

Note: A Cell height or width of 0 (zero) is valid. Cell heights
and widths are internal dimensions.


























BASDLX Copyright (C) 1986,1987,1988 By Gustavo H. Verdun





BASIC Deluxe Version 1.72 (FINAL) February 1988 23

Routine Name : GRID (Continued)

[FRAME$] This is the string that specifies the frame characters
for the grid, The string consists of the following characters:

Character Placement
-----------------------------------------------------------------
Top line

1 Top left corner
2 Top horizontal
3 Top `T'
4 Top right corner

Cell lines

5 Left vertical
6 Fill character
7 inner vertical
8 Right vertical

Cell separator

9 Left `T'
10 Inner Horizontal
11 Inner `+'
12 Right `T'

Bottom line

13 Bottom left corner
14 Bottom horizontal
15 Bottom `T'
16 Bottom right corner
-----------------------------------------------------------------
[Mode%], This argument specifies the grow mode to use. Grow modes
are as follows:

0 No grow.
1 Grow from the center of the grid.
2 Grow from the top right corner.
3 Grow from the top left corner.
4 Grow from the bottom left corner.
5 Grow from the bottom right corner.

[Color%], here, you may specify the color attribute that GRID
will use. The formula for the color value is as follows: color% =
(BACKGROUND and 7) * 16 + FOREGROUND.



BASDLX Copyright (C) 1986,1987,1988 By Gustavo H. Verdun





24 BASIC Deluxe Version 1.72 (FINAL) February 1988

Routine Name : GRID (Continued)

The grid's top left corner will be at the current location of the
cursor. Use the LOCATE command to set the location of the grid.

Example:
option base 1
' the option base of 1 is not necessary you
' may use option base 0 if you like but, remember to adjust
' the starting of the array. (strt)
'
DIM R%(4),C%(5)
C%(1)=20:C%(2)=20:C%(3)=20:C%(4)=-1 ' Last element MUST be a -1
R%(1)=1 : R%(2)=1 : R%(3)=1 : R%(4)=0 : R%(5)=-1
Attr%=7 : Mode%=1
CALL Grid(R%(1),C%(1),FRAME$,Attr$,Mode%)


Routine Name : GRIDSPAN
Arguments : ( Axis%(start%), Span% )
Type : BASDLX GRID support
Purpose : Determines the length, from end to end, of
the given axis of the grid.
Description :

Axis%(start%) is a one-dimentional array as specified in the
documentation for the GRID routine. This array can be of the X
(horizontal) or Y (vertical) axis of the grid.

Span% is the value returned by GRIDSPAN. It represents the span
of the supplied axis in characters.

Example:

DIM R%(5),C%(4)
FOR I=1 TO 4 : R%(I)= 1 : NEXT : r%(5)=-1
FOR I=1 TO 3 : C%(I)=20 : NEXT : c%(4)=-1
CALL GridSpan(R%(1),Height%) : PRINT "Grid height is ";Height%
CALL GridSpan(C%(1),Width%) : PRINT "Grid width is ";Width%
Attr% = 7: Mode% = 1 : CALL Grid(C%(1),C%(1),FRAME$,Attr%,Mode%)











BASDLX Copyright (C) 1986,1987,1988 By Gustavo H. Verdun





BASIC Deluxe Version 1.72 (FINAL) February 1988 25

Routine Name : GUN
Arguments : ( [Number_of_shots%] )
Type : Speaker support
Purpose : Simulates the sound of a gun or machine gun
Description :

This routine generates the sound by sending spurts of white noise
to the speaker. This will create the sound of a quick explosion.
The only parameter needed is the number of shots to fire.

Example:
INPUT "Number of shots to fire :",shots%
CALL Gun(shots%)


Routine Name : JRCLICK
Arguments : ( [Value%] )
Type : PCjr BIOS support.
Purpose : Activates/deactivates the keyboard click
on the PCjr.
Description :

Value%, if 0 it turns the keyboard click off. Any other value
will activate the keyboard click. This works only on the PCjr.

Example :

CALL Jrclick(0) 'rem deactivate the keyboard click
Val%=1:CALL Jrclick(Val%) 'rem activate the keyboard click






















BASDLX Copyright (C) 1986,1987,1988 By Gustavo H. Verdun





26 BASIC Deluxe Version 1.72 (FINAL) February 1988

Routine Name : KEYORDER
Arguments : ( [Row%], [Column%], [First%], [Second%],
[Third%], [Last%], [Spread%] )
Type : BASDLX KEYSTATS service.
Purpose : Helps simplify the positioning of the
`toggle' key prompts for use by KEYSTATS.
Description :

[Row%], [Column%] specifies the starting row and column.

[First%], [Second%], [Third%], [Last%] each contain the key code
value that specify which key comes first, second... If any of
these arguments contain zero, KEYORDER will stop on that
argument.
SEE CNFKEYS for the table key codes.

[Spread%] specifies the number of columns to leave between each
prompt.

KEYORDER will then use the above data and adjust the Row, Column
for each individual prompt to it's corresponding new location.

Example:

CALL KeyOrder(25,51,2,3,4,1,0)
' will place the default prompt at the lower right corner of the
' screen. (" CAPS NUM SCROLL INSERT ")
























BASDLX Copyright (C) 1986,1987,1988 By Gustavo H. Verdun





BASIC Deluxe Version 1.72 (FINAL) February 1988 27

Routine Name : KEYSTATS
Arguments : ( [Mode%] )
Type : Keyboard
Purpose : Activates/Updates the `trapped' key toggle
(Caps, Numbers, Scroll, Insert)
Description :

[Mode%], if zero, will update the prompts only if the keys have,
changed; If -1 will disable `trapping' If you disable it with
this code, the internal routines won't update the prompt. Any
other value for [Mode%] will force a displaying of the prompts
(useful if you cleared the screen)

The default `trapping' prompt is : " INSERT CAPS NUM SCROLL "
(assuming all of the key toggles are active.) The message is
displayed at the top left corner of the screen, using white on
black. If any key is inactive, the respective text will be
cleared to ASCII 32, also using white on black.
(i.e. " INSERT NUM SCROLL " would appear if only caps
lock was off.) You can re-configure KEYSTATS with CNFKEYS.

KEYSTATS is not `shift blind' if you press any of the shift keys
and both caps lock and numbers lock were off, it will reverse
their state (visually). It knows that if caps is off and any
shift key is down, you will get capital letters and also that
numbers will be produced on the key pad.

SEE ALSO : CNFKEYS, KEYORDER, GETKSTATS

Example:
CLS : CALL KeyStats(1) ' Activate
.
.
Pany:A$ = INKEY$ : IF A$="" THEN CALL KeyStats(0) : GOTO Pany
' updates prompt while waiting for a key.
















BASDLX Copyright (C) 1986,1987,1988 By Gustavo H. Verdun





28 BASIC Deluxe Version 1.72 (FINAL) February 1988

Routine Name : MACHINE
Arguments : ( Value% )
Type : IBM machine type
Purpose : Reads memory and returns machine code.
Description :

Value%, upon return the value% will contain a code number. Use
the following table to determine the machine type:

Code Machine
---- -------
255 PC
254 PC-XT or Portable PC
253 PCjr
252 PC AT, PC XT 286, PS/2 Model 50 or 60
251 PC-XT (BIOS DATE: 01/10/86 or 05/09/86)
250 PS/2 Model 30
249 PC Convertible
248 PS/2 Model 80

Note: The identification number of PC compatibles will most
likely differ from these numbers. Some early XTs have a machine
code of 255.

The commercial version of BASIC Deluxe will include an expanded
version of the MACHINE routine which will allow you to further
distinguish the machine type, processor installed, if 80x87 and
all hardware.

Example:
call machine(code%):print "Identification code :";code%


Routine Name : MAKEPICTURE
Arguments : ( Picture$, Length%, Error% )
Type : BASDLX GETSTRD support
Purpose : Converts the supplied Picture$ into BASDLX
compressed format.
Description :

Picture$, this string contains the picture of the data field.
BASIC Deluxe uses a format similar to the PICTURE clause in dBASE
III. For those familiar with dBASE III, you'll feel right at
home. However, there are a few exceptions to the format, that is
not standard with dBASE. Please see section entitled "Data Field
`PICTURE' Definitions" at the of this documentation for a
detailed description.

Length%, this value is returned by MAKEPICTURE and is the new
length for the Picture$, after compression.

BASDLX Copyright (C) 1986,1987,1988 By Gustavo H. Verdun





BASIC Deluxe Version 1.72 (FINAL) February 1988 29

Routine Name : MAKEPICTURE (Continued)

Error%, should be zero if mask compression was successful,
otherwise the following error numbers indicate the error:

Error Description Cause
-----------------------------------------------------------------
1 Null String Picture$ is = "" (nothing)
2 Function not supported This is caused because you
either did not put a space
between the Functions and
Templates or, you attempted to
select a non-existent function
letter ( i.e. not "N" or "K" )
-----------------------------------------------------------------
DO NOT SEND GETSTRD or, any other routine that uses PICTURES, a
Picture$ THAT DID NOT GO THROUGH MAKEPICTURE OR, FAILED IN
COMPRESSION ( Error%<>0 )


Routine Name : MBUTTONM
Arguments : ( Status% )
Type : Mouse Support
Purpose : Returns the status byte of the mouse buttons.
Description :

This routine simply reads the mouse button status and returns it
in Status%. For the Microsoft Mouse this if bit 0 is active then,
The left button is being held down and, if bit 1 is active then
the right button is being held down. Please check your mouse
reference manual for your mouse, if other than Microsoft. (This
routine uses mouse interrupt function 3 to get the status of the
buttons.)

Example:

CALL MbuttonM (B%)
IF (B% AND 1) = 1 THEN PRINT "The left button is down."
IF (B% AND 2) = 2 THEN PRINT "The right button is down."












BASDLX Copyright (C) 1986,1987,1988 By Gustavo H. Verdun





30 BASIC Deluxe Version 1.72 (FINAL) February 1988

Routine Name : MBOUNDM
Arguments : ( Row%, Column%, Height%, Width% )
Type : Mouse Support
Purpose : Defines the mouse boundaries to restrict its
movement.
Description :

Row% and Column% refer to the top left cursor coordinates of the
active screen. If Row% or Column% is 0 then MBOUNDM will skip
defining the boundary for that axis pair. An axis pair is the
minimum and maximum value for the axis. Thus, Row% is the minimum
and Row% + Height% - 1 is the maximum value for the Row (Y) axis.

MBOUNDM works in all display modes.

Example:

CALL McursorM(1) : CALL MboundM(5,5,15,70)
' Restrict the movement of the mouse to this window.
CALL MlocationM( 5,5,-1)
p1:A$=INKEY$: IF A$="" THEN GOTO p1
CALL MclearM
' Free mouse and center the cursor
p2:A$=INKEY$: IF A$="" THEN GOTO p2
CALL McursorM(0)


Routine Name : MCLEARM
Arguments : none
Type : Mouse Support
Purpose : clears all mouse boundaries and centers the
cursor on the screen.
Description :

This routine will clear the boundaries (which are set by MBOUNDM)
to allow the mouse to move freely around the entire screen and
center the cursor on the display.

Example:

CALL McursorM(1) : CALL MboundM(5,5,15,70)
' Restrict the movement of the mouse to this window.
CALL MlocationM( 5,5,-1)
p1:A$=INKEY$: IF A$="" THEN GOTO p1
CALL MclearM
' Free mouse and center the cursor
p2:A$=INKEY$: IF A$="" THEN GOTO p2
CALL McursorM(0)



BASDLX Copyright (C) 1986,1987,1988 By Gustavo H. Verdun





BASIC Deluxe Version 1.72 (FINAL) February 1988 31

Routine Name : MCURSORM
Arguments : ( [Mode%] )
Type : Mouse Support
Purpose : Activates / Deactivates the standard mouse
cursor.
Description :

If [Mode%]=0 then the cursor is deactivated. Any non zero number
will activate it.

Example:
call mcursorm(1) 'rem activate cursor
.
call mcursorm(0) 'turn it back off


Routine Name : MERGEPICTURE
Arguments : ( String$, Picture$ )
Type : BASDLX GETSTRD support
Purpose : Merges the PICTURE into the string.
Description :

This routine will merge a previously STRIPPICTURed String. Thus,
inserting the literals back into String$. The length of String$
must be of the total length of the mask in order for it to work
properly, otherwise there may some data loss due to the shifting
of the characters.

Example:

Phonep$=" (999) 999-9999" : CALL MakePicture (Phonep$, L%, 0)
PhoneP$ = LEFT$(PhoneP$,L%)
' The 0 was placed in the MakePicture Argument because we know it
' won't fail to compress.
ph$="5555551212" : CALL PICTURELEN( PhoneP$, L%)
' This is what a STRIPPICTUREed string looks like
a$=SPACE$(L%) : CALL SetL(ph$,a$) : ph$ = a$ ' Expand string
CALL MergePicture( Ph$, PhoneP$ ) : PRINT Ph$
' Ph$ will look like : "(555) 555-1212"












BASDLX Copyright (C) 1986,1987,1988 By Gustavo H. Verdun





32 BASIC Deluxe Version 1.72 (FINAL) February 1988

Routine Name : MESHPICTURE
Arguments : ( String$, Picture$ )
Type : BASDLX GETSTRD support
Purpose : Meshes the Picture$ into String$.
Description :

This routine will just "lay" all the literals in the Picture$ in
their respective position in String$. (GETSTRD automatically does
this when you call it.) Any characters that are in the place of a
literal will be overwritten.

Example:

Phonep$=" (999) 999-9999" : CALL MakePicture (Phonep$, L%, 0)
PhoneP$ = LEFT$(PhoneP$,L%)
' The 0 was placed in the MakePicture Argument because we know it
' won't fail to compress.
CALL PICTURELEN( PhoneP$, L%)
Ph$ = SPACE$(L%) : CALL MeshPicture( Ph$, PhoneP$ ) : PRINT Ph$
' Ph$ will look like : "( ) - "


Routine Name : MLOCATIONM
Arguments : ( Row%, Column%, [Mode%] )
Type : Mouse Support
Purpose : Reads or sets the mouse cursor coordinates.
Description :

The mode% argument: If zero will return the coordinates in the
virtual format. If positive, will return the coordinates in the
active screen mode format. If negative, will set the mouse to the
specified Row%, Column% (active display mode).

MLOCATIONM works in all display modes.

Example :

CALL Mcursorm(1)
CALL Mlocationm(13,40,-1) 'Set cursor at center
continue:
LOCATE 1,1
CALL Mlocationm(r,c,1) 'return value in current screen mode
PRINT "Row :",R;" Column :";C
A$=INKEY$: IF A$="" THEN GOTO continue
CALL Mcursorm(0)






BASDLX Copyright (C) 1986,1987,1988 By Gustavo H. Verdun





BASIC Deluxe Version 1.72 (FINAL) February 1988 33

Routine Name : MPRESSRELM
Arguments : ( Row%, Column%, Count%, Button%, [Which%],
[Mode%] )
Type : Mouse Support
Purpose : Reads mouse registers and returns the press
or release information for the specified
button.
Description :

Row%, Column%, Count% are all returned by the MPRESSRELM. Row%
and Column% is the location of the last press/release for the
specified Button%. Count% is the number of times the button has
been pressed/released since the last call to MPRESSRELM for
press/release information. (Note: "press/release" refers to one
or the other, not both; Defined in [Which%].)

Button% for the Microsoft Mouse: If 0 then the left button will
be checked. If 1, the right button will be checked. Upon return
from MPRESSRELM Buttons% will contain the value of the button
statuses (SEE MBUTTONM for a description). If you are not
interested in the button status then you may enter the button
code directly in the argument list.

[Which%], If 0 will return the button press information. Any
other value will return the release information.

[Mode%], If 0 will return the Row% and Column% in the virtual
mode, any other value will return the Row% and Column% in the
Active mode

Example:

PRINT "Press the mouse buttons a few times, then hit any key."
p1:A$=INKEY$: IF A$="" THEN GOTO p1
CALL MPressrelM ( R%,C%,CN%,0,0,1) ' --- Left ---
PRINT "The LEFT button has been pressed";CN%;" times."
CALL MpressRelM ( R%,C%,CN%,0,1,1)
PRINT "The LEFT button has been released";CN%;" times."
CALL MPressrelM ( R%,C%,CN%,1,0,1) ' --- Right ---
PRINT "The RIGHT button has been pressed";CN%;" times."
CALL MpressRelM ( R%,C%,CN%,1,1,1)
PRINT "The RIGHT button has been released";CN%;" times."









BASDLX Copyright (C) 1986,1987,1988 By Gustavo H. Verdun





34 BASIC Deluxe Version 1.72 (FINAL) February 1988

Routine Name : PICTURELEN
Arguments : ( Picture$, Length% )
Type : BASDLX picture Support
Purpose : Returns the expanded length of the picture.
Description :

Picture$ must first be processed by MAKEPICTURE before it is used
with PICTURELEN or, any other BASDLX routine that uses pictures.

Example:

PhoneP$ = " (999) 999-9999" : CALL MakePicture( Phonep$, L%, 0 )
PhoneP$ = LEFT$(PhoneP$,L%)
' The 0 was placed in the MakePicture Argument because we know it
' won't fail to compress.
CALL PICTURELEN( PhoneP$, L%) : PRINT " Picture Length = ",L%
' The length should be 14.


Routine Name : READP
Arguments : ( Port_number% )
Type : Printer support
Purpose : Reads the printer status of the specified
port number (1-3) and returns with the status
byte for that port in the Port_num% variable.
Description :

The status byte of contains the following information:

bit: 7 6 5 4 3 2-1 0
| | | | | | |_Time out
| | | | | |_Unused
| | | | |_1 = I/O Error
| | | |_1 = Selected
| | |_1 = Out of Paper
| |_1 = Acknowledge
|_1 = Not Busy

IMPORTANT: This routine does not check for a valid port number.
Be sure that the port number is in the range of 1-3

Example:
port%=1:call readp(port%):print port%
if port% and 32=32 then print "Printer is out of paper"
if port% and 128=0 then print "Printer is Off-line"






BASDLX Copyright (C) 1986,1987,1988 By Gustavo H. Verdun





BASIC Deluxe Version 1.72 (FINAL) February 1988 35

Routine Name : RESETP
Arguments : (Port_num%)
Type : Printer support
Purpose : Resets the specified printer port number
(1-3) and returns with its status byte (see
the READP routine description for information
on the printer status byte)

Description :
This routine sends a reset status through the parallel interface
of the specified port number. This routine does check the
parameters to be sure that they are in the range of 1 to 3. If
the Port_num% argument is equal to -1 upon return then the port
number is not valid.

Example:
port%=1:call resetp(port%):print port%
if port%=-1 then print"Port number must be in the range of 1-3"
if port% and 32=32 then print "Printer is out of paper"
if port% and 128=0 then print "Printer is Off-line"


Routine Name : SETL
Arguments : ( Source$, Destination$ )
Type : String service
Purpose : This routine will place the source string
inside of the destination left-justified. If
the source string is longer than the
destination string then the right portion of
the string will be truncated.
Description :

This routine automatically clears the destination string to
spaces (ASCII 32) even if the source string is of length zero. Be
sure to save the destination string into the source string after
the call.

Example:

A$="Enter Name":B$=SPACE$(20):CALL SetL(A$,B$):A$=B$
' the last command "a$=b$" saves the destination string in the
' source string since the routine cant' change the length of
' any string.
PRINT ">";A";"<" ' This will show you the new length of A$







BASDLX Copyright (C) 1986,1987,1988 By Gustavo H. Verdun





36 BASIC Deluxe Version 1.72 (FINAL) February 1988

Routine Name : SETR
Arguments : ( Source$, Destination$ )
Type : String
Purpose : This routine will place the source string
inside the destination string right
justified. If the destination string is
shorter than the source string then the right
portion of the string will be truncated.
Description :

This routine automatically sets the destination string to all
spaces (ASCII 32) even if the source string is of length zero. Be
sure to save the destination string into the source string after
the call.

Example:

A$="Enter Name":B$=SPACE$(20):CALL SetR(A$,B$):A$=B$
' the last command "a$=b$" saves the destination string in the
' source string since the routine cant' change the length of
' any string.
PRINT ">";A$;"<" ' This will show you the new length of a$


Routine Name : SNDOFF
Arguments : NONE
Type : Speaker support
Purpose : Turns speaker off. If this routine is used
then the BASIC SOUND or BEEP commands will
not work.
Description :

This routine can be useful for those programs that use sound
prompts to get attention when input is required. With this
routine you can easily add the feature to your programs that will
let the user decide if he wants to have the sound prompts on or
off. If he wants the off then at the beginning of your program
just call this routine. Any sound statements following this com-
mand will execute without producing a single sound. Be sure not
to forget to turn them on before the program finishes (SNDON).


Example :
SOUND 200,1 : SOUND 300,1 : SOUND 400,1 : CALL Sndoff
SOUND 200,1 : SOUND 300,1 : SOUND 400,1






BASDLX Copyright (C) 1986,1987,1988 By Gustavo H. Verdun





BASIC Deluxe Version 1.72 (FINAL) February 1988 37

Routine Name : SNDON
Arguments : NONE
Type : Speaker support
Purpose : Turns sound on so that the BASIC SOUND and
BEEP commands work.
Description :

This routine can help solve the problem that occurs when you use
some memory resident programs that use the speaker and when they
are done the turn it off so that any SOUND or BEEP commands won't
produce an audible signal. It can also turn on the sound when it
was turned off by the routine SNDOFF!

Example:

sound 200,1:sound 300,1:sound 400,1:call sndoff
sound 200,1:sound 300,1:sound 400,1:call sndon
sound 200,1:sound 300,1:sound 400,1

































BASDLX Copyright (C) 1986,1987,1988 By Gustavo H. Verdun





38 BASIC Deluxe Version 1.72 (FINAL) February 1988

Routine Name : SPELLNUMBER
Arguments : ( [Number%], String$, Length%, [Type%] )
Type : String Service
Purpose : Will convert the number in Number% to
written english using, ordinal or cardinal
form.
Description :

Number%, any number you wish to convert to written form.

String$, Here is where the spelled-out form of the number will be
stored. Since the length of this string depends on how large the
number, use your own discretion as too how long to set it.

Length%, Upon return from the routine the length of the string
will be returned in this variable.

Type%, if type = 0 then the cardinal spelling will be used for
the number. Cardinal numbers are : one,two,three. . . Any other
value will return the ordinal spelling. Ordinal numbers are :
first,second,third. . .

Example:

n%=12:n$=space$(4):t%=0:call spellnumber(n%,n$,l%,t%) ' cardinal
n$=left$(n$,l%):print "You have ";n$;" files available."
call spellnumber(n%,n$,l%,t%):n$=left$(n$,l%) ' ordinal
print "This is the ";n$;" day of the month."


Routine Name : STRIPPICTURE
Arguments : ( String$, Picture$, Length% )
Type : BASDLX GETSTRD support
Purpose : Removes the PICTURE from the String$.
Description :

Shortens String$ by removing all literals. The Length% will be
it's new length.

Example:

Phonep$=" (999) 999-9999" : CALL MakePicture (Phonep$, L%, 0)
PhoneP$ = LEFT$(PhoneP$,L%)
' The 0 was placed in the MakePicture Argument because we know it
' won't fail to compress.
ph$="(555) 555-1212"
' This is what a STRIPPICTUREed string looks like
CALL StripPicture( Ph$, PhoneP$, L% ) : Ph$ = LEFT$( Ph$, L% )
PRINT Ph$ ' Ph$ will look like : "5555551212"


BASDLX Copyright (C) 1986,1987,1988 By Gustavo H. Verdun





BASIC Deluxe Version 1.72 (FINAL) February 1988 39

Routine Name : TIMESTR
Arguments : (String_space$)
Type : Time support
Purpose : Reads clock and loads String_space$ with the
time in decimal ASCII. The format is as
follows: HH:MM:SS.HD Where, HH are hours,MM
are minutes, SS are seconds and, HD are
Hundredths of a second.
Description :

String_space$ must be of at least 11 characters of length for
this routine to work successfully. If it is not of the proper
minimum length then the routine will do nothing and return with
the String_space$ unmodified.

Example:

t$=space$(11):call timestr(t$):print t$

































BASDLX Copyright (C) 1986,1987,1988 By Gustavo H. Verdun





40 BASIC Deluxe Version 1.72 (FINAL) February 1988

File Attributes

The following is a table containing the attribute for each type
of file:

Attribute Type Description
-----------------------------------------------------------------
0 Normal Most files have this code.

1 Read Only This file may be read from but, NOT
written to. (Write protects just
the file.)

2 Hidden This type of file is hidden from
the normal DIR (DOS) or FILES
(BASIC) command.

4 System Indicates it is a SYSTEM File.
----------------------------------------------------------------
Note: It is valid for a file to contain more than one of the
above attributes. i.e. a file may be Hidden and Read Only thus
having an attribute of (2 (hidden) + 1 (Read Only)) = 3.

MOUSE NOTES

GETSTRD is the only routine that supports the use of the mouse as
a pointing device.

Every time the mouse is reset, through a software command, there
is about a second and a half or more, depending on the speed of
your machine, of a delay. This unfavorable delay will cause
several routines in BASDLX to slow down a program especially if
several calls to a routine are made. This delay only happens
every time a mouse reset is performed. It is only necessary to
reset the mouse once in a program. So, I added the routine :
DLXMOUSE to let BASDLX routines know that a mouse is installed or
not with-out having to do the time consuming `software reset' on
the mouse every time the routine is called. This method should
work well with the following exception: The mouse register that
keeps tab on the cursor (on/off) is a decrement/increment
register. This means that if you execute the command to turn the
cursor off two times in a row, you will need to execute the com-
mand to turn the cursor on, two times again before you see the
`mouse cursor' on the screen. The routines in BASDLX (that accept
the mouse) require that the mouse cursor be on or, if off, just
one command to turn the cursor on be necessary to show the `mouse
cursor'.




BASDLX Copyright (C) 1986,1987,1988 By Gustavo H. Verdun





BASIC Deluxe Version 1.72 (FINAL) February 1988 41

Data Field Picture Definitions

The BASIC Deluxe Picture$ argument is similar to that of dBASE.
The first section defines any functions:

Picture Functions

The first character in the string must be a "@". This informs
BASDLX that the following characters will select the functions.
If no functions are used then skip the "@" and proceed with
defining the template.

K Clears the entire field, if the first key
struck is not a cursor positioning key.
N Defines this field as a String-Numeric. This
function has an automatic `K' in it.

String Picture Templates

The template section of the Picture$ begins with a space
character (ASCII 32) and consists of any of the following
template definitions:

# Allows digits (0-9) and the "-" and "+" sign.
9 Allows only digits (0-9)
X Allows digits, letters and special
characters.
N Allows digits and letters only
U Allows upper case letters only. (If letters
are entered in lower case, they will be
converted.)
L Allows lower case letters only. (If letters
are entered in upper case, they will be
converted.)
B Boolean, allows a "Y" or "N" response. (Will
convert letters to upper case.)















BASDLX Copyright (C) 1986,1987,1988 By Gustavo H. Verdun





42 BASIC Deluxe Version 1.72 (FINAL) February 1988

Data Field Picture Definitions (Continued)

Numeric Picture Templates

The following template definitions apply only when the field is
defined String-Numeric via the @N Function. These characters will
be treated as literals if not in the String-Numeric mode.

. Defines the decimal point
, Displayed only if there are numbers to the
left of it.
$ Just like # but, will show a `$' if there is
no digit or sign in its place.
* Just like # but, will show an `*' if there is
no digit or sign in its place.
9 and # Function just like in String mode.

Any other character will be treated as a literal and will be
copied to the input string exactly as it appears and the cursor
will just skip over them.


Examples:

String:

Pdate$ ="@K ##/##/##" 'Field to enter the date
Pfirstname$=" AAAAAAAAAAAAAAAAAAAA" 'Field to enter a name
Pphone$ ="@K (999)-999-9999" 'Field to enter a phone #
Pzip4$ ="@K 99999-9999"
'A zip code is not necessarily numeric data

Numeric:

Pamount$ ="@NK ###,###,###.99" 'Field to enter an amount
Pquantity$="@KN 9999999" 'Field to enter a quantity

NOTE: In Pamount$ and Pquantity$ the "K" is not necessary because
it is automatic. The Function declarations are not place nor
order dependant, as long as they are together ("@KN").











BASDLX Copyright (C) 1986,1987,1988 By Gustavo H. Verdun


 December 8, 2017  Add comments

Leave a Reply