                                INTRODUCTION - (12 page document)

Welcome to the xBASELIB demo.  xBASELIB is a command library that
will allow you to perform low level commands from the dot prompt,
FoxPro command window, and from within your favorite programs (i.e.
FoxPro, FoxBASE +, dBASE III PLUS, and dBASE IV).  Also, xBASELIB
version 1.0 commands can be moved from one flavor of xBASE (i.e.
dBASE IV version 1.1, FoxPro version 1.02, dBASE III PLUS version
1.1, and FoxBASE + version 2.1) to another without any
modification. 

Please note that you will see the word xBASE being used throughout
this demo. xBASE refers to FoxPro, FoxBASE +, dBASE III PLUS, and
dBASE IV.

xBASELIB was developed for the following reasons:

(1) To help you support your xBASE application.  For example, if
you include the GETPCENV.PRG program (included on the xBASELIB
system disk) in your application, you can quickly obtain
information about your clients' PC environment.  This should help
you in supporting your xBASE applications when you are talking with
your client on the phone.  

(2) To help you install your xBASE application.  For example, if
you use the INSTALL.PRG program (included on the xBASELIB system
disk) in your xBASE installation program, you can perform low-level
DOS commands in the background (e.g. MD, CHDIR, etc.).  This will
give your installation program a professional look.

(3) To help your xBASE program communicate with your printer.  For
example, an end-user has placed the incorrect baud rate in their
config.sys file.  You can initialize the serial printer with the
correct baud rate within your xBASE application.

xBASELIB will not solve all of your problems, but it will give you
an edge in supporting your xBASE programs.

You may already have noticed that the examples in this demo are
from the dot prompt.  We did this to show you how easy the xBASELIB
commands are to use.  If you are a beginner to xBASE, performing
xBASELIB commands from the dot prompt or Foxpro command window will
be easier to grasp.  The intermediate and advanced xBASE users can
use all of the xBASELIB commands in their programs.
















Also, the xBASELIB commands will become very useful to the xBASE
user for the following reasons:

(1) When executing DOS commands from the dot prompt or FoxPro
command window, the xBASE RUN command requires additional memory
than xBASELIB since it has to load another DOS command.com file
into memory.  If the computer you or your client is using does not
have sufficient memory for the RUN command (this could be due to
your application or the amount of memory installed on the
computer), you will receive the dreaded "Insufficient memory" error
message on your computer screen, and you will not be able to
execute your DOS command.

(2) The xBASELIB commands are written in assembly language - the
computer's language.  Thus they are very fast, much faster than the
RUN command, and take very little memory.  As little as 20 bytes!

(3) Most of the xBASELIB commands (e.g. nodrives, mousedrv,
mathcopr, xmsdrv, cursor, printer status, etc.) are not accessible
from the xBASE RUN command.





































The retail version of xBASELIB comes in a spiral binder with source
code.  The 84 commands included with xBASELIB are:

BIOSDATE       - bios date
CAPSOFF        - turn caps lock off
CAPSON         - turn caps lock on
CAPSSTAT       - caps lock status
CDROMDRV       - CDROM driver present
CDROMVER       - CDROM driver version
COM1200        - initialize COM port/1200 baud
COM2400        - initialize COM port/2400 baud
COM300         - initialize COM port/300 baud 
COM4800        - initialize COM port/4800 baud 
COM9600        - initialize COM port/9600 baud
COMBID         - line status
COMDR          - line status
COMFE          - line status
COMOE          - line status
COMPE          - line status
COMSTAT        - COM port status
COMTHR         - line status 
COMTOE         - line status
COMTSR         - line status
CONVMEM        - installed conventional memory
CREATDIR       - create subdirectory
CURSCOL        - determine cursor column location
CURSOR         - change cursor size
CURSROW        - determine cursor row location
DAYWEEK        - determine day of the week
DOSVERS        - get DOS version
DRIVERDY       - is drive A or B ready?
EXTMEM         - amount of installed extended memory
FIXEDDRV       - is drive fixed?
GAMEADAP       - game adapter installed?
GETATTR        - get file attributes
GETDRIVE       - get drive letter
GETVERFY       - get verify status
INSSTAT        - insert key status
LEFTSHFT       - left shift key status
LPTINIT        - initialize parallel printer
LPTSTAT        - get parallel printer status
MATHCOPR       - math coprocessor installed?
MCA            - Micro Channel Architecture?
MODMCTS        - modem status
MODMDCTS       - modem status
MODMDDSR       - modem status
MODMDRLS       - modem status
MODMDSR        - modem status
MODMRI         - modem status
MODMRLS        - modem status 
MODMTER        - modem status
MOUSEDRV       - is mouse driver installed?
MOUSELNG       - mouse language
MOUSETYP       - mouse type
MOUSEVER       - mouse version
NODRIVES       - number of installed drives
NUMOFF         - turn num lock key off
NUMON          - turn num lock key on
NUMSTAT        - get num lock key status
PARALLEL       - parallel printer port installed?
PC             - is pc a PC?
PCAT           - is pc a PC/AT?
PCBUS          - PC bus?
PCCONV         - is pc a PC Convertible?
PCJR           - is pc a PC/jr?
PCXT           - is pc a PC/XT?
PCXT286        - is pc a PC/XT 286?
PRNTSCRN       - print screen contents to printer
PS2M30         - is pc a PS2 model 30?
PS2M50         - is pc a PS2 model 50?
PS2M55         - is pc a PS2 model 55?
PS2M60         - is pc a PS2 model 60?
PS2M70         - is pc a PS2 model 70?
PS2M80         - is pc a PS2 model 80?
REALTIME       - real time clock installed?
REMOVDIR       - remove subdirectory
RGHTSHFT       - right shift key status
SCRLOFF        - turn scroll lock key off
SCRLON         - turn scroll lock key on
SCRLSTAT       - scroll lock key status
SCRNSIZE       - screen size
SERIAL         - is a serial port installed?
SETATTR        - set file attributes
SETDIR         - set subdirectory
SETDRIVE       - set drive letter
SETVERFY       - set verify on/off
XMSDRV         - is the extended memory driver installed?




































xBASELIB is written entirely in assembly language.  The 122 page
manual comes complete with examples and source code.  Also, we
included a section in our manual that shows you how we created an
assembly language program using Microsoft Macro Assembler 5.1 and
DOS's debug.

The introductory price (good only through December 26, 1990) for
xBASELIB is $69.95 + $7.50 for shipping and handling.  The retail
price for xBASELIB starting December 27, 1990 is $195.00.  Please
see our express lane ad starting in the January, 1991 issue of Data
Based Advisor.  If you would like to purchase xBASELIB, please
complete the order form below.  Thank You.

__________________________________________________________________
BOTH ORDER FORM AND PAYMENT MUST BE RECEIVED BY DECEMBER 26, 1990!
Mail To:       Sparkle Software              xBASELIB       $69.95
               610 E. Bell Rd.               S & H          $7.50
               Suite 2136                    Sales Tax (AZ)
               Phoenix, AZ 85022             Total
               (602) 780-2208                       
Company Name:_______________________________________________
First Name:__________________ Last Name:____________________
Street Address:_____________________________________________
               _____________________________________________
City:___________________ State:__ Zip Code:_________________
Day time phone number:________________________
Evening phone number:_________________________
xBASE language you are currently using (please check):
dBASE III PLUS___ dBASE IV___ FoxBASE +___ FoxPro___
Disk Size: 5.25"___  3.5"___
               (Arizona residents add 6.7% sales tax)
          (Introductory price of $69.95 good until 12/26/90)
       (All prices and offers subject to change without notice)
------------------------------------------------------------------
In order to use xBASELIB, you must have an IBM PC or 100%
compatible, 640k of RAM, a 3.5" or 5.25" diskette drive, hard disk,
FoxBASE +, FoxPro, dBASE III PLUS, or dBASE IV, and MS-DOS version
3.1 or higher (some of the xBASELIB commands will work with DOS
version 2.1.  When Microsoft enhanced MS-DOS in later versions,
e.g. Microsoft CD-ROM extensions, xBASELIB requires MS-DOS 3.1 or
greater).



















                                          Installation

To install the xBASELIB demo on your hard disk, perform the
following steps:

1.  Create a subdirectory on your hard disk with the name xBASELIB.

For example, we'll assume you'll be creating a subdirectory on
drive C on your hard disk.  Type the following ->

MD xBASELIB

and press the return key.

2.  Place the xBASELIB diskette into your floppy diskette drive,
and then type the letter of the drive where you just placed the
xBASELIB diskette.

For example, if you placed the xBASELIB diskette into drive A, type
the following ->

A:

and press the return key.

3.  Copy all of the xBASELIB command files from drive A into the
xBASELIB subdirectory.

For example, type the following ->

copy *.bin c:\xBASELIB





























                               Using xBASELIB in your applications

This is a summary for using the commands (binary files) included
with the xBASELIB demo.  Please refer to each individual command
located in this demo for specific information.

You must have xBASE loaded in memory and be your foreground
(active) application in order to use xBASELIB.

I will use the CAPSSTAT and NODRIVES xBASELIB commands for
examples.  Let's say you want to determine the status of the Caps
Lock key.  To do this, you would perform the following commands
from the xBASE dot prompt:

. load c:\xBASELIB\capsstat
. xBASELIB = "CAPS"
. call capsstat with xBASELIB
. ?substr(xBASELIB,1,1)
.T.

(1) We loaded the file CAPSSTAT.bin into memory.  Notice you do not
use the extension (.bin) of the file you are loading.

(2) We created a parameter called "CAPS" that we will send to the
CAPSSTAT command.

(3) We called the CAPSSTAT command with the passed parameter "CAPS"
(You can pass character parameters to xBASELIB in either lower or
uppercase).  

Please refer to your xBASE manual for questions using the CALL and
LOAD commands.  




























                           Using xBASELIB in your applications (cont.)

The next example uses the NODRIVES xBASELIB command.  If you wanted
to determine the number of logical drives installed on an IBM PC,
you would perform the following steps from the xBASE dot prompt:

. load c:\xBASELIB\nodrives
. xBASELIB = "NODRIVES"
. call nodrives with xBASELIB
. ?asc(substr(xBASELIB,1,1))
6

there are six drives installed on this computer system (drives A,
B, C, D, E, and F).  What we did took four steps:

(1) We loaded the file NODRIVES.bin into memory.  Notice you do not
use the extension (.bin) of the file you are loading.

(2) We created a parameter called "NODRIVES" that we will send to
the NODRIVES command.

(3) We called the NODRIVES command with the parameter "NODRIVES" 
(You can pass character parameters to xBASELIB in either lower or
uppercase).
  
(4) Finally, we determined the number of installed drives by
converting the result to an ASCII code.  When a xBASELIB command
returns a value, you may have to convert the value to an ASCII code
using just two xBASE functions - SUBSTR and ASC.  The SUBSTR and
ASC functions are included with your xBASE product (i.e. FoxBASE +,
FoxPro, dBASE III PLUS, or dBASE IV).

The SUBSTR function returns a specified number of characters from
a string.  For example, the string that was passed in the NODRIVES
command was "NODRIVES."  Since the NODRIVES command returns the
value (number of installed drives) in the first letter of the
string "[N]ODRIVES" (in this case the letter N), all we have to do
is obtain the value of the first letter of the string "[]ODRIVES",
- which is the ASCII character .

. load c:\xBASELIB\nodrives
. xBASELIB = "NODRIVES"
. call nodrives with xBASELIB
. ?substr(xBASELIB,1,1)


We will convert the ASCII code "" to a number to determine the
number of installed drives.  We'll do this using the ASC function.

. ?substr(xBASELIB,1,1)

. ?asc(substr(xBASELIB,1,1)
6

If all of this seems complicated - DON'T WORRY!  Just follow the
instructions for each command and you'll do just fine.  Please
refer to your xBASE manual for questions using the SUBSTR and ASC
functions.


                                            CAPSSTAT


Syntax:                CAPSSTAT

Use:                   To determine if the Caps Lock key is on.

Parameters:            CAPS

Returns:               The first character in the sending parameter will
                       have a "Y" if the Caps Lock key is on, a "N" if it
                       is off.  If you did not pass the parameter correctly
                       (e.g. xBASELIB = "ZAPS"), your sending parameter
                       will be unchanged.

Example:               . load c:\xbaselib\capsstat
                       . xBASELIB = "CAPS"
                       . call capsstat with xBASELIB
                       . ?substr(xBASELIB,1,1) = "Y"
                       .T.

                       From this example, the Caps Lock key is on.

Notes:                 Make sure you re-load capsstat into memory each time
                       you determine if the Caps Lock key is on or off.



































                                             DOSVERS


Syntax:                DOSVERS

Use:                   To determine the DOS version.

Parameters:            DOS

Returns:               The first character in the sending parameter will
                       have the DOS major version number, and the second
                       character in the sending parameter will have the DOS
                       minor version number.  If you did not pass the
                       parameter correctly (e.g. xBASELIB = "ZOS"), your
                       sending parameter will be unchanged.

Example:               . load dosvers
                       . xBASELIB = "DOS"
                       . call dosvers with xBASELIB
                       . ?asc(substr(xBASELIB,1,1))
                       3
                       . ?asc(substr(xBASELIB,2,1))
                       30

                       From this example, the DOS version is 3.30.  Your
                       application may require a certain DOS version, i.e.
                       3.30 or higher.

Example:               load dosvers
                       xBASELIB = "DOS"
                       call dosvers with xBASELIB
                       IF asc(substr(xBASELIB,1,1)) < 3
                          @ 3,0 Say "Application requires DOS 3.3 or"
                          @ 4,0 Say "greater.  Press any key to exit."
                          Wait ""
                          return
                       Endif
                       IF asc(substr(xBASELIB,1,1)) = 3 .and.
                       asc(substr(xBASELIB,2,1)) < 30
                          @ 3,0 Say "Application requires DOS 3.3 or"
                          @ 4,0 Say "greater.  Press any key to exit."
                          Wait ""
                          return
                       Endif

               If your application needs more than 20 file handles
               open at one time, make sure the DOS version is
               greater than or equal to 3.30.












                                            NODRIVES


Syntax:                NODRIVES

Use:                   To determine the number of installed disk drives. 

Parameters:            NODRIVES

Returns:               The first character in the sending parameter will
                       have the number of disk drives installed.  If you
                       did not pass the parameter correctly (e.g. xBASELIB
                       = "Z0DRIVES"), your sending parameter will be
                       unchanged.

Example:               . load nodrives
                       . xBASELIB = "NODRIVES"
                       . call nodrives with xBASELIB
                       . ?asc(substr(xBASELIB,1,1))
                       6
                                              
                       From this example, there are six installed disk
                       drives.  These disk drives could be two floppy
                       drives A: and B:; a hard disk partitioned into                            
                       three drives C:, D:, and E:; and a ram disk (F:).



































You may demo CAPSSTAT.BIN, DOSVERS.BIN, and NODRIVES.BIN in your
xBASE applications, but Sparkle Software retains ownership of
CAPSSTAT.BIN, DOSVERS.BIN, and NODRIVES.BIN.

SPARKLE SOFTWARE PROVIDES CAPSSTAT.BIN, DOSVERS.BIN, AND                                 
NODRIVES.BIN "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS
OR IMPLIED, INCLUDING THE IMPLIED WARRANTIES OF FITNESS FOR A
PARTICULAR PURPOSE OR MERCHANTABILITY AND SPARKLE SOFTWARE SHALL
NOT BE LIABLE FOR ANY TORT, INDIRECT, SPECIAL, OR CONSEQUENTIAL
DAMAGES SUCH AS LOSS OF PROFITS, LOSS OF GOODWILL, OR LOSS OF
PRODUCTIVITY FROM THE USE OR INABILITY TO USE THE SOFTWARE FOR ANY
PURPOSE.

xBASELIB Version 1.0                 Copyright (C) Sparkle Software 1990
All Rights Reserved.

xBASELIB is a trademark of Sparkle Software.
Microsoft, Microsoft Macro Assembler, and MS-DOS are registered trademarks of Microsoft Corporation.
IBM and PS/2 are registered trademarks of International Business Machines Corporation.
dBASE, dBASE III PLUS and dBASE IV are registered trademarks of Ashton-Tate Corporation.
FoxBASE + and FoxPro are registered trademarks of Fox Software Inc.
Intel is a registered trademark of Intel Corporation.

Thanks for using the xBASELIB demo.  Please feel free to call us at (602) 780-2208
if you have any questions.
