home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / BASIC / BASDLX14.ZIP / BASDLX.DOC next >
Encoding:
Text File  |  1987-04-01  |  36.3 KB  |  961 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.              BASDLX (C) Copyright 1986,1987 By Gustavo H. Verdun  Page 1
  8.  
  9.  
  10.                                      BASDLX.LIB
  11.  
  12.             Deluxe Library of functions written in assembly language for
  13.                                    Compiled BASIC
  14.  
  15.           BASDLX,  Basic Deluxe,  is a library of handy functions for  com-
  16.           piled  BASIC.  To  use  BASDLX.LIB you will need,  either the IBM
  17.           Basic  compiler or the Microsoft Quickbasic compiler.  I  suggest
  18.           that  you  use PC-DOS/MS-DOS versions 2.0 or later to insure full
  19.           compatibility.  These functions have been  tested  with  the  IBM
  20.           Basic compiler version 2.0 and have caused no problems.  However,
  21.           I am not responsible for any damages caused by but,  not  limited
  22.           to,  the use, misuse,  non-use or inability to use BASDLX.  These
  23.           deluxe  function  are intended to be used in compiled basic only.
  24.           Do  not  confuse  compiled  BASIC  with  the  BASIC  interpreter,
  25.           BASIC.COM or BASICA.COM that comes with DOS or GWBASIC. The func-
  26.           tions  provided  in this library have been designed to run faster
  27.           than any correspondent BASIC code,  and often take up less space,
  28.           leaving you with more room to write longer programs!
  29.  
  30.           This  is the fourth,  of many public releases of the Basic Deluxe
  31.           library. You are free to use the functions provided in the BASDLX
  32.           library  in your programs. The copyright is only here to preserve
  33.           my work and to protect you from any unauthorized modifications of
  34.           BASDLX;  it is NOT here to protect against the free  distribution
  35.           of BASDLX.  You may copy and distribute BASDLX to  others as long
  36.           as no  fee or special consideration is charged and all of the re-
  37.           lated files to BASDLX are included  together  in  the  unmodified
  38.           form.  If  you use BASDLX in your programs and find it a valuable
  39.           tool then I would appreciate it if you would send a  contribution
  40.           ($25  suggested).  It  would be nice if you could acknowledge use
  41.           of BASDLX functions in your programs or  documentation  that  use
  42.           them.  With  a minimum contribution of $25 I will send you a disk
  43.           with the source code to BASDLX.  Previous contributors will  need
  44.           only send $10 for an update of BASDLX. A contribution of $55 will
  45.           grant you a one year subscription to BASDLX.  With a subscription
  46.           you will automatically receive new updates as soon as  they  come
  47.           out  (about  10  updates  per  year.)  Updates come complete with
  48.           source code, BASDLX library, and documentation.
  49.  
  50.           These functions have been incorporated into  a  library  to  make
  51.           them easily accessible by the DOS LINK.EXE program.  All you have
  52.           to  do is copy BASDLX.LIB to the directory or disk where you keep
  53.           your library files.   When you link your  programs that use func-
  54.           tions  from  BASDLX,   be sure to specify: BASDLX when the linker
  55.           prompts you for a Library [.LIB] file(s).  Please refer  to  your
  56.           DOS manual for more information on the LINK.EXE program.
  57.  
  58.  
  59.  
  60.                       --- BASDLX   Version 1.4   April 1987 ---
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.              BASDLX (C) Copyright 1986,1987 By Gustavo H. Verdun  Page 2
  68.  
  69.                                     Special Notes
  70.  
  71.           The  functions  provided  in this library are available to you by
  72.           using the CALL command from compiled BASIC. All numeric variables
  73.           passed as arguments to the functions must  defined  as  integers.
  74.           This means that you can either globally set all numeric variables
  75.           to integers by issuing the DEFINT A-Z command at the beginning of
  76.           your program or,  you can declare a single variable as integer by
  77.           adding a "%" symbol at the end of its name. (i.e.  I%,  this will
  78.           declare the variable as being integer). I will always add the "%"
  79.           symbol  at  the  end of all my numeric variables in all of my ex-
  80.           amples, to remind you that they MUST be integers.
  81.  
  82.           The variable names used in my examples don't have to  be  exactly
  83.           the  same.  you  may  choose  other  names that would be more ap-
  84.           propriate. keep in mind that the variable types do have to be the
  85.           same in the argument list (i.e. strings must be strings, integers
  86.           must be integers).
  87.  
  88.           NOTE: I have now updated the documentation to  show  which  vari-
  89.           ables can be entered directly in the argument list.  for example,
  90.           the following is an acceptable way to call the GUN function: CALL
  91.           GUN(10)  This will "fire" the gun 10 times and return.  The  only
  92.           difference  between  the above example and s%=10: CALL GUN(S%) is
  93.           that by inserting a number instead of a variable name  BASIC  as-
  94.           signs  that  number  to  a  local  variable which  is erased upon
  95.           return from the function (i.e.  variable space is preserved.) Not
  96.           all  functions  in  BASDLX can be CALLed in this way because they
  97.           sometimes return with a special code  in  the  variable.  In  the
  98.           documentation  any  arguments  enclosed  in  []'s  can be entered
  99.           directly as the argument.
  100.  
  101.           As I mentioned before I have tested these functions and they,  to
  102.           the best of my knowledge,  work bug free.  But,  if you happen to
  103.           find any bugs I'll be happy to fix them.  Be sure to  check  that
  104.           you  are  CALLing  the  functions properly.  That is that you are
  105.           sending the correct arguments to the function.  One of  the  most
  106.           common  error  that  occurs  is when the calling program sends to
  107.           the function an incorrect variable type.  Remember  that  numeric
  108.           variables must be declared integer.
  109.  
  110.           Please refer any questions,  comments, requests for new functions
  111.           or contributions to the following address:
  112.  
  113.                                  Gustavo  H. Verdun
  114.                                  6424 Hollins Drive
  115.                                  Bethesda, MD 20817
  116.  
  117.  
  118.  
  119.  
  120.                       --- BASDLX   Version 1.4   April 1987 ---
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.              BASDLX (C) Copyright 1986,1987 By Gustavo H. Verdun  Page 3
  128.  
  129.           Function Name: ALLDRIVES
  130.           Arguments    : (Num_of_drives)
  131.           Type         : DOS/System
  132.           Purpose      : Returns  the  total    number  of  logical  drives
  133.                          (Diskette, Fixed, Ram, Etc.) Available.
  134.  
  135.           Description  :
  136.           This  function will return a minimum of 2 Drives,  since any com-
  137.           puter is assumed to have the logical drives A: & B: Even if there
  138.           is only one physical drive.
  139.  
  140.           drvs%=0:call alldrives(drvs%)
  141.           print "You have ";drvs%;" drives available."
  142.  
  143.           Function Name: ALLDIRS
  144.           Arguments    : (Dir.Array$(),Maxdirs%,Drive$,Ercd%)
  145.           Type         : DOS/System
  146.           Purpose      : Searches  and  returns  all  of the directories in
  147.                          Drive$.
  148.  
  149.           Description  :
  150.  
  151.           Dir.Array$(0),  This is where the directory names found  will  be
  152.           saved.  Each element in this ONE dimensional array must be set to
  153.           some length.  ALLDIRS is not very picky about the minimum  length
  154.           but  if  it  ever finds a directory path that will not fit in the
  155.           space provided it will stop and return with  an  `out  of  string
  156.           space condition'.  DOS limits the maximum length of any directory
  157.           path to 64 characters including the drive  specifier  (i.e.  C:),
  158.           slashes  and  end  marker (ASCII 0) So,  you will never need more
  159.           than a string length of 64 characters per element.
  160.  
  161.           Maxdirs%,  tells ALLDIRS the number of elements in  Dir.Array$().
  162.           If  ALLDIRS  finds  more  directories than space is provided then
  163.           ALLDIRS stops and returns with a `Out of string space condition'.
  164.           Upon return from ALLDIRS,  Maxdirs%= the  number  of  directories
  165.           found.
  166.  
  167.           Drive$,  Specify  drive  to  search.  The first character in this
  168.           string must specify the drive letter  all  other  characters,  if
  169.           any,  are ignored.  (ALLDIRS will NOT convert the drive letter to
  170.           upper case, you may have to do it separately if it is important.)
  171.  
  172.           Ercd%,  like all disk functions,  errors may occur.  If,  Ercd%=0
  173.           then  everything is o.k.  An error code of -1 = Drive selected is
  174.           not valid. -2 = Out of String space.
  175.  
  176.  
  177.  
  178.  
  179.  
  180.                       --- BASDLX   Version 1.4   April 1987 ---
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.              BASDLX (C) Copyright 1986,1987 By Gustavo H. Verdun  Page 4
  188.  
  189.           Function Name: ALLDIRS (continued)
  190.  
  191.           Example:
  192.           Dim dir.array$(50):for i=0 to 50:dir$(i)=space$(64):next:d$="C:"
  193.           ercd%=0:max%=51:call alldirs(dir.array$(0),max%,d$,ercd%)
  194.           if ercd% then print "Error :";ercd%
  195.           print "Directories found:"
  196.           for i= 0 to max%:print dir$(i):next
  197.  
  198.  
  199.           Function Name: BSORTN
  200.           Arguments    : (Num_of_elements,Integer_array%(start))
  201.           Type         : integer array service
  202.           Purpose      : Sorts an integer array in ascending order with
  203.                          negative numbers appearing at the end  in
  204.                          ascending order.
  205.  
  206.           Description:
  207.           Integer variables in BASIC can contain  numbers  between  -32,768
  208.           and  32,767.  This function does not distinguish between negative
  209.           or positive numbers. It will sort the elements in ascending order
  210.           with all the negative numbers (if existing) appearing  after  the
  211.           positive numbers in ascending order.  Make sure that the array is
  212.           of type integer. Unpredictable results may occur if not!
  213.  
  214.           Example:
  215.           dim a%(300):print "Array Before sort:"
  216.           for i%=0 to 300:a%(i%)=int(rnd(1)*30000):print a%(i%),:next
  217.           enum%=301:call bsortn(enum%,a%(0))
  218.           rem enum%=301 because there are 301 elements in the array (0-300)
  219.           print "Array After sort:":for i%=0 to 300:print a%(i%),:next
  220.           rem the list should be sorted in ascending numerical order!
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.                       --- BASDLX   Version 1.4   April 1987 ---
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.              BASDLX (C) Copyright 1986,1987 By Gustavo H. Verdun  Page 5
  248.  
  249.           Function Name: BSORTS
  250.           Arguments    : (Num_of_elements%,Array$(start_position))
  251.           Type         : String array service
  252.           Purpose      : Sorts a string array in ascending alphabetical
  253.                          order.
  254.  
  255.           Description:
  256.           The first argument should contain the number of elements to  sort
  257.           in the array. The second argument is the array itself. be sure to
  258.           specify    the    starting    position   in   the   array   [i.e.
  259.           BSORTS(elements%,a$(0))]
  260.           IMPORTANT: All of the elements  in  the  array  MUST  have  equal
  261.           lengths, if not, unpredictable results will occur to BASIC
  262.  
  263.           Example:
  264.           dim a$(10):a$(0)"First":a$(1)="Second":a$(2)="Third"
  265.           a$(3)="Fourth":a$(4)="Fifth":a$(5)="Sixth":a$(6)="Seventh"
  266.           a$(7)="Eighth":a$(8)="Ninth":a$(9)="Tenth"
  267.           for i%=0 to 9:b$=space$(10):call setl(a$(i%),b$):a$(i%)=b$:next
  268.           rem the above line will make all of the elements in the array
  269.           rem have equal lengths.
  270.           print "Array before sort:":for i%=0 to 9:print a$(i%):next
  271.           enum%=10:call bsorts(enum%,a$(0))
  272.           rem  enum%=10  because  there  are 10 elements in the array (0-9)
  273.           print "Array After sort:":for i%=0 to 9:print a$(i%):next
  274.           rem the list should be sorted in ascending alphabetical order!
  275.  
  276.           Function Name: CNFGSD
  277.           Arguments    : ([overwrite%],[insert%],[frame%],[tab%])
  278.           Type         : Configuration for GETSTRD
  279.           Purpose      : Change default settings for GETSTRD.
  280.  
  281.           Description  :
  282.           [Overwrite%] & [Insert%],  (Default is Full &  Half  size  cursor
  283.           respectively) These two arguments contain the cursor shapes  that
  284.           indicate  if overwrite or insert  is active.  The formula for the
  285.           values that must be stored in these two arguments is as  follows:
  286.           =(START  and 31)*256+STOP   Where START & STOP are the values for
  287.           cursor start & stop scan lines which must be in the range  of  0-
  288.           31.  (See the BASIC LOCATE command for more information on cursor
  289.           shapes.) NOTE: a value of zero for  these  options  leaves  their
  290.           current defaults in effect.
  291.  
  292.           [Frame%],  (Default  ASCII  95)  This argument contains the ASCII
  293.           code for the frame character.  GETSTRD draws a one line frame  of
  294.           the  length of String$ to let you see the field size.  A value of
  295.           zero for this option leaves its current default in effect.
  296.  
  297.  
  298.  
  299.  
  300.                       --- BASDLX   Version 1.4   April 1987 ---
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.              BASDLX (C) Copyright 1986,1987 By Gustavo H. Verdun  Page 6
  308.  
  309.           Function Name: CNFGSD (Continued)
  310.  
  311.           [Tab%],  (Default 1) Number of spaces to insert for a [TAB]  key.
  312.           Valid number is in the range of 0-10. A value above 10 leaves the
  313.           current default unchanged.
  314.  
  315.           Example:
  316.           oc%=(0 and 31)*256+7:ic%=(5 and 31)*256+7 'rem this is here to
  317.           'rem show the values of the default cursors.
  318.           ic%=0:oc%=:frame%=177:tab%=0:call cnfgsd(ic%,oc%,frame%,tab%)
  319.  
  320.           -In this example: Insert & overwrite cursor values are unchanged.
  321.           Frame  character  is  set  to ASCII 177.  [TAB] key will insert 0
  322.           spaces in string (disables [TAB] key).  NOTE: If ASCII 32 (space)
  323.           is not a valid key in GETSTRD then [TAB] does nothing.
  324.  
  325.           Function Name: DATESTR
  326.           Arguments    : (String_space$,Length%,mode%)
  327.           Type         : Date support
  328.           Purpose      : Reads  the  date and writes string_space$ with the
  329.                          date  in the following format: week-day month day,
  330.                          year. (i.e. Thursday, March 12, 1987)
  331.  
  332.           Description  :
  333.           The first argument,  String_space$,  must be  of    at  least  30
  334.           characters  of length.  If Length% returns with a zero then there
  335.           wasn't enough space in the  string  variable  String_space$.  The
  336.           Mode%  argument  tells the function to either write the full name
  337.           of the week-day and month or just  the  first  three  letters  of
  338.           each.  If  Mode%=0,  or any number other than one,  then the full
  339.           names of the week-day and month will be written.  If Mode%=1 then
  340.           only the first three characters of the week-day and month will be
  341.           written.  The Length% argument is used to tell BASIC the true and
  342.           final length of String_space$ (This way you easily get rid of the
  343.           trailing characters after the year since,  the actual  length  of
  344.           String_space$ will vary greatly depending on the date.)
  345.           NOTE:  String_space$  will never be any longer than 30 characters
  346.           of length.
  347.  
  348.           Example:
  349.           D$=space$(30):l%=0:mode%=0:call datestr(d$,l%,mode%)
  350.           if l%=0 then print "Not enough space in D$!":stop
  351.           d$=left(d$,l%):print "Today is ";d$
  352.           D$=space$(30):l%=0:mode%=1:call datestr(d$,l%,mode%)
  353.           if l%=0 then print "Not enough space in D$!":stop
  354.           d$=left(d$,l%):print "Today is ";d$
  355.  
  356.  
  357.  
  358.  
  359.  
  360.                       --- BASDLX   Version 1.4   April 1987 ---
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.              BASDLX (C) Copyright 1986,1987 By Gustavo H. Verdun  Page 7
  368.  
  369.           Function Name: GETSTRD (Improved in this Version)
  370.           Arguments    : (String$,length%,Validkeys$,[color%],mode%)
  371.           Type         : String/Data entry enhancement
  372.           Purpose      : This function accepts input from the keyboard  and
  373.                          stores  it  in  the  String$ argument allowing the
  374.                          use of standard editing commands.
  375.  
  376.           Description  :
  377.           To start with I will describe each of the arguments:
  378.  
  379.           String$,  This is the space where the input data will be  stored.
  380.           The  field  size  of  the input data will be set to the length of
  381.           this string.  If there is already some data in the string it will
  382.           not be erased. Just be sure to set the length to the proper value
  383.           to  let  GETSTRD  know  that there is already data in the String$
  384.           variable that is ready to be edited.  Due to the limitations that
  385.           BASIC  imposes  on assembly language with variables,  the String$
  386.           variable must be filled in to the maximum size of the field.
  387.  
  388.           Length%,  If you have a string length that is  shorter  than  the
  389.           field size that you have allocated for the data,  GETSTRD will be
  390.           able to know and upon return tell you the actual  length  of  the
  391.           string.  This  makes it easy to remove the trailing spaces in the
  392.           String$ if they are  not  important.  A  Length%  of  zero  tells
  393.           GETSTRD  that  it  is a `fresh' data field containing no previous
  394.           input.
  395.  
  396.           Validkeys$,  This is the new option added  to  GETSTRD.  If  this
  397.           string is set to null (i.e. length of 0) then GETSTRD will accept
  398.           all  keys  from ASCII 32-126,  otherwise GETSTRD will accept only
  399.           the keys  defined  in  this  string.  (Control  keys,  except  ^M
  400.           [Return],  ^[ [Escape],  ^H [Backspace],  & ^I [Tab],  are always
  401.           discarded.)
  402.  
  403.           [Color%], here,  you may specify the color attribute that GETSTRD
  404.           will  use.  The  formula  for  the  color  value  is  as follows:
  405.           Color%=(BACKGROUND and 7)*16+FOREGROUND
  406.  
  407.  
  408.           Mode%,  GETSTRD currently supports two  modes  of  operation.  If
  409.           Mode%=0  GETSTRD  will  operate  normally  without exiting unless
  410.           [ESC] or [RETURN] is pressed.  If Mode%=1  GETSTRD  will  operate
  411.           normally  except  that  if it reads from the keyboard an extended
  412.           scan code that is not one of it's editing commands it  will  exit
  413.           the  function  and return with the extended scan code to that key
  414.           in Mode%. This feature makes it easy to write programs that allow
  415.           the user to scroll through other data fields without changing  or
  416.           having  to re-enter data.  If upon exit from the GETSTRD function
  417.           Mode%=-1 then the [ESC] key was pressed and your  program  should
  418.           do whatever the [ESC] key means. If [ESC] means nothing to your
  419.  
  420.                       --- BASDLX   Version 1.4   April 1987 ---
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.              BASDLX (C) Copyright 1986,1987 By Gustavo H. Verdun  Page 8
  428.  
  429.           Function Name: GETSTRD (Continued)
  430.  
  431.           program then just go back to the line that CALLs GETSTRD and con-
  432.           tinue.
  433.  
  434.           The following Editing keys are supported:
  435.           [LEFT-ARROW]             Move cursor one space left.
  436.           [RIGHT-ARROW]            Move cursor one space right.
  437.           [HOME]                   Move cursor to beginning of line.
  438.           [END]                    Move cursor to the end of line.
  439.           (NOTE:    The end of the line is determined by the current length
  440.           of the input data and not the maximum length of the data field.)
  441.           [CTRL]-[RIGHT-ARROW]     Move cursor one word right.
  442.           [CTRL]-[LEFT-ARROW]      Move cursor one word left.
  443.           [CTRL]-[HOME]            Erase entire input field.
  444.           [CTRL]-[END]             Erase from cursor position to the end of
  445.                                    the line.
  446.           [INS]                    Set/Clear Insert mode.
  447.           [DEL]                    Deletes character at cursor position.
  448.           [BACKSPACE]              Deletes character to the left of cursor.
  449.           [TAB]                    Inserts x spaces. (See function CNFGSD)
  450.  
  451.           Example      :
  452.           10 rem This example is for mode 0.
  453.           12 mode%=0
  454.           14 c%=31:A$="":valkey$="0123456789()-" ' Valid keys for phone #.
  455.           18 l%=len(A$):b$=space$(15):call setl(a$,b$):a$=b$ 'rem add field
  456.           20 print "Enter Phone #";
  457.           22 call getstrd(a$,l%,valkey$,c%,mode%)
  458.           24 a$=left$(a$,l%):if mode%=-1 then 18
  459.           .
  460.  
  461.           10 rem this example is for mode 1.
  462.           12 mode%=1:c%=31:A$=""
  463.           18 l%=len(A$):b$=space$(25):call setl(a$,b$):a$=b$:rem add field
  464.           20 locate 10,5:print "Enter  Name : ";:valkey$=""
  465.           22 call getstrd(a$,l%,valkey$,c%,mode%)
  466.           24 a$=left$(a$,l%):if mode%=-1 then 36
  467.           26 l%=len(C$):b$=space$(15):call setl(C$,b$):C$=b$:rem add field
  468.           28 locate 11,5:print "Enter Phone # ";:valkey$="01234567890()-"
  469.           30 call getstrd(c$,l%,valkey$,c%,mode%)
  470.           32 a$=left$(c$,l%):if mode%=-1 then 36
  471.           34 if mode%=72 or mode%=80 then 18
  472.           36 print "Data A: ";a$:print "Data B: ";c$:end
  473.  
  474.  
  475.  
  476.  
  477.  
  478.  
  479.  
  480.                       --- BASDLX   Version 1.4   April 1987 ---
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487.              BASDLX (C) Copyright 1986,1987 By Gustavo H. Verdun  Page 9
  488.  
  489.           Function Name: GUN
  490.           Arguments    : ([Num_of_shots%])
  491.           Type         : Speaker support
  492.           Purpose      : Simulates the sound of a gun or machine gun
  493.  
  494.           Description  :
  495.           This  function  generates  the  sound  by sending spurts of white
  496.           noise to the speaker.  This will create the sound of a quick  ex-
  497.           plosion.  the  only  parameter  needed  is the number of shots to
  498.           fire.
  499.  
  500.           Example:
  501.           input "Number of shots to fire :",shots%:if shots%=0 then end
  502.           call gun(shots%)
  503.  
  504.           Function Name: READP
  505.           Arguments    : (Port_num%)
  506.           Type         : Printer support
  507.           Purpose      : Reads the printer status of the specified port
  508.                          number (1-3) and returns with the status byte
  509.                          for that port in the Port_num% variable.
  510.  
  511.           Description:
  512.           The status byte of contains the following information:
  513.  
  514.           bit:     7    6    5    4    3    2-1  0
  515.                    |    |    |    |    |    |    |_Time out
  516.                    |    |    |    |    |    |_Unused
  517.                    |    |    |    |    |_1 = I/O Error
  518.                    |    |    |    |_1 = Selected
  519.                    |    |    |_1 = Out of Paper
  520.                    |    |_1 = Acknowledge
  521.                    |_1 = Not Busy
  522.  
  523.           IMPORTANT: This function does not check for a valid port  number.
  524.           Be sure that the port number is in the range of 1-3
  525.  
  526.           Example:
  527.           port%=1:call readp(port%):print port%
  528.           if port% and 32=32 then print "Printer is out of paper"
  529.           if port% and 128=0 then print "Printer is Off-line"
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540.                       --- BASDLX   Version 1.4   April 1987 ---
  541.  
  542.  
  543.  
  544.  
  545.  
  546.  
  547.             BASDLX (C) Copyright 1986,1987 By Gustavo H. Verdun  Page 10
  548.  
  549.           Function Name: RESETP
  550.           Arguments    : (Port_num%)
  551.           Type         : Printer support
  552.           Purpose      : Resets the specified printer port number (1-3)
  553.                          and returns with its status byte (see the READP
  554.                          function description for information on the
  555.                          printer status byte)
  556.  
  557.           Description:
  558.           This  function  sends a  reset status through the parallel inter-
  559.           face of the specified port number.  This function does check  the
  560.           parameters  to  be sure that they are in the range of 1 to 3.  If
  561.           the Port_num% argument is equal to -1  upon return then the  port
  562.           number is not valid.
  563.  
  564.           Example:
  565.           port%=1:call resetp(port%):print port%
  566.           if port%=-1 then print"Port number must be in the range of 1-3"
  567.           if port% and 32=32 then print "Printer is out of paper"
  568.           if port% and 128=0 then print "Printer is Off-line"
  569.  
  570.           Function Name: SETL
  571.           Arguments    : (Source_string$,Destination_string$)
  572.           Type         : String manipulation
  573.           Purpose      : This function will place the source string inside
  574.                          of the destination left-justified. If the source
  575.                          string is longer than the destination string then
  576.                          the right portion of the string will be truncated.
  577.  
  578.           Description  :
  579.           This  function  automatically  clears  the  destination string to
  580.           spaces (ASCII 32) even if the source string is of length zero. Be
  581.           sure to save the destination string into the source string  after
  582.           the call.
  583.  
  584.           Example:
  585.           a$="Enter Name":b$=space(20):call setl(a$,b$):a$=b$
  586.           rem the last command "a$=b$" saves the destination string in the
  587.           rem source string since the function cant' change the length of
  588.           rem any string.
  589.           print ">";a$";"<":REM this will show you the new length of a$
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.                       --- BASDLX   Version 1.4   April 1987 ---
  601.  
  602.  
  603.  
  604.  
  605.  
  606.  
  607.             BASDLX (C) Copyright 1986,1987 By Gustavo H. Verdun  Page 11
  608.  
  609.           Function Name: SETR
  610.           Arguments    : (Source_string$,Destination_string$)
  611.           Type         : String manipulation
  612.           Purpose      : This function will place the source string inside
  613.                          the destination string right justified. If the
  614.                          destination string is shorter than the source
  615.                          string then the right portion of the string will
  616.                          be truncated.
  617.  
  618.           Description  :
  619.           This  function  automatically  sets the destination string to all
  620.           spaces (ASCII 32) even if the source string is of length zero. Be
  621.           sure to save the destination string into the source string  after
  622.           the call.
  623.  
  624.           Example:
  625.           a$="Enter Name":b$=space(20):call setr(a$,b$):a$=b$
  626.           rem the last command "a$=b$" saves the destination string in the
  627.           rem source string since the function cant' change the length of
  628.           rem any string.
  629.           print ">";a$;"<":REM this will show you the new length of a$
  630.  
  631.           Function Name: SNDOFF
  632.           Arguments    : NONE
  633.           Type         : Speaker support
  634.           Purpose      : Turns speaker off. If this function is used then
  635.                          the BASIC SOUND or BEEP commands will not work.
  636.  
  637.           Description  :
  638.           This  function  can  be  useful for those programs that use sound
  639.           prompts to get attention when input is required.  With this func-
  640.           tion  you  can  easily add the feature to your programs that will
  641.           let the user decide if he wants to have the sound prompts  on  or
  642.           off.  If  he  wants the off then at the beginning of your program
  643.           just call this function. Any sound statements following this com-
  644.           mand will execute without producing a single sound.  Be sure  not
  645.           to forget to turn them on before the program finishes (SNDON).
  646.  
  647.  
  648.           Example :
  649.           sound 200,1:sound 300,1:sound 400,1:call sndoff
  650.           sound 200,1:sound 300,1:sound 400,1
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.                       --- BASDLX   Version 1.4   April 1987 ---
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.             BASDLX (C) Copyright 1986,1987 By Gustavo H. Verdun  Page 12
  668.  
  669.           Function Name: SNDON
  670.           Arguments    : NONE
  671.           Type         : Speaker support
  672.           Purpose      : Turns sound on so that the BASIC SOUND and BEEP
  673.                          commands work.
  674.  
  675.           Description:
  676.           This function can help solve the problem that occurs when you use
  677.           some  memory resident programs that use the speaker and when they
  678.           are done the turn it off so that any SOUND or BEEP commands won't
  679.           produce an audible signal.  It can also turn on the sound when it
  680.           was turned off by the function SNDOFF!
  681.  
  682.           Example:
  683.           sound 200,1:sound 300,1:sound 400,1:call sndoff
  684.           sound 200,1:sound 300,1:sound 400,1:call sndon
  685.           sound 200,1:sound 300,1:sound 400,1
  686.  
  687.           Function Name: TIMESTR
  688.           Arguments    : (String_space$)
  689.           Type         : Time support
  690.           Purpose      : Reads  clock and loads String_space$ with the time
  691.                          in  decimal  ASCII.  The  format  is  as  follows:
  692.                          HH:MM:SS.HD
  693.                          Where, HH are hours,MM are minutes, SS are seconds
  694.                          and, HD are Hundredths of a second.
  695.  
  696.           Description  :
  697.           String_space$ must be of at least 11  characters  of  length  for
  698.           this  function  to work successfully.  If it is not of the proper
  699.           minimum length then the function will do nothing and return  with
  700.           the String_space$ unmodified.
  701.  
  702.           Example:
  703.           t$=space$(11):call timestr(t$):print t$
  704.  
  705.  
  706.           Function Name: XLC
  707.           Arguments    : (String$)
  708.           Type         : String manipulation
  709.           Purpose      : Converts the string to lower case.
  710.  
  711.           Description:
  712.           No further explanations are necessary, I hope!
  713.  
  714.           Example:
  715.           a="THIS WILL BE IN LOWER CASE!":call xlc(a$):print a$
  716.  
  717.  
  718.  
  719.  
  720.                       --- BASDLX   Version 1.4   April 1987 ---
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.             BASDLX (C) Copyright 1986,1987 By Gustavo H. Verdun  Page 13
  728.  
  729.           Function Name: XUC
  730.           Arguments    : (String$)
  731.           Type         : String manipulation
  732.           Purpose      : Converts the string to upper case.
  733.  
  734.           Description:
  735.           No further explanations are necessary, I hope!
  736.  
  737.           Example:
  738.           a="this will be in upper case!":call xuc(a$):print a$
  739.  
  740.  
  741.  
  742.  
  743.  
  744.  
  745.  
  746.  
  747.  
  748.  
  749.  
  750.  
  751.  
  752.  
  753.  
  754.  
  755.  
  756.  
  757.  
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.                       --- BASDLX   Version 1.4   April 1987 ---
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.             BASDLX (C) Copyright 1986,1987 By Gustavo H. Verdun  Page 14
  788.  
  789.                                 Summary of functions
  790.  
  791.           Please use this as a quick summary to BASDLX functions. This sum-
  792.           mary  should only be used once you understand the functions,  but
  793.           just need a quick refreshment.
  794.  
  795.           Function Name: ALLDRIVES
  796.           Arguments    : (Num_of_drives)
  797.           Type         : DOS/System
  798.           Purpose      : Returns  the  total    number  of  logical  drives
  799.                          (Diskette, Fixed, Ram, Etc.) Available.
  800.  
  801.           Function Name: ALLDIRS
  802.           Arguments    : (Dir.Array$(),Maxdirs%,Drive$,Ercd%)
  803.           Type         : DOS/System
  804.           Purpose      : Searches  and  returns  all  of the directories in
  805.                          Drive$.
  806.  
  807.           Function Name: BSORTN
  808.           Arguments    : (Num_of_elements,Integer_array%(start))
  809.           type         : integer variable service
  810.           Purpose        : Sorts   an integer array in ascending order with
  811.                          negative numbers appearing at the end  in  ascend-
  812.                          ing order.
  813.  
  814.           Function Name: BSORTS
  815.           Arguments    : (Num_of_elements%,Array$(start_position))
  816.           Type         : String service
  817.           Purpose         : Sorts  a string array in ascending alphabetical
  818.                          order.
  819.  
  820.           Function Name: CNFGSD
  821.           Arguments    : ([overwrite%],[insert%],[frame%],[tab%])
  822.           Type         : Configuration for GETSTRD
  823.           Purpose      : Change default settings for GETSTRD.
  824.  
  825.           Function Name: DATESTR
  826.           Arguments    : (String_space$,Length%,mode%)
  827.           Type         : Date support
  828.           Purpose      : Reads  the  date and writes string_space$ with the
  829.                          date in the following format: week-day month  day,
  830.                          year. (i.e. Thursday, March 12, 1987)
  831.  
  832.           Function Name: GETSTRD (Improved in this Version)
  833.           Arguments    : (String$,length%,Validkeys$,[color%],mode%)
  834.           Type         : String/Data entry enhancement
  835.           Purpose      : This  function accepts input from the keyboard and
  836.                          stores it in the  String$  argument  allowing  the
  837.                          use of standard editing commands.
  838.  
  839.  
  840.                       --- BASDLX   Version 1.4   April 1987 ---
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.             BASDLX (C) Copyright 1986,1987 By Gustavo H. Verdun  Page 15
  848.  
  849.                             Summary of functions (Cont.)
  850.  
  851.           Function Name: GUN
  852.           Arguments    : (Num_of_shots%)
  853.           Type         : Speaker support
  854.           Purpose      : Simulates the sound of a gun or machine gun
  855.  
  856.           Function Name: READP
  857.           Arguments    : (Port_num%)
  858.           Type         : Printer support
  859.           Purpose      : Reads the   printer status  of  the specified port
  860.                          number  (1-3) and returns with the status byte for
  861.                          that port in the port_num% variable.
  862.  
  863.           Function Name: RESETP
  864.           Arguments    : (Port_num%)
  865.           Type         : Printer support
  866.           Purpose      : Resets  the specified printer  port  number  (1-3)
  867.                          and  returns  with  its status byte (see the READP
  868.                          function  description  for  information   on   the
  869.                          printer status byte)
  870.  
  871.           Function Name: SETL
  872.           Arguments    : (Source_string$,Destination_string$)
  873.           Type         : String manipulation
  874.           Purpose      : This function  will place the source string inside
  875.                          of the destination left-justified.  If the  source
  876.                          string  is longer than the destination string then
  877.                          the right portion of the string will be truncated.
  878.  
  879.           Function Name: SETR
  880.           Arguments    : (Source_string$,Destination_string$)
  881.           Type         : String manipulation
  882.           Purpose      : This function will place  the source string inside
  883.                          the destination string  right  justified.  If  the
  884.                          destination  string  is  shorter  than  the source
  885.                          string then the right portion of the  string  will
  886.                          be truncated.
  887.  
  888.           Function Name: SNDOFF
  889.           Arguments    : NONE
  890.           Type         : Speaker support
  891.           Purpose      : Turns  speaker off.  If this function is used then
  892.                          the BASIC SOUND or BEEP commands will not work.
  893.  
  894.           Function Name: SNDON
  895.           Arguments    : NONE
  896.           Type         : Speaker support
  897.           Purpose      : Turns sound on so that the BASIC  SOUND  and  BEEP
  898.                          commands work.
  899.  
  900.                       --- BASDLX   Version 1.4   April 1987 ---
  901.  
  902.  
  903.  
  904.  
  905.  
  906.  
  907.             BASDLX (C) Copyright 1986,1987 By Gustavo H. Verdun  Page 16
  908.  
  909.                             Summary of functions (Cont.)
  910.  
  911.  
  912.           Function Name: TIMESTR
  913.           Arguments    : (String_space$)
  914.           Type         : Time support
  915.           Purpose      : Reads  clock and loads String_space$ with the time
  916.                          in  decimal  ASCII.  The  format  is  as  follows:
  917.                          HH:MM:SS.HD
  918.                          Where, HH are hours,MM are minutes, SS are seconds
  919.                          and, HD are Hundredths of a second.
  920.  
  921.           Function Name: XLC
  922.           Arguments    : (String$)
  923.           Type         : String manipulation
  924.           Purpose      : Converts the string to lower case.
  925.  
  926.           Function Name: XUC
  927.           Arguments    : (String$)
  928.           Type         : String manipulation
  929.           Purpose      : Converts the string to upper case.
  930.  
  931.  
  932.  
  933.  
  934.  
  935.  
  936.  
  937.  
  938.  
  939.  
  940.  
  941.  
  942.  
  943.  
  944.  
  945.  
  946.  
  947.  
  948.  
  949.  
  950.  
  951.  
  952.  
  953.  
  954.  
  955.  
  956.  
  957.  
  958.  
  959.  
  960.                       --- BASDLX   Version 1.4   April 1987 ---
  961.