home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / advbas32.arc / ADVBAS.DOC < prev    next >
Encoding:
Text File  |  1987-03-16  |  94.5 KB  |  4,699 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.                Advanced Function Library for the BASIC Compiler
  9.  
  10.  
  11.                            ADVBAS.LIB v3.2, 03/16/87
  12.  
  13.                   Copyright (C) Thomas Hanlin III, 1985-1987
  14.  
  15.                              6812 Sydenstricker Rd
  16.                              Springfield, VA 22152
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23. Requirements:
  24.  
  25.      An  IBM PC or compatible with the IBM BASIC Compiler v2.x or the Microsoft
  26. QuickBASIC  Compiler.   PC-DOS/MS-DOS  versions  2.0  or higher should be used.
  27. Some  functions  may  require  a  PC AT or compatible, as noted.  The IBM BASIC
  28. Compiler  v1.x  is  no longer supported.  If you are still using it, I strongly
  29. recommend  that  you  upgrade  to  the  Microsoft QuickBASIC compiler.  It is a
  30. great improvement, and is available (discounted) for around $75.
  31.  
  32.  
  33.  
  34. Copying and Distribution:
  35.  
  36.      ADVBAS may be copied and distributed freely EXCEPT FOR THE ASSEMBLY SOURCE
  37. CODE.   If  you  distribute  ADVBAS  on communications systems such as BBSes or
  38. CompuServe,  the Source, et al, you must include the following unmodified files
  39. as  a set (using ARC or an equivalent archive utility): ADVBAS.EXE, ADVBAS.LIB,
  40. ADVBAS.DOC,  ADVBAS.NEW,  ADVBAS.QRF,  ADVBAS.ERR,  CONTRIB.DOC.   No fee other
  41. than a disk and handling charge (of up to $10) may be charged.
  42.  
  43.      The  copyright  is  to  preserve  my  options, and to protect you from the
  44. untoward  modifications  of  others.   It is not intended to prevent the public
  45. distribution of ADVBAS, subject to the above limitations.
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74. Introduction:
  75.  
  76.      The  BASIC  Compiler  is  a  powerful and flexible tool.  However, it suf-
  77. fers  from  a  number  of  limitations.   It  is  hard  to  access  many of the
  78. capabilities  of  DOS; any feature which requires error trapping cannot be used
  79. in  a    subprogram,  or  in  a program which doesn't contain at least one line
  80. number;  the  memory  requirements are fairly substantial; and the speed is not
  81. all  that  it  might  be,  for  all its improvement over interpreted BASIC.  To
  82. reduce  these  problems,  I've  designed a number of assembly language routines
  83. which  perform  various functions, and put them in a library which the compiler
  84. can  access.   Since  I  have found these functions to be useful, I thought I'd
  85. pass  them  on  to  other  people.  You may use ADVBAS functions in any of your
  86. programs.   I'd  appreciate  it  if  you  acknowledged use of these routines in
  87. your program or documentation.
  88.  
  89.      If you find ADVBAS useful, please support the author's efforts!  A minimum
  90. contribution  of  $25  will  get  you  a  disk containing the latest version of
  91. ADVBAS,  including  source  and  object  code.  The latest version of ADVBAS is
  92. always available to previous contributors for only $10.
  93.  
  94.  
  95.  
  96. Support:
  97.  
  98.      If  you  are  a  contributor  (bless you!), I'll certainly be glad to help
  99. you with any difficulties you may encounter.  U.S. Mail is the preferred method
  100. of exchange, but feel free to call if the situation gets out of hand.
  101.  
  102.      If  you  are  not  a  contributor (sigh), please send a SASE, and I'll get
  103. back to you.  Do not phone!  If you don't care enough to contribute the minimal
  104. fee I ask, you should not expect me to provide services.  TANSTAAFL!
  105.  
  106.  
  107.  
  108. Caveats:
  109.  
  110.      These  functions  have  not  caused  me any problems, and seem to be fully
  111. debugged.   However,  I  will not be responsible for any damages caused by use,
  112. misuse,  or  inability  to use ADVBAS.  Keep in mind that ADVBAS functions will
  113. work  only  with  the  compiler,  not the interpreter.  A version of ADVBAS for
  114. the BASIC interpreter is in the works...
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140. Using ADVBAS with QuickBASIC v2.0+:
  141.  
  142.      If  you  use  QuickBASIC  in  the new programming environment, you need to
  143. have a copy of ADVBAS.EXE in the drive/subdirectory where you keep your library
  144. files  (like  BRUN20.LIB).   When  you start up QuickBASIC, you need to tell it
  145. to  load  the  ADVBAS library so you can use its features.  Run QuickBASIC with
  146. the  following  syntax: "QB  /L  ADVBAS.EXE".   Alternately,  you can specify a
  147. program  filename  as  well: "QB PROGRAM.BAS /L ADVBAS.EXE".  You can leave off
  148. the  ".BAS"  extension to the program, but you can't leave the ".EXE" extension
  149. off  ADVBAS.EXE.   Note  that  you  are  not meant to type in the quotes, which
  150. are  there  for  guidance only.  You may also need to include a drive/path spec
  151. for  ADVBAS  if  it  is in a different drive/path than the default.  That might
  152. look something like "QB /L B:ADVBAS.EXE".
  153.  
  154.  
  155.  
  156. Other BASIC Compilers:
  157.  
  158.      By  "other  BASIC  Compilers",  I  mean other versions of Microsoft or IBM
  159. BASIC  Compilers.   As  far  as  I  know,  ADVBAS  cannot  be used with ZBASIC,
  160. BetterBASIC,  True  BASIC,  or other variations of BASIC.  With that in mind...
  161. Copy  ADVBAS.LIB  to  the  disk  on  which you keep your BASIC Compiler library
  162. files.   For  programs  which  use  ADVBAS  functions, specify ADVBAS when LINK
  163. asks  you  which  libraries  to  use.  That is, at the LINKer prompt "Libraries
  164. [.LIB]:"  you  should  say  "ADVBAS"  (without  the  quotes!).  You may need to
  165. provide  a  drive/path spec if your program is not in the same area that ADVBAS
  166. is,  and if you don't have a SET LIB in your autoexec file to tell the compiler
  167. where the library is (only newer versions of the compilers have this feature). 
  168.  
  169.  
  170.  
  171. Other languages:
  172.  
  173.      A  version  of  ADVBAS  is  progress  for the BASIC Interpreter (BASICA or
  174. GWBASIC).
  175.      An  initial  version  for  Microsoft C is now available, under the name of
  176. ADVC.   It  is in C source format, so you can convert any nonstandard functions
  177. to  your  own  variety of C.  If you can't find it on your local BBS, I'll send
  178. you a copy for the recommended minimum contribution of $15.
  179.  
  180.  
  181.  
  182. Advantages of ADVBAS:
  183.  
  184.      1) Adds abilities which are not otherwise available.
  185.      2) Is generally faster than the corresponding Compiled BASIC code.
  186.      3) Usually takes up less space in the resulting EXEcutable file.
  187.      4) Often leaves more free programming space.
  188.      5) Provides a useful library of tested basic routines.
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.                                 Operation Notes
  207.  
  208.  
  209.  
  210.  
  211. Function Requirements:
  212.  
  213.      Numeric variables used in function calls must be integers unless specified
  214. otherwise.   Either  declare  them  using  DEFINT, or add a percent sign "%" to
  215. the end of the variable name.
  216.      Strings  must  sometimes  be  defined  to a certain minimum length, due to
  217. limitations on what assembly language routines are allowed to do to strings. 
  218.      Dynamic  Arrays  are  NOT SUPPORTED.  Use only normal (Static) arrays when
  219. a function requires an array.  Dynamic arrays are not passed to called routines
  220. in  any  sensible  manner,  but I'll try to come up with some way to handle 'em
  221. in a future version of ADVBAS.
  222.  
  223.  
  224.  
  225. Compatibility:
  226.  
  227.      These  functions  vary  in  what  they  demand of your PC.  Some functions
  228. will  work  only  on IBM PCs or clones, some will work on compatibles, and some
  229. will  work  on  any  MS-DOS  routine.  The compatibility level of each function
  230. is  now  listed,  using the categories CLONE (will work on hardware compatibles
  231. only),  BIOS  (close  compatibles), DOS (any MS-DOS machine), and ANY (hardware
  232. independent).  Be warned that the BASIC Compiler itself does not produce parti-
  233. cularly  compatible  code  (BASIC  video  routines  seem to be BIOS-compatible,
  234. etc).
  235.  
  236.  
  237. QuickBASIC 2.0+:
  238.  
  239.      See  the  operation  notes  at the beginning of this document.  Other than
  240. that,  all  functions  should  work  as  expected  in  either  command-line  or
  241. programming-environment modes.
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.                                Routine Reference
  273.  
  274.  
  275.  
  276.  
  277. Disk:
  278.      CopyFile:  copy a file
  279.      DelSub, GetSub, MakeSub, SetSub:  subdirectory handling
  280.      DiskStat:  assorted disk status information
  281.      DrvSpace:  space left on a given drive
  282.      Exist:  see if a file exists
  283.      Fclose, Fcreate, Fopen, Fread, FsetEnd, FsetRec, Fclose:  file read/write
  284.      FindFirstF, FindNextF:  handle file(s) with wildcards
  285.      GetDrv, SetDrv:  get/set the default drive
  286.      GetFdate, GetFtime, SetFTD, GetFattr, SetFattr:  file info control
  287.      GetNameF, GetDateF, GetTimeF, GetAttrF, GetSizeF: file dir control
  288.      Mload:  a BLOAD routine
  289.      SubExist:  see if a subdirectory exists
  290.  
  291. Input:
  292.      ClrKbd:  clear the keyboard buffer of pending keys
  293.      DosInkey:  get a key using DOS standard input
  294.      GetKbd, SetKbd:  get/set the status of the keyboard toggles
  295.      GetKey:  get one of a list of valid keys
  296.      KeyPress:  see if a key has been pressed
  297.  
  298.      MMcursorOn, MMcursorOff:         mouse cursor control
  299.      MMgetloc, MMsetloc, MMsetrange:  mouse display control
  300.      MMbutton, MMcheck, MMclick:      mouse status info
  301.  
  302. String:
  303.      Bsq, BusqLen, Busq:  text compression/decompression
  304.      Checksum, CRC:  error checking (for telecomm and other uses)
  305.      DateN2S, DateS2N:  convert the date (numbers <--> string)
  306.      Extract:  extract delimited substrings from a string using an index
  307.      Locase, Upcase:  case conversion
  308.      MultiAnd, MultiOr, MultiXor:  bit manipulations on chars in a string
  309.      Strip, StripRange:  deletion of certain chars from a string
  310.      LRotate, RRotate, Reverse:  reorder chars in a string
  311.      Soundex:  return the Soundex code of a string
  312.      TimeN2S, TimeS2N:  convert the time (numbers <--> string)
  313.      Tinstr:  return the position of a given type of char within a string
  314.      Xlate:  run the chars of a string through a translation table
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.                                Routine Reference
  339.  
  340.  
  341.  
  342.  
  343. Array:
  344.      AddMatI, SetMatI:  integer array manipulation
  345.      ReadBitF, WriteBitF:  handle arrays of arbitrary bit length
  346.  
  347. Video:
  348.      CalcAttr:  calculate attribute from fore and background colors
  349.      DMprint, Mprint, MprintC, Qprint, XQprint:  various print routines
  350.      ClrEol, BkSpace, DelChr, InsChr, MDelChr, MInsChr:  screen control
  351.      GetCRT:  get display type (mono or color)
  352.      MakeWindow:  make pop-up windows
  353.      Mwindow, Scroll, BkScroll:  display window control
  354.      PrintScreen:  print out the display to the default printer
  355.      ScrSave, ScrRest, GetLine:  save/restore the contents of a screen
  356.      ScrSaveP, ScrSavePD, ScrRestP, ScrRestPD:  variants on the above
  357.      GetScreen, PutScreen:  new flexible screen save/restore routines
  358.      ReColor: change any screen color to another w/o clearing screen
  359.      ResetPoint, SetPoint, TestPoint:  low-res graphics in text mode
  360.  
  361. Miscellaneous:
  362.      Any2Dec, Dec2Any:  radix conversion (decimal <--> another base)
  363.      BlockMove:  move a block of data from one area of memory to another
  364.      DataSeg:  return the value of the default Data Segment
  365.      Date2int, Int2date:  date compression
  366.      Delay, Delay18th:  delay for a given amount of time
  367.      DTR:  turn the communications line "DTR" on or off
  368.      Equipment:  get hardware info about memory and installed ports
  369.      GetDOSv:  get the version number of the MS-DOS being used
  370.      GetExtM:  return the amount of extended memory (AT systems only)
  371.      GetLIMM:  get the status of expanded memory in the system
  372.      Month:  given a month number, returns the name of the month
  373.      SetComm:  set up any comm port to any baud, without closing communications
  374.      ShiftL, ShiftR:  shift an integer left/right by a given number of bits
  375.      Speaker:  turns sound effects on or off
  376.      Time2int, Int2time:  time compression
  377.      WeekDay:  returns the day of the week, Sunday through Saturday
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.                               Compatibility Chart
  405.  
  406.  
  407.  
  408.  
  409. Works on ANY machine:
  410.  
  411.      ADDMATI,  ANY2DEC,  BLOCKMOVE,  BSQ,  BUSQ,  BUSQLEN,  CALCATTR, CHECKSUM,
  412. CRC,  DATASEG, DATE2INT, DEC2ANY, EXTRACT, GETLINE, INT2DATE, INT2TIME, LOCASE,
  413. LROTATE,  MONTH,  MULTIAND,  MULTIOR,  MULTIXOR,  READBITF,  REVERSE,  RROTATE,
  414. SETMATI,  SHIFTL, SHIFTR, SOUNDEX, STRIP, STRIPRANGE, TIME2INT, TINSTR, UPCASE,
  415. WRITEBITF, XLATE
  416.  
  417.  
  418.  
  419. Works on DOS compatibles:
  420.  
  421.      COPYFILE,  DELSUB,  DISKSTAT,  DMPRINT, DOSINKEY, DRVSPACE, EXIST, FCLOSE,
  422. FCREATE,   FINDFIRSTF,  FINDNEXTF,  FOPEN,  FREAD,  FSETEND,  FSETREC,  FWRITE,
  423. GETATTRF,  GETDATEF,  GETDOSV,  GETDRV, GETFATTR, GETFDATE, GETFTIME, GETNAMEF,
  424. GETSIZEF,  GETSUB,  GETTIMEF, MAKESUB, MLOAD, SETDRV, SETFATTR, SETFTD, SETSUB,
  425. SUBEXIST, WEEKDAY
  426.  
  427.  
  428.  
  429. Works on BIOS compatibles (* if it requires the AT BIOS):
  430.  
  431.      BKSCROLL,  BKSPACE,  CLRKBD,  CLREOL,  DATEN2S, DATES2N, DELAY, DELAY18TH,
  432. EQUIPMENT,  GETCRT,  GETEXTM*,  GETKEY,  GETLIMM,  KEYPRESS,  MDELCHR, MINSCHR,
  433. MMBUTTON,   MMCHECK,  MMCLICK,  MMCURSOROFF,  MMCURSORON,  MMGETLOC,  MMSETLOC,
  434. MMSETRANGE,   MPRINT,  MPRINTC,  MWINDOW,  PRINTSCREEN,  RESETPOINT,  SETPOINT,
  435. SCROLL, TESTPOINT, TIMEN2S, TIMES2N, XMPRINT
  436.  
  437.  
  438.  
  439. Works on CLONEs (hardware compatibles):
  440.  
  441.      DELCHR,  DTR,  GETKBD,  GETSCREEN,  INSCHR, MAKEWINDOW, PUTSCREEN, QPRINT,
  442. RECOLOR,  SCRREST,  SCRRESTP, SCRRESTPD, SCRSAVE, SCRSAVEP, SCRSAVEPD, SETCOMM,
  443. SETKBD, SPEAKER, XQPRINT, XQPRINTD
  444.  
  445.  
  446.  
  447.      Note  that  routines from higher sections will work on machines from lower
  448. sections  (DOS-level  routines  will  work  on BIOS- and CLONE-level machines).
  449. It  doesn't  work  the  other  way around (CLONE-level routines may not work on
  450. a DOS-level machine).
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470. Name: ADDMATI
  471.  
  472. Type: Miscellaneous / ANY
  473.  
  474. Description:
  475.      Adds a scalar (integer) value to the first SIZ elements of an
  476. integer  array.   You can subtract by adding a negative number.  If the results
  477. of the calculation ever go outside integer range (-32768 to 32767), the
  478. overflow flag is set on return.  See SETMATI for more information.
  479.  
  480. Example:
  481.      DEFINT A-Z: OPTION BASE 1: DIM ACK(10000): SIZ=10000
  482.       .
  483.       .
  484.      ADDVAL=-6: ARLOC=VARPTR(ACK(1))
  485.      CALL ADDMATI(ARLOC,SIZ,ADDVAL,OVFLOW)
  486.      IF OVFLOW THEN PRINT"Uh oh, overflowed somewhere..."
  487.      REM  we just subtracted six from each element of the array ACK.
  488.  
  489.  
  490.  
  491.  
  492. Name: ANY2DEC
  493.  
  494. Type: Miscellaneous / ANY
  495.  
  496. Description:
  497.      Converts  a  number  (in  string  form)  from any base (2-35) to a decimal
  498. integer  (base 10).  The number to be converted may be in either signed integer
  499. range  (-32768  to  32767)  or unsigned integer range (0 to 65535).  It is con-
  500. verted to a signed integer, which is the only integer type BASIC supports.
  501.  
  502. Example:
  503.      INPUT"Number, base of number";ANUM$,NBASE
  504.      CALL ANY2DEC(ANUM$,NBASE,DNUM,ERCD)
  505.      IF ERCD THEN PRINT"Bad number!" ELSE PRINT"Decimal: ";DNUM
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536. Name: BLOCKMOVE
  537.  
  538. Type: Miscellaneous / ANY
  539.  
  540. Description:
  541.      Copies  information  from  one  area of memory to another.  You supply the
  542. source  segment  and  offset,  destination  segment and offset, number of bytes
  543. to  move  (0  -  65535),  and  direction (0: forward; nonzero, backward).  This
  544. can  be  used,  for  instance,  to duplicate arrays (with the assistance of the
  545. DATASEG function and BASIC's VARPTR function).
  546.  
  547. Example:
  548.      CALL BLOCKMOVE(FROMSEG,FROMOFFSET,TOSEG,TOOFFSET,BYTES,DIRECTION)
  549.  
  550.  
  551.  
  552.  
  553. Name: BKSCROLL
  554.  
  555. Type: Video / BIOS
  556.  
  557. Description:
  558.      The  same  as  SCROLL  (q.v.), but scrolls lines in the opposite direction
  559. (Back Scroll).
  560.  
  561. Example:
  562.      CALL BKSCROLL(LEFTCOL,TOPROW,RTCOL,BOTROW,NUMLINES)
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.  
  602. Name: BKSPACE
  603.  
  604. Type: Video / BIOS
  605.  
  606. Description:
  607.      Move  cursor  back  one space, destroying the character on the space moved
  608. to.   Will  wrap  from one line to the next higher if necessary.  If at the top
  609. left  corner  of  the screen, no action is performed.  Two arguments return the
  610. new  cursor coordinates, since machine language programs cannot directly change
  611. the BASIC cursor position.  Works with 40 or 80 column screens.
  612.  
  613. Example:
  614.      CALL BKSPACE(COL,ROW) : LOCATE ROW,COL
  615.  
  616.  
  617.  
  618.  
  619. Name: BSQ
  620.  
  621. Type: String / ANY
  622.  
  623. Description:
  624.      Uses  several  techniques to compress blank spaces out of an ASCII string.
  625. Savings  range  from 16% (reliable, for ordinary text) to up around 50% or more
  626. for space-intensive info, such as lines in an assembly source file.  BSQ cannot
  627. handle  more  than 127 spaces in a row on a single line, or lines which contain
  628. ASCII   characters   greater   than   127   (which  are  IBM-specific  graphics
  629. characters).   Do  not  use  BSQ  on  lines which may contain such information!
  630. BSQ  compression  is  designed to produce printable (if odd-looking) text which
  631. you may read/write to ordinary sequential files.
  632.  
  633. Example:
  634.      INPUT"String to squeeze";ST$: CALL BSQ(ST$,SLEN)
  635.      PRINT"Squeezed string: ";LEFT$(ST$,SLEN)
  636.  
  637.  
  638.  
  639.  
  640. Name: BUSQ
  641.  
  642. Type: String / ANY
  643.  
  644. Description:
  645.      Decompresses  a  line  squeezed  by  BSQ.  Use BUSQLEN before this routine
  646. to find out how long the unsqueezed line will be!
  647.  
  648. Example:
  649.      see BUSQLEN
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668. Name: BUSQLEN
  669.  
  670. Type: String / ANY
  671.  
  672. Description:
  673.      Tells  how  long  a  line  squeezed with BSQ will be once it's unsqueezed.
  674. You must use this before unsqueezing the line with BUSQ.
  675.  
  676. Example:
  677.      CALL BUSQLEN(ST$,SLEN)
  678.      IF SLEN<0 THEN line is not squeezed, or got damaged somehow-- exit!
  679.      ELSE UNSQ$=SPACE$(SLEN): CALL BUSQ(ST$,UNSQ$)
  680.  
  681.  
  682.  
  683.  
  684. Name: CALCATTR
  685.  
  686. Type: Video / ANY
  687.  
  688. Description:
  689.      Calculates  the  color  attribute  for  such  routines as XQPRINT.  Unlike
  690. the BASIC formula it replaces, CALCATTR allows use of the "blink" attribute.
  691.  
  692. Example:
  693.      REM  old formula was  ATTR = (BACKGND AND 7)*16 + FOREGND
  694.      CALL CALCATTR(FOREGND,BACKGND,ATTR)
  695.  
  696.  
  697.  
  698.  
  699. Name: COPYFILE
  700.  
  701. Type: Disk / DOS
  702.  
  703. Description:
  704.      Copies  a  file.   This  is faster than the corresponding DOS command, and
  705. doesn't  have the overhead of using the SHELL command.  Note: to avoid possibly
  706. wiping  out  an  existing  file on the destination end, you may wish to use the
  707. EXIST function before this one.
  708.      The copy will usually fail for one of two reasons: the source file doesn't
  709. exist, or there is not enough room on the disk for the destination file.
  710.  
  711. Example:
  712.      SOURCE$ = "A:EXAMPLE.TXT" + CHR$(0)
  713.      DESTINATION$ = "C:\DOCUMENT\EXAMPLE.TXT" + CHR$(0)
  714.      CALL COPYFILE(SOURCE$,DESTINATION$,ERRCODE)
  715.      IF ERRCODE THEN PRINT"The copy failed"
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.  
  734. Name: CHECKSUM
  735.  
  736. Type: Miscellaneous / ANY
  737.  
  738. Description:
  739.      Calculates a checksum for a record.  Can be used with Xmodem or Ymodem.
  740.  
  741. Example:
  742.      CALL CHECKSUM(REC$,CHKSM)
  743.  
  744.  
  745.  
  746.  
  747. Name: CLREOL
  748.  
  749. Type: Video / BIOS
  750.  
  751. Description:
  752.      Clears  from  the  cursor  position  to the end of the line without moving
  753. the cursor.
  754.  
  755. Example:
  756.      CALL CLREOL
  757.  
  758.  
  759.  
  760.  
  761. Name: CLRKBD
  762.  
  763. Type: Input / BIOS
  764.  
  765. Description:
  766.      Clears any pending keys from the keyboard buffer.
  767.  
  768. Example:
  769.      CALL CLRKBD
  770.      INPUT"File not found.  Continue (Y/N)";ANS$
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.  
  800. Name: CRC
  801.  
  802. Type: Miscellaneous / ANY
  803.  
  804. Description:
  805.      Calculates  a  cyclical  redundancy check value for a record.  Can be used
  806. with Xmodem CRC or Ymodem CRC.
  807.  
  808. Example:
  809.   Sending a record:
  810.      REC$=REC$+STRING$(2,0) : CALL CRC(REC$,HICRC,LOCRC) :
  811.      MID$(REC$,LEN(REC$)-1,2) = CHR$(HICRC)+CHR$(LOCRC) : send Xmodem record
  812.   Receiving a record:
  813.      CALL CRC(REC$,HICRC,LOCRC) : IF HICRC=0 AND LOCRC=0
  814.           THEN record is fine, save it
  815.           ELSE record is bad, request it to be sent again
  816.  
  817.  
  818.  
  819.  
  820.  
  821.  
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.  
  866. Name: DATASEG
  867.  
  868. Type: Miscellaneous / ANY
  869.  
  870. Description:
  871.      Returns  BASIC's  data segment.  This is useful for BLOCKMOVE, among other
  872. things.
  873.  
  874. Example:
  875.      CALL DATASEG(DSEG)
  876.  
  877.  
  878.  
  879.  
  880. Name: DATE2INT
  881.  
  882. Type: Miscellaneous / ANY
  883.  
  884. Description:
  885.      Compresses  a  date  down  to a single integer, to reduce storage require-
  886. ments.   The  date is assumed to be valid.  The year should be within the range
  887. 1900-2026 (0-99 is ok, and is assumed to be 1900-1999).  See also INT2DATE.
  888.  
  889. Example:
  890.      CALL DATE2INT(MONTH,DAY,YEAR,SQZDATE)
  891.  
  892.  
  893.  
  894.  
  895. Name: DATEN2S
  896.  
  897. Type: String / ANY
  898.  
  899. Description:
  900.      Converts  the  date  from  numeric  form to a string.  You must reserve at
  901. least eight characters for the string.
  902.  
  903. Example:
  904.      MONTH = 3: DAY = 2: YEAR = 1987: REM  We could use MONTH=87 here
  905.      DAT$ = SPACE$(8)
  906.      CALL DATEN2S(MONTH,DAY,YEAR,DAT$)
  907.      REM  From this, we will get DAT$ = "03/02/87"
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.  
  932. Name: DATES2N
  933.  
  934. Type: String / ANY
  935.  
  936. Description:
  937.      Converts  the  date  from  a  string to numeric form.  The date string may
  938. be in either BASIC format ("03-15-1987") or normal format ("03/15/87").
  939.  
  940. Example:
  941.      CALL DATES2N(MONTH,DAY,YEAR,DATE$)
  942.  
  943.  
  944.  
  945.  
  946. Name: DEC2ANY
  947.  
  948. Type: Miscellaneous / ANY
  949.  
  950. Description:
  951.      Converts  a  number  from decimal (base 10) to any other base (2-35).  The
  952. number  will  be  converted  to  an unsigned integer (signed range of -32768 to
  953. 32767  is  converted  to  unsigned  range  of  0 to 65535), to conform with the
  954. built-in  BASIC  conversion functions HEX$ and OCT$.  ANUM$ must be initialized
  955. to  the maximum size you expect the resultant number to be; this is recommended
  956. to  be  16  characters,  which  is  the maximum length possible.  The result is
  957. right-justified  in  the  field  you  provide,  so  if you want to keep leading
  958. zeroes, just ignore the actual-length specification ALEN.
  959.  
  960. Example:
  961.      INPUT"Decimal number, to base";DNUM,NBASE
  962.      ANUM$ = STRING$(16,"0"): CALL DEC2ANY(DNUM,NBASE,ANUM$,ALEN)
  963.      IF ALEN<0 THEN PRINT"Bad base or ANUM$ initialized too short"
  964.      ELSE PRINT"Result: ";RIGHT$(ANUM$,ALEN)
  965.  
  966.  
  967.  
  968.  
  969.  
  970.  
  971.  
  972.  
  973.  
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.  
  998. Name: DELAY
  999.  
  1000. Type: Miscellaneous / BIOS
  1001.  
  1002. Description:
  1003.      Delays  for a given number of seconds.  This is based on the system clock,
  1004. and will delay for the same amount of time on an 8088 or 80286-based computer.
  1005. It is normally accurate to about one percent.
  1006.  
  1007. Example:
  1008.      SECONDS=60
  1009.      CALL DELAY(SECONDS)
  1010.      REM  sit and "do nothing" for one minute
  1011.  
  1012.  
  1013.  
  1014.  
  1015. Name: DELAY18TH
  1016.  
  1017. Type: Miscellaneous / BIOS
  1018.  
  1019. Description:
  1020.      Delays  for  a  given  number  of eighteenths of seconds.  Otherwise, this
  1021. is identical to DELAY (see).
  1022.  
  1023. Example:
  1024.      MINIDELAY=9
  1025.      CALL DELAY18TH(MINIDELAY)
  1026.      REM  delay for half a second (9/18 = 1/2 second)
  1027.  
  1028.  
  1029.  
  1030.  
  1031. Name: DELCHR
  1032.  
  1033. Type: Video / CLONE
  1034.  
  1035. Description:
  1036.      Deletes  a character from the specified location on the screen.  The char-
  1037. acter  at  that  location  will  disappear,  and all characters to the right of
  1038. it  on  the  same  screen  line will be shifted left one space.  The first page
  1039. only (on color monitors) is supported, and graphics modes won't work.
  1040.  
  1041. Example:
  1042.      COL = POS(0): ROW = CSRLIN: CALL DELCHR(ROW,COL)
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.  
  1064. Name: DELSUB
  1065.  
  1066. Type: Disk / DOS
  1067.  
  1068. Description:
  1069.      Deletes  a  subdirectory.   Parameters  used  are  the  same as in SETSUB.
  1070. Note  that  you  may  not delete a subdirectory if it has any files left in it,
  1071. or if it is the main directory, or if it is the current default subdirectory.
  1072.  
  1073. Example:
  1074.      TMP$ = SUB$+CHR$(0): CALL DELSUB(TMP$,ERRCODE)
  1075.      IF ERRCODE THEN couldn't delete subdir ELSE subdir deleted
  1076.  
  1077.  
  1078.  
  1079.  
  1080. Name: DISKSTAT
  1081.  
  1082. Type: Disk / DOS
  1083.  
  1084. Description:
  1085.      Returns  status information for a given disk drive.  The drive spec should
  1086. be  a  letter,  or  use  "@"  for the default drive.  Information returned will
  1087. be  Free  Clusters,  Total Clusters, Bytes per Sector, and Sectors per Cluster.
  1088. This  will  enable  you  to  calculate  the total space on the disk, free space
  1089. left  on  the  disk,  the actual amount of space a file takes up, and so forth.
  1090. A  "cluster"  is  the  minimum  block of space that can be allocated on a disk.
  1091. The  actual  amount  of  space  taken up by a file depends on the cluster size.
  1092. If  the  cluster  size  is 1024 bytes, any file that is listed as being between
  1093. 1  and  1024  bytes  will take up 1024 bytes of disk space.  Any file listed as
  1094. having 1025 - 2047 bytes will take up 2048 bytes (1024 * 2), and so on.
  1095.  
  1096. Example:
  1097.      DRIVE$ = "@":  REM  Use the default drive
  1098.      CALL DISKSTAT(DRIVE$,FREE.CLUST,TOTAL.CLUST,BYTES.SEC,SECS.CLUST)
  1099.      CLUSTER.SIZE# = CDBL(BYTES.SEC) * CDBL(SECS.CLUST)
  1100.      FREE.DISK.SPACE# = CDBL(FREE.CLUST) * CLUSTER.SIZE#
  1101.      TOTAL.DISK.SPACE# = CDBL(TOTAL.CLUST) * CLUSTER.SIZE#
  1102.      PRINT "There are";FREE.DISK.SPACE#;" bytes free out of a total of";
  1103.      PRINT TOTAL.DISK.SPACE#;" with a cluster size of";CLUSTER.SIZE#;" bytes"
  1104.  
  1105.  
  1106.  
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.  
  1130. Name: DMPRINT
  1131.  
  1132. Type: Video / DOS
  1133.  
  1134. Description:
  1135.      Displays  a  string  at  the  current cursor position, using DOS calls for
  1136. output (so device drivers such as ANSI.SYS will work).  This routine is consid-
  1137. erably faster than MPRINT (q.v.), but offers fewer amenities.  Character trans-
  1138. lation  is  limited to what DOS provides, meaning that, for instance, Backspace
  1139. just  moves  the  cursor back without wiping out the previous character.  Other
  1140. control  codes may not be translated as you might hope, either.  Finally, since
  1141. DOS  provides  no way of finding the current print position, you have to figure
  1142. out  where  the cursor will be yourself if you need it (like other display rou-
  1143. tines,  DMPRINT  does not update the BASIC cursor position).  You can gain con-
  1144. trol  of  such  things  by  using the ANSI.SYS driver.  See your DOS manual for
  1145. more information on that.
  1146.  
  1147. Example:
  1148.      CALL DMPRINT(ST$)
  1149.  
  1150.  
  1151.  
  1152.  
  1153. Name: DOSINKEY
  1154.  
  1155. Type: Keyboard / DOS
  1156.  
  1157. Description:
  1158.      Gets a key from the standard input device.  This is normally the keyboard,
  1159. but  redirection is allowed (to a file, or to a port via CTTY).  Two parameters
  1160. are returned: the first gives the key code, if any, and the second gives status
  1161. information.   If  the CHRTYPE is zero, there is no key pressed.  If it is one,
  1162. the  key  returned  is  a  normal  keypress.  If it is two, the key returned is
  1163. the code of an Extended ASCII key (like a function key or arrow key).
  1164.  
  1165. Example:
  1166.      REM  This is an INKEY$-oriented routine to get a keypress.
  1167.      KY$ = ""
  1168.      WHILE KY$=""
  1169.          KY$ = INKEY$
  1170.      WEND
  1171.      IF LEN(KY$)=2 THEN EXTCODE = -1 : KY$ = RIGHT$(KY$,1) : RETURN
  1172.      EXTCODE = 0 : RETURN
  1173.  
  1174.      REM  This is the same routine, using DOSINKEY.
  1175.      CHRTYPE = 0
  1176.      WHILE CHRTYPE=0
  1177.           CALL DOSINKEY(CHRCODE,CHRTYPE)
  1178.      WEND
  1179.      KY$ = CHR$(CHRCODE)
  1180.      IF CHRTYPE=2 THEN EXTCODE = -1 : RETURN
  1181.      EXTCODE = 0 : RETURN
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.  
  1196. Name: DRVSPACE
  1197.  
  1198. Type: Disk / DOS
  1199.  
  1200. Description:
  1201.      Returns  the  amount  of free space left on a given disk drive.  The drive
  1202. string  may  be  any  legal disk drive, or "@" (AT sign) for the default drive,
  1203. and  must  be  at  least  one  character long.  An illegal drive or other error
  1204. will cause free space to be returned as a negative value.
  1205.  
  1206. Example:
  1207.      DRV$="A:"
  1208.       .
  1209.       .
  1210.      CALL DRVSPACE(DRV$,A,B,C): FREE# = CDBL(A)*CDBL(B)*CDBL(C)
  1211.      PRINT"Free space on drive ";DRV$;" is";FREE#;"bytes."
  1212.  
  1213.  
  1214.  
  1215.  
  1216. Name: DTR
  1217.  
  1218. Type: Miscellaneous / CLONE
  1219.  
  1220. Description:
  1221.      Switches  the  communications  signal  "DTR"  on  or off.  Turning the DTR
  1222. off  has  the  effect  of  making most modems drop carrier (hang up the phone).
  1223. The  comm  port should be one or two.  Use zero to turn the DTR off, or nonzero
  1224. to turn it back on.
  1225.  
  1226. Example:
  1227.      COMMPORT = 1
  1228.      TOGGLE = 0   : REM  turn the DTR off
  1229.      CALL DTR(COMMPORT,TOGGLE)
  1230.  
  1231.  
  1232.  
  1233.  
  1234. Name: EQUIPMENT
  1235.  
  1236. Type: Miscellaneous / BIOS
  1237.  
  1238. Description:
  1239.      Returns  basic  information  about  the hardware configuration of the com-
  1240. puter: memory  installed,  in  kilobytes;  number  of parallel (printer) ports,
  1241. 0-3; number of RS232 serial (comm) ports, 0-7; and number of game ports, 0-1.
  1242.  
  1243. Example:
  1244.      CALL EQUIPMENT(MEMORY,PARALLEL,SERIAL,GAME)
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.  
  1262. Name: EXIST
  1263.  
  1264. Type: Disk / DOS
  1265.  
  1266. Description:
  1267.      Tells  you  if  a  given file already exists.  Returns zero if it doesn't,
  1268. or  a  nonzero value if it does.  Requires an ASCIZ filename without wildcards.
  1269. If you need to use wildcards, see the FINDFIRSTF function.
  1270.  
  1271. Example:
  1272.      FIL$ = "TEST.TXT" + CHR$(0)
  1273.      CALL EXIST(FIL$,FILEXISTS)
  1274.      IF FILEXISTS THEN PRINT "File already exists"
  1275.  
  1276.  
  1277.  
  1278.  
  1279. Name: EXTRACT
  1280.  
  1281. Type: String / ANY
  1282.  
  1283. Description:
  1284.      Extracts  a  delimited  substring  from a string given an index.  Requires
  1285. a  string  of  any  length,  a  delimiter of length one character, and an index
  1286. value  from  1-256;  returns the starting location and length of the substring.
  1287. If  the  delimiter  is  null  (an error), the substring length will be returned
  1288. as  -1.  If the index value is greater than the number of delimited substrings,
  1289. a null substring will be returned.
  1290.  
  1291. Example:
  1292.      ST$="John Doe/15 Maple Rd/Hometown, CA 99199/(300) 111-1111"
  1293.      INDEX=2
  1294.      DELIMITER$="/"
  1295.      CALL EXTRACT(ST$,DELIMITER$,INDEX,START,SLEN)
  1296.      PRINT MID$(ST$,START,SLEN)
  1297.      REM  This will print the second substring (INDEX=2) of the string
  1298.      REM  (ST$) delimited by "/" (DELIMITER$), which in this case will
  1299.      REM  be "15 Maple Rd".
  1300.  
  1301.  
  1302.  
  1303.  
  1304.  
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.  
  1328. Name: FCLOSE
  1329.  
  1330. Type: Disk / DOS
  1331.  
  1332. Description:
  1333.      Closes a file opened by MOPEN (q.v.)
  1334.  
  1335. Related functions: MCREATE, MOPEN, MREAD, MSETEND, MSETREC, MWRITE.
  1336.  
  1337. Example:
  1338.      CALL FCLOSE(HANDLE)
  1339.  
  1340.  
  1341.  
  1342.  
  1343. Name: FCREATE
  1344.  
  1345. Type: Disk / DOS
  1346.  
  1347. Description:
  1348.      Opens  a file with a given attribute for read/write access in normal mode.
  1349. If  the  file  doesn't  exist, it's created; if it does, it's set to zero bytes
  1350. in  length.   A  "handle" is returned, which is used to identify the file (like
  1351. BASIC's file numbers).  See FOPEN for an explanation of modes.  For more infor-
  1352. mation, see the end of this manual.
  1353.  
  1354. Related functions: FOPEN, FREAD, FSETEND, FSETREC, FWRITE.
  1355.  
  1356. Example:
  1357.      FIL$ = "TEST.TXT" + CHR$(0)
  1358.      ATTR = 0
  1359.      CALL FCREATE(FIL$,ATTR,TEST.HANDLE,ERRCODE)
  1360.      IF ERRCODE THEN PRINT "Couldn't create file"
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394. Name: FINDFIRSTF
  1395.  
  1396. Type: Disk / DOS
  1397.  
  1398. Description:
  1399.      Given  a  filename  (which  may  contain  the wildcards "*" and "?", and a
  1400. drive  and  path  spec  if  you like), this searches the default (or specified)
  1401. directory  to  find  the  first matching file.  Further matches can be obtained
  1402. through  the  FINDNEXTF  routine (q.v.).  If there is a match, ERCD will return
  1403. zero,  otherwise  it  will  return  a positive value (unless you entered a null
  1404. filename,  in  which  case ERCD will be -1 to flag an error).  You can retrieve
  1405. various  information  about  the  matched  file  via  a number of supplementary
  1406. functions: GETNAMEF to get the filename, GETATTRF to get the attribute (there's
  1407. a  page  at the end of this document on file attributes), GETDATEF and GETTIMEF
  1408. to  get  the date and time, and GETSIZEF to get the file size.  You may specify
  1409. a  search  attribute as well: 0 (zero) to match normal files, 2 to match hidden
  1410. files,  4  for  system files, and 16 for subdirectories.  Attributes other than
  1411. zero  will return normal files as well as the specified type, and you can match
  1412. on  more  than  one kind of attribute (for instance, to get all kinds of files,
  1413. you'd  use an attribute of 22, or 2+4+16).  You can read the volume label using
  1414. an  attribute  of  8,  which  will  return only the volume label... supposedly.
  1415. In  actual  practice,  the  read-volume-label routine is not entirely reliable,
  1416. so  be  sure  to  check  the attribute of the matched file to make sure that it
  1417. is in fact 8.
  1418.  
  1419.      This  function  can  be  used  to  duplicate the DOS directory command, or
  1420. to allow filename wildcards in your program, among other things.
  1421.  
  1422. Example:
  1423.      FIL$=FIL$+CHR$(0): CALL FINDFIRSTF(FIL$,ATTR,ERCD)
  1424.      IF ERCD THEN PRINT"No matching files"
  1425.  
  1426.  
  1427.  
  1428.  
  1429.  
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459.  
  1460. Name: FINDNEXTF
  1461.  
  1462. Type: Disk / DOS
  1463.  
  1464. Description:
  1465.      This is used after the FINDFIRSTF function (q.v.) in order to find further
  1466. matching files.
  1467.  
  1468. Example:
  1469.      CALL FINDNEXTF(ERCD)
  1470.      IF ERCD THEN PRINT"No more matching files"
  1471.  
  1472.  
  1473.  
  1474.  
  1475.  
  1476.  
  1477.  
  1478.  
  1479.  
  1480.  
  1481.  
  1482.  
  1483.  
  1484.  
  1485.  
  1486.  
  1487.  
  1488.  
  1489.  
  1490.  
  1491.  
  1492.  
  1493.  
  1494.  
  1495.  
  1496.  
  1497.  
  1498.  
  1499.  
  1500.  
  1501.  
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.  
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  
  1523.  
  1524.  
  1525.  
  1526. Name: FOPEN
  1527.  
  1528. Type: Disk / DOS
  1529.  
  1530. Description:
  1531.      Opens  an  already-existing  file.   If you want to create a new file, use
  1532. the  FCREATE  function.   You  tell  it  the ASCIZ filename, ACCESS method, and
  1533. MODE;  it  gives  back  a HANDLE or ERRCODE.  The ACCESS method is how you want
  1534. to  open  the file: 0, read; 1, write; 2, read/write.  The MODE controls access
  1535. to  the  file  by  other programs operating at the same time, and is hence only
  1536. useful  for  multitasking  or  networking.  MODE is: 0, normal (no multitasking
  1537. or  networking);  1,  exclusive (no other program can access the file); 2, deny
  1538. write  (no  other  program may change the file); 3, deny read (no other program
  1539. may  look  at  the  file);  4,  deny none (other programs may access the file).
  1540. To  activate handling of nonzero modes, you must execute the DOS utility SHARE,
  1541. which  is  included  on  your  DOS  disk.  For more information, see the end of
  1542. this manual.
  1543.  
  1544. Related functions: FCLOSE, FCREATE, FREAD, FSETEND, FSETREC, FWRITE.
  1545.  
  1546. Example:
  1547.      FIL$ = "TEST.TXT" + CHR$(0)
  1548.      FACCESS = 2  : REM  Open the file with read/write access
  1549.      FMODE = 0    : REM  Normal mode, we're not networking or multitasking
  1550.      CALL FOPEN(FIL$,FACCESS,FMODE,TEST.HANDLE,ERRCODE)
  1551.      IF ERRCODE THEN PRINT "Unable to open the file"
  1552.  
  1553. Example:
  1554.      FIL$ = "C:\DOCUMENT\TEST.TXT" + CHR$(0)
  1555.      FACCESS = 2  : REM  Open the file for read access
  1556.      FMODE = 2    : REM  Deny Write mode, for networking or multitasking
  1557.      REM  We "deny write" so nobody else can change the file while we're
  1558.      REM
  1559.           reading it.  We'll let others read from the file while we are,
  1560.      REM  though.  (This works like Normal mode if SHARE wasn't executed)
  1561.      CALL FOPEN(FIL$,FACCESS,FMODE,TEST.HANDLE,ERRCODE)
  1562.      IF ERRCODE THEN PRINT "Unable to open file"
  1563.  
  1564.  
  1565.  
  1566.  
  1567.  
  1568.  
  1569.  
  1570.  
  1571.  
  1572.  
  1573.  
  1574.  
  1575.  
  1576.  
  1577.  
  1578.  
  1579.  
  1580.  
  1581.  
  1582.  
  1583.  
  1584.  
  1585.  
  1586.  
  1587.  
  1588.  
  1589.  
  1590.  
  1591.  
  1592.  
  1593. Name: FREAD
  1594.  
  1595. Type: Disk / DOS
  1596.  
  1597. Description:
  1598.      Reads  information  from  a  file opened by FOPEN or FCREATE.  You tell it
  1599. which  file  to  read  from by giving it the handle which was returned when you
  1600. opened  the  file.   You  give  it a buffer location to read into, which can be
  1601. either  an  array (for use, say, with SCRREST) or a string (for more usual pur-
  1602. poses).   You  are  responsible  for  seeing that the buffer is large enough to
  1603. hold all the bytes that you want to read!
  1604.      FREAD  returns  a  nonzero  ERRCODE if anything went wrong.  If ERRCODE is
  1605. -1,  it  was  able  to  read only part of the information before hitting an end
  1606. of  file.   In  that case, BYTESREAD will tell you how many bytes were actually
  1607. read in.  See the end of this manual for info on error codes.
  1608.  
  1609. Related functions: FCLOSE, FCREATE, FOPEN, FSETEND, FSETREC, FWRITE
  1610.  
  1611. Example:
  1612.      OPTION BASE 1 : DIM ARRAY(2000) : REM  Set up the array buffer
  1613.       .
  1614.       .
  1615.      REM  Do a FOPEN to open the file
  1616.      BUFFER = VARPTR(ARRAY(1)) : REM  Use VARPTR of first element of array
  1617.      BYTES = 4000 : REM  Read in 4000-byte saved screen into the array
  1618.      CALL FREAD(HANDLE,BUFFER,BYTES,BYTESREAD,ERRCODE)
  1619.      IF ERRCODE THEN PRINT "Error reading file..."
  1620.      REM  Do a SCRREST to put the info on the screen
  1621.  
  1622. Example:
  1623.      BYTES = 128          : REM  Read in 128 characters, or a 128-byte record
  1624.  
  1625.      BUF$ = SPACE$(BYTES) : REM  Set up the string buffer
  1626.      V = VARPTR(BUF$)
  1627.      BUFFER = PEEK(V+2) + PEEK(V+3) * 256
  1628.      CALL FREAD(HANDLE,BUFFER,BYTES,BYTESREAD,ERRCODE)
  1629.      IF ERRCODE THEN PRINT "Error reading file..."
  1630.  
  1631.  
  1632.  
  1633.  
  1634. Name: FSETEND
  1635.  
  1636. Type: Disk / DOS
  1637.  
  1638. Description:
  1639.      For  use  with  files opened with FOPEN / FCREATE.  This function sets the
  1640. file  pointer  to  the  end  of the file, so that any information written using
  1641. FWRITE will be appended to the file.
  1642.  
  1643. Related functions: FCLOSE, FCREATE, FOPEN, FREAD, FSETREC, FWRITE
  1644.  
  1645. Example:
  1646.      CALL FSETEND(HANDLE)
  1647.  
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654.  
  1655.  
  1656.  
  1657.  
  1658.  
  1659.  
  1660. Name: FSETREC
  1661.  
  1662. Type: Disk / DOS
  1663.  
  1664. Description:
  1665.      For  use  with  files opened with FOPEN / FCREATE.  This function sets the
  1666. file  pointer to a given record in the file, so that it will be the next record
  1667. read or written.
  1668.  
  1669. Related functions: FCLOSE, FCREATE, FOPEN, FREAD, FSETEND, FWRITE
  1670.  
  1671. Example:
  1672.      RECSIZE = 128 : REM  Number of bytes in a record in our file
  1673.      RECNO = 34    : REM  Record number (starting from 1, as in BASIC)
  1674.      CALL FSETREC(HANDLE,RECSIZE,RECNO)
  1675.  
  1676.  
  1677.  
  1678.  
  1679. Name: FWRITE
  1680.  
  1681. Type: Disk / DOS
  1682.  
  1683. Description:
  1684.      Allows  you to write to a file opened by FOPEN or FCREATE.  The parameters
  1685. are  the  same  as  in  FREAD  (q.v.),  except for BYTESWRITTEN, which replaces
  1686. BYTESREAD.
  1687.  
  1688. Related functions: FCLOSE, FCREATE, FOPEN, FREAD, FSETEND, FSETREC
  1689.  
  1690. Example:
  1691.      REM  Do a SCRSAVE to save a screen into ARRAY()
  1692.      BUFFER = VARPTR(ARRAY(1))
  1693.      BYTES = 4000 : REM  4000 bytes is equal to 2000 integer array elements
  1694.      CALL FWRITE(TEST.HANDLE,BUFFER,BYTES,BYTESWRITTEN,ERRCODE)
  1695.      IF ERRCODE THEN PRINT "Unable to write to file..."
  1696.  
  1697.  
  1698.  
  1699.  
  1700.  
  1701.  
  1702.  
  1703.  
  1704.  
  1705.  
  1706.  
  1707.  
  1708.  
  1709.  
  1710.  
  1711.  
  1712.  
  1713.  
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.  
  1721.  
  1722.  
  1723.  
  1724.  
  1725.  
  1726. Name: GETATTRF
  1727.  
  1728. Type: Disk / DOS
  1729.  
  1730. Description:
  1731.      Returns  the  actual  attribute  of  a  file  matched  using FINDFIRSTF or
  1732. FINDNEXTF.  See the end of this document for information on file attributes.
  1733.  
  1734. Example:
  1735.      REM  use this AFTER calling FINDFIRSTF / FINDNEXTF to initialize
  1736.      REM  the appropriate file information!
  1737.      CALL GETATTRF(ATTR)
  1738.  
  1739.  
  1740.  
  1741.  
  1742. Name: GETCRT
  1743.  
  1744. Type: Video / BIOS
  1745.  
  1746. Description:
  1747.      Tells  you  what  kind  of display is being used.  The returned value will
  1748. be reset if it's monochrome, or set if color.
  1749.  
  1750. Example:
  1751.      CALL GETCRT(COLORDISPLAY)
  1752.      IF COLORDISPLAY THEN PRINT"Color" ELSE PRINT"Monochrome"
  1753.  
  1754.  
  1755.  
  1756.  
  1757. Name: GETEXTM
  1758.  
  1759. Type: Miscellaneous / AT BIOS
  1760.  
  1761. Description:
  1762.      Tells  you  how much extended memory is available.  This function requires
  1763. the AT BIOS, and shouldn't be used with PCs.  See also GETLIMM.
  1764.  
  1765. Example:
  1766.      CALL GETEXTM(KBYTES)
  1767.      PRINT KBYTES;" kilobytes of extended memory"
  1768.  
  1769.  
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.  
  1779.  
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.  
  1787.  
  1788.  
  1789.  
  1790.  
  1791.  
  1792. Name: GETKBD
  1793.  
  1794. Type: Input / CLONE
  1795.  
  1796. Description:
  1797.      Gives  the  status  of  the keyboard toggles.  The variable will be set if
  1798. the toggle is on, and reset if it is off.  See also SETKBD.
  1799.  
  1800. Example:
  1801.      CALL GETKBD(INSERT,CAPSLOCK,NUMLOCK,SCROLLLOCK)
  1802.      IF INSERT THEN PRINT"Insert mode is on"
  1803.      IF CAPSLOCK THEN PRINT"Caps Lock is on"
  1804.      IF NUMLOCK THEN PRINT"The keypad is in numeric mode"
  1805.      IF SCROLLLOCK THEN PRINT"Scroll Lock is on"
  1806.  
  1807.  
  1808.  
  1809.  
  1810. Name: GETDATEF
  1811.  
  1812. Type: Disk / DOS
  1813.  
  1814. Description:
  1815.      Returns  the  date  associated  with  the file matched using FINDFIRSTF or
  1816. FINDNEXTF.
  1817.  
  1818. Example:
  1819.      CALL GETDATEF(MONTH,DAY,YEAR)
  1820.  
  1821.  
  1822.  
  1823.  
  1824. Name: GETDOSV
  1825.  
  1826. Type: Miscellaneous / DOS
  1827.  
  1828. Description:
  1829.      Gets  MS-DOS  version.   The  major version is returned in the first para-
  1830. meter,  the  minor  version  in  the  second (e.g., MS-DOS v. 2.11 would return
  1831. MAJ = 2, MIN = 11).
  1832.  
  1833. Example:
  1834.      CALL GETDOSV(MAJ,MIN)
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852.  
  1853.  
  1854.  
  1855.  
  1856.  
  1857.  
  1858. Name: GETDRV
  1859.  
  1860. Type: Disk / DOS
  1861.  
  1862. Description:
  1863.      Returns  the  letter  of  the  default drive.  The drive string must be at
  1864. least one character long.
  1865.  
  1866. Example:
  1867.      DRV$="x:" : CALL GETDRV(DRV$)
  1868.  
  1869.  
  1870.  
  1871.  
  1872. Name: GETFATTR
  1873.  
  1874. Type: Disk / DOS
  1875.  
  1876. Description:
  1877.      Gets  file  attribute.   See section on file attributes at the end of this
  1878. manual.
  1879.  
  1880. Example:
  1881.      FIL$ = FIL$ + CHR$(0): CALL GETFATTR(FIL$,ATR)
  1882.  
  1883.  
  1884.  
  1885.  
  1886. Name: GETFDATE
  1887.  
  1888. Type: Disk / DOS
  1889.  
  1890. Description:
  1891.      GETFDATE  returns  the  file  creation  date, that is, the date you see on
  1892. a  file  when  you  get  a DIRectory.  The file name must be terminated with an
  1893. ASCII  NUL  character.  If there is an error, such as there being no such file,
  1894. the month will be -1.
  1895.  
  1896. Example:
  1897.      FIL$ = "TESTFILE.TXT" + CHR$(0)
  1898.      CALL GETFDATE(FIL$,MONTH,DAY,YEAR)
  1899.  
  1900.  
  1901.  
  1902.  
  1903.  
  1904.  
  1905.  
  1906.  
  1907.  
  1908.  
  1909.  
  1910.  
  1911.  
  1912.  
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918.  
  1919.  
  1920.  
  1921.  
  1922.  
  1923.  
  1924. Name: GETFTIME
  1925.  
  1926. Type: Disk / DOS
  1927.  
  1928. Description:
  1929.      This  function  complements  GETFDATE, and returns the file creation time.
  1930. The  hour  is in 24-hour (military) format, and will be returned as -1 if there
  1931. is  no such file or a bad file name.  The seconds are rounded to the next lower
  1932. even  number,  due to the DOS storage format.  The file name must be terminated
  1933. with a NUL character.
  1934.  
  1935. Example:
  1936.      FIL$ = "ANYFILE.EXT" + CHR$(0)
  1937.      CALL GETFTIME(FIL$,HOUR,MINUTE,SECOND)
  1938.  
  1939.  
  1940.  
  1941.  
  1942. Name: GETKEY
  1943.  
  1944. Type: Keyboard / BIOS
  1945.  
  1946. Description:
  1947.      Waits  until  one  of  a list of keys is pressed, and returns it.  The key
  1948. list  (any  length)  should  be  uppercase.  If the key list is null, the first
  1949. key  pressed  will  be  returned.   The  key returned will be capitalized.  The
  1950. variable  to return the key in must be at least one character long.  This func-
  1951. tion is designed for returning one of a menu of choices, for example.
  1952.  
  1953. Example:
  1954.      GOODKEYS$="KEY LIST"
  1955.              .
  1956.              .
  1957.      KY$="x": CALL GETKEY(GOODKEYS$,KY$)
  1958.  
  1959.  
  1960.  
  1961.  
  1962. Name: GETLIMM
  1963.  
  1964. Type: Miscellaneous / BIOS
  1965.  
  1966. Description:
  1967.      Returns  the  status  of  expanded  memory,  in total pages and free pages
  1968. (where  a  page  is  16k  bytes).   Total pages will be zero if expanded memory
  1969. is not installed, or if the LIM driver is not active.  See also GETEXTM.
  1970.  
  1971. Example:
  1972.      CALL GETLIMM(TOTPAGES,FREEPAGES)
  1973.      PRINT TOTPAGES;"pages of LIM memory are installed."
  1974.      IF TOTPAGES>0 THEN PRINT FREEPAGES;"pages of that are free."
  1975.  
  1976.  
  1977.  
  1978.  
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984.  
  1985.  
  1986.  
  1987.  
  1988.  
  1989.  
  1990. Name: GETLINE
  1991.  
  1992. Type: Video / ANY
  1993.  
  1994. Description:
  1995.      Returns a selected line from a screen saved via SCRSAVE, with the trailing
  1996. spaces removed.  The line string must be at least 80 characters long.
  1997.  
  1998. Example:
  1999.      DEFINT A-Z: OPTION BASE 1: DIM SCR(2000)
  2000.      WHERE=VARPTR(SCR(1)): CALL SCRSAVE(WHERE): CLS
  2001.      LINENR=10: LIN$=SPACE$(80): WHERE=VARPTR(SCR(1))
  2002.      CALL GETLINE(WHERE,LINENR,LIN$,LLEN)
  2003.      PRINT"Line 10 was:": PRINT LEFT$(LIN$,LLEN)
  2004.  
  2005.  
  2006.  
  2007.  
  2008. Name: GETNAMEF
  2009.  
  2010. Type: Disk / DOS
  2011.  
  2012. Description:
  2013.      Returns  the  filename  of the file matched using FINDFIRSTF or FINDNEXTF.
  2014. The  FIL$  string  must  be  initialized  to  at least 12 characters in length.
  2015. The  actual  length  of  FIL$ will be returned in FLEN, which will be -1 if you
  2016. didn't  initialize  FIL$  long enough.  Note that the filename will not contain
  2017. a drive or path spec.
  2018.  
  2019. Example:
  2020.      FIL$ = SPACE$(12): CALL GETNAMEF(FIL$,FLEN): FIL$ = LEFT$(FIL$,FLEN)
  2021.  
  2022.  
  2023.  
  2024.  
  2025.  
  2026.  
  2027.  
  2028.  
  2029.  
  2030.  
  2031.  
  2032.  
  2033.  
  2034.  
  2035.  
  2036.  
  2037.  
  2038.  
  2039.  
  2040.  
  2041.  
  2042.  
  2043.  
  2044.  
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050.  
  2051.  
  2052.  
  2053.  
  2054.  
  2055.  
  2056. Name: GETSCREEN
  2057.  
  2058. Type: Video / CLONE
  2059.  
  2060. Description:
  2061.      Allows  you to save any part of a text screen display (on any page, active
  2062. or  inactive,  if  you  have a color graphics adapter).  You need to specify an
  2063. integer  array  where  the  information  will be stored, the coordinates of the
  2064. upper  left  corner  and bottom right corner of the part of the screen to save,
  2065. the display page to save, and the screen mode.
  2066.      The  screen  mode  should  be  zero  for flicker-free screen saving if you
  2067. have  a  low quality color graphics adapter and are saving the currently-active
  2068. display page.  Otherwise, set it to 1 or -1 for the fastest save speed.
  2069.      You  specify  the  area  of  the  screen to save as a rectangle, by giving
  2070. the  locations  of  the upper leftmost corner and lower rightmost corner of the
  2071. area  to  save.   This  can range from a single character to the entire screen.
  2072. Make  sure  that the coordinates do not get mixed up, or you will get unpredic-
  2073. table results.
  2074.      To  figure  out  how  many  array elements you need to save an area of the
  2075. screen, use the following calculation:
  2076. ELEMENTS = (BOTTOMROW - TOPROW + 1) * (RIGHTCOLUMN - LEFTCOLUMN + 1)
  2077. You  can  store  multiple  screen  areas  in one array by specifying the proper
  2078. starting  element,  which  must  be  one after the previous saved area.  You'll
  2079. have to keep track of where each saved area is in the array yourself.
  2080.      If  you have a monochrome adapter, or are not using unusual display pages,
  2081. you should set the page specification to zero.
  2082.      Note  that  you  don't  have  to restore the saved area of the screen (see
  2083. PUTSCREEN) to the same area it was taken from.  This allows you to move windows
  2084. around, change the shape of windows, and other interesting tricks...
  2085.      See  also  PUTSCREEN,  to restore a given area of the screen; and SCRSAVE,
  2086. SCRREST,  SCRSAVEP,  SCRRESTP,  SCRSAVEPD,  and  SCRRESTPD, earlier versions of
  2087. similar  functions.   Note  that  if  you save/restore a full 80-column, 25-row
  2088. screen,  the  information in the save/restore array is identical whether you're
  2089. using  GETSCREEN/PUTSCREEN or SCRSAVExx/SCRRESTxx.  On that level, the routines
  2090. are completely compatible.
  2091.  
  2092. Example:
  2093.      CALL GETSCREEN(SCRN(0), TOPROW,LFTCOL, BOTROW,RGTCOL, PAGE, SCRNMODE)
  2094.      REM  SCRN(0) is the starting location in the array to save the area to.
  2095.      REM  TOPROW,LFTCOL and BOTROW,RGTCOL are the corners of the area to save.
  2096.      REM  PAGE is the display page number (0-3 if Color, 0 if Monochrome).
  2097.      REM
  2098.           SCRNMODE is screen access mode: 0, flicker-free; 1 / -1, fast.
  2099.  
  2100.  
  2101.  
  2102.  
  2103.  
  2104.  
  2105.  
  2106.  
  2107.  
  2108.  
  2109.  
  2110.  
  2111.  
  2112.  
  2113.  
  2114.  
  2115.  
  2116.  
  2117.  
  2118.  
  2119.  
  2120.  
  2121.  
  2122.  
  2123. Name: GETSIZEF
  2124.  
  2125. Type: Disk / DOS
  2126.  
  2127. Description:
  2128.      Returns  the  size of the file matched via FINDFIRSTF or FINDNEXTF.  Since
  2129. the  file  size  may  be  outside integer bounds, there is some additional code
  2130. you  will  have  to  add  which uses double-precision values (see the example).
  2131. You  can  modify  the example to use single-precision instead, but really large
  2132. file sizes will then lapse into exponential notation.
  2133.  
  2134. Example:
  2135.      CALL GETSIZEF(SIZELOW,SIZEHIGH): SIZELOW# = CDBL(SIZELOW)
  2136.      IF SIZELOW < 0 THEN SIZELOW# = SIZELOW# + 65536#
  2137.      FILESIZE# = SIZELOW# + CDBL(SIZEHIGH) * 65536#
  2138.  
  2139.  
  2140.  
  2141.  
  2142. Name: GETSUB
  2143.  
  2144. Type: Disk / DOS
  2145.  
  2146. Description:
  2147.      Gets the default subdirectory.  The subdirectory string must be 64 charac-
  2148. ters  long,  and  it  is  recommended  that you set it to ASCII zeroes (the NUL
  2149. character).  The length of the subdirectory string is returned as an integer
  2150. value.  Note that the string will NOT be started by a backslash "\" character--
  2151. you should add one if appropriate.
  2152.  
  2153. Example:
  2154.      SUB$ = STRING$(64,0): CALL GETSUB(SUB$,SLEN)
  2155.      SUB$ = "\" + LEFT$(SUB$,SLEN)
  2156.  
  2157.  
  2158.  
  2159.  
  2160. Name: GETTIMEF
  2161.  
  2162. Type: Disk / DOS
  2163.  
  2164. Description:
  2165.      Returns  the  time  associated  with  the  file  matched  by FINDFIRSTF or
  2166. FINDNEXTF.  The hour is returned in military (24-hour) format.
  2167.  
  2168. Example:
  2169.      CALL GETTIMEF(HOUR,MINUTE,SECOND)
  2170.  
  2171.  
  2172.  
  2173.  
  2174.  
  2175.  
  2176.  
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  
  2182.  
  2183.  
  2184.  
  2185.  
  2186.  
  2187.  
  2188.  
  2189. Name: INSCHR
  2190.  
  2191. Type: Video / CLONE
  2192.  
  2193. Description:
  2194.      Inserts a space at the specified screen location.  The character previous-
  2195. ly  at  that  position and all characters to the right of it on the same screen
  2196. line  will  be  shifted  right  one  space.  Subject to the same limitations as
  2197. DELCHR (q.v.).
  2198.  
  2199. Example:
  2200.      COL = POS(0): ROW = CSRLIN: CALL INSCHR(ROW,COL): PRINT"*";
  2201.  
  2202.  
  2203.  
  2204.  
  2205. Name: INT2DATE
  2206.  
  2207. Type: Miscellaneous / ANY
  2208.  
  2209. Description:
  2210.      Decompresses  a  date  squeezed  using  DATE2INT (q.v.).  The year will be
  2211. a four-digit value (1900-2026).
  2212.  
  2213. Example:
  2214.      CALL INT2DATE(MONTH,DAY,YEAR,SQZDATE)
  2215.  
  2216.  
  2217.  
  2218.  
  2219. Name: INT2TIME
  2220.  
  2221. Type: Miscellaneous / ANY
  2222.  
  2223. Description:
  2224.      Decompresses  a  time  squeezed  using  TIME2INT (q.v.).  The seconds will
  2225. be an even value (rounded down) due to the storage format.
  2226.  
  2227. Example:
  2228.      CALL INT2TIME(HOUR,MIN,SEC,SQZTIME)
  2229.  
  2230.  
  2231.  
  2232.  
  2233.  
  2234.  
  2235.  
  2236.  
  2237.  
  2238.  
  2239.  
  2240.  
  2241.  
  2242.  
  2243.  
  2244.  
  2245.  
  2246.  
  2247.  
  2248.  
  2249.  
  2250.  
  2251.  
  2252.  
  2253.  
  2254.  
  2255. Name: KEYPRESS
  2256.  
  2257. Type: Keyboard / BIOS
  2258.  
  2259. Description:
  2260.      Tells  you  whether  a key is waiting in the keyboard buffer (for use with
  2261. INKEY$ routines, etc).  KYHIT is set to -1 if a key is waiting, 0 otherwise.
  2262.  
  2263. Example:
  2264.      100 CALL KEYPRESS(KYHIT):IF KYHIT THEN KY$=INKEY$:GOTO 300 ELSE 100
  2265.  
  2266.  
  2267.  
  2268.  
  2269. Name: LOCASE
  2270.  
  2271. Type: String / ANY
  2272.  
  2273. Description:
  2274.      Converts  a  string  to  all  lowercase.  Leaves non-alphabetic characters
  2275. untouched.  String may be any length.
  2276.  
  2277. Example:
  2278.      MSG$="THis IS a test OF tHe lowercase CONVERTER!"
  2279.                .
  2280.                .
  2281.      CALL LOCASE(MSG$)
  2282.  
  2283.  
  2284.  
  2285.  
  2286.  
  2287.  
  2288.  
  2289.  
  2290.  
  2291.  
  2292.  
  2293.  
  2294.  
  2295.  
  2296.  
  2297.  
  2298.  
  2299.  
  2300.  
  2301.  
  2302.  
  2303.  
  2304.  
  2305.  
  2306.  
  2307.  
  2308.  
  2309.  
  2310.  
  2311.  
  2312.  
  2313.  
  2314.  
  2315.  
  2316.  
  2317.  
  2318.  
  2319.  
  2320.  
  2321. Name: LROTATE
  2322.  
  2323. Type: String / ANY
  2324.  
  2325. Description:
  2326.      Rotates  the characters in a string left.  That is, the leftmost character
  2327. is removed, and tacked onto the end of the string.  This is useful for rotating
  2328. queues  and  for  character-graphics animation.  If the string is of length one
  2329. or less, it is returned unchanged.
  2330.  
  2331. Example:
  2332.      ST$ = "12345": CALL LROTATE(ST$)
  2333.      REM  ST$ will end up being "23451"
  2334.  
  2335.  
  2336.  
  2337.  
  2338. Name: MAKESUB
  2339.  
  2340. Type: Disk / DOS
  2341.  
  2342. Description:
  2343.      Makes  a  subdirectory.   Use  a NUL-terminated string to specify the sub-
  2344. directory, and expect ERRCODE to be set if there was an error.
  2345.  
  2346. Example:
  2347.      TMP$ = SUB$+CHR$(0): CALL MAKESUB(TMP$,ERRCODE)
  2348.      IF ERRCODE THEN couldn't make subdir ELSE subdir created
  2349.  
  2350.  
  2351.  
  2352.  
  2353.  
  2354.  
  2355.  
  2356.  
  2357.  
  2358.  
  2359.  
  2360.  
  2361.  
  2362.  
  2363.  
  2364.  
  2365.  
  2366.  
  2367.  
  2368.  
  2369.  
  2370.  
  2371.  
  2372.  
  2373.  
  2374.  
  2375.  
  2376.  
  2377.  
  2378.  
  2379.  
  2380.  
  2381.  
  2382.  
  2383.  
  2384.  
  2385.  
  2386.  
  2387. Name: MAKEWINDOW
  2388.  
  2389. Type: Video / CLONE
  2390.  
  2391. Description:
  2392.      Creates  a  pop-up window on the screen.  You specify the window by giving
  2393. the  upper  left  corner  and  lower  right corner of the inside of the window.
  2394. The  frame  is drawn -outside- the window you've specified, so be sure to allow
  2395. room  for  the  frame!   For normal windows, the frame takes up only one column
  2396. or  row  on  each  side.   For shadowed windows, the frame will instead take up
  2397. three columns on the left and three rows on the bottom.
  2398.  
  2399.      There are four types of window:
  2400. 0, Normal:   the window pops onto the screen.
  2401. 1, Growing:  the window "grows" from a spot to a full-sized window.
  2402. 2, Shadowed: the window is shadowed on the left and bottom for a 3D effect.
  2403. 3, Growing/Shadowed: the window is shadowed and grows.
  2404.  
  2405.      You may also choose five types of frames:
  2406. 0, None: composed of spaces.
  2407. 1, Single: composed of a single line.
  2408. 2, Double: composed of a double line.
  2409. 3, Double/Single: made with a double vertical and a single horizontal line.
  2410. 4, Single/Double: made with a single vertical and a double horizontal line.
  2411.  
  2412.      You  must  select  fore  and  background colors.  A label is optional.  If
  2413. you  give  one,  it is bracketed within the top of the frame, on the left side.
  2414. The screen page is selectable on color monitors.
  2415.  
  2416. Example:
  2417.      LCOL=5:  TROW=5:  REM  top left corner
  2418.      RCOL=79: BROW=20: REM  bottom right corner
  2419.      LABEL$="Test Window"
  2420.      FORE=7: BACK=0:   REM  color/attributes
  2421.      PAGE=0:           REM  screen display page
  2422.      FRAME=1:          REM  single-line frame
  2423.      TYPE=3:           REM  growing, shadowed window
  2424.      CALL MAKEWINDOW(LCOL,TROW,RCOL,BROW,LABEL$,FRAME,TYPE,FORE,BACK,PAGE)
  2425.  
  2426.  
  2427.  
  2428.  
  2429.  
  2430.  
  2431.  
  2432.  
  2433.  
  2434.  
  2435.  
  2436.  
  2437.  
  2438.  
  2439.  
  2440.  
  2441.  
  2442.  
  2443.  
  2444.  
  2445.  
  2446.  
  2447.  
  2448.  
  2449.  
  2450.  
  2451.  
  2452.  
  2453. Name: MDELCHR
  2454.  
  2455. Type: Video / BIOS
  2456.  
  2457. Description:
  2458.      Deletes the character at the current cursor position.  It obeys the window
  2459. defined by MWINDOW.  It's more compatible than DELCHR, but much slower.
  2460.        Note  that  this  routine  can  be used to scroll a window left by doing
  2461. an MDELCHR at the first location of each line to be scrolled.  To scroll right,
  2462. do the same using MINSCHR instead.
  2463.  
  2464. Example:
  2465.      CALL MDELCHR
  2466.  
  2467.  
  2468.  
  2469.  
  2470. Name: MINSCHR
  2471.  
  2472. Type: Video / BIOS
  2473.  
  2474. Description:
  2475.      Inserts a space at the current cursor position, obeying the window defined
  2476. by MWINDOW.  See notes at MDELCHR.
  2477.  
  2478. Example:
  2479.      CALL MINSCHR
  2480.  
  2481.  
  2482.  
  2483.  
  2484.  
  2485.  
  2486.  
  2487.  
  2488.  
  2489.  
  2490.  
  2491.  
  2492.  
  2493.  
  2494.  
  2495.  
  2496.  
  2497.  
  2498.  
  2499.  
  2500.  
  2501.  
  2502.  
  2503.  
  2504.  
  2505.  
  2506.  
  2507.  
  2508.  
  2509.  
  2510.  
  2511.  
  2512.  
  2513.  
  2514.  
  2515.  
  2516.  
  2517.  
  2518.  
  2519. Name: MMBUTTON
  2520.  
  2521. Type: Input / BIOS
  2522.  
  2523. Description:
  2524.      Returns  which  mouse  buttons  are  currently  being held down.  See also
  2525. MMCLICK.
  2526.  
  2527. Example:
  2528.      CALL MMBUTTON(LFT,RGT)
  2529.      IF LFT THEN PRINT "The left button is being pressed."
  2530.      IF RGT THEN PRINT "The right button is being pressed."
  2531.  
  2532.  
  2533.  
  2534.  
  2535. Name: MMCHECK
  2536.  
  2537. Type: Input / BIOS
  2538.  
  2539. Description:
  2540.      Returns  whether  a  mouse  is  installed,  and how many buttons it has if
  2541. it is installed.
  2542.  
  2543. Example:
  2544.      CALL MMCHECK(MOUSE)
  2545.      IF MOUSE THEN PRINT "A mouse with ";MOUSE;" buttons is installed."
  2546.  
  2547.  
  2548.  
  2549.  
  2550. Name: MMCLICK
  2551.  
  2552. Type: Input / BIOS
  2553.  
  2554. Description:
  2555.      Returns  which  mouse  buttons  have been clicked since you last used this
  2556. function.  See also MMBUTTON.
  2557.  
  2558. Example:
  2559.      CALL MMCLICK(LFT,RGT)
  2560.      IF LFT THEN PRINT "The left button was pressed."
  2561.      IF RGT THEN PRINT "The right button was pressed."
  2562.  
  2563.  
  2564.  
  2565.  
  2566.  
  2567.  
  2568.  
  2569.  
  2570.  
  2571.  
  2572.  
  2573.  
  2574.  
  2575.  
  2576.  
  2577.  
  2578.  
  2579.  
  2580.  
  2581.  
  2582.  
  2583.  
  2584.  
  2585. Name: MMCURSORON
  2586.  
  2587. Type: Input / BIOS
  2588.  
  2589. Description:
  2590.      Makes  the  cursor  associated  with  the mouse visible.  This is normally
  2591. a  blinking  block,  and shows where the mouse is currently pointing.  See also
  2592. MMCURSOROFF.
  2593.  
  2594. Example:
  2595.      CALL MMCURSORON
  2596.  
  2597.  
  2598.  
  2599. Name: MMCURSOROFF
  2600.  
  2601. Type: Input / BIOS
  2602.  
  2603. Description:
  2604.      Makes   the   cursor  associated  with  the  mouse  invisible.   See  also
  2605. MMCURSORON.
  2606.  
  2607. Example:
  2608.      CALL MMCURSOROFF.
  2609.  
  2610.  
  2611.  
  2612.  
  2613. Name: MMGETLOC
  2614.  
  2615. Type: Input / BIOS
  2616.  
  2617. Description:
  2618.      Gets  the  current  location  of  the mouse cursor.  This is returned as a
  2619. value  from  0-639  for  columns,  and 0-199 for rows.  You need to adjust this
  2620. for  the  current  screen  format.   If you're in text mode, divide the columns
  2621. by  eight  and  the  rows by eight.  If you're in low res graphics mode, divide
  2622. the columns by two.  If you're in high res graphics, the numbers are fine.
  2623.  
  2624. Example:
  2625.      CALL MMGETLOC(COL,ROW)
  2626.      LOCATE ROW,COL: PRINT "!";
  2627.  
  2628.  
  2629.  
  2630.  
  2631.  
  2632.  
  2633.  
  2634.  
  2635.  
  2636.  
  2637.  
  2638.  
  2639.  
  2640.  
  2641.  
  2642.  
  2643.  
  2644.  
  2645.  
  2646.  
  2647.  
  2648.  
  2649.  
  2650.  
  2651. Name: MMSETLOC
  2652.  
  2653. Type: Input / BIOS
  2654.  
  2655. Description:
  2656.      Sets  the  current  value  of  the  mouse cursor.  Uses the same format as
  2657. MMGETLOC (q.v.).
  2658.  
  2659. Example:
  2660.      COL=40*8-8: ROW=24*8-8: REM  middle of the text-mode screen
  2661.      CALL MMSETLOC(COL,ROW)
  2662.  
  2663.  
  2664.  
  2665.  
  2666. Name: MMSETRANGE
  2667.  
  2668. Type: Input / BIOS
  2669.  
  2670. Description:
  2671.      Sets  the  range  of  locations  where  the mouse cursor is allowed to be.
  2672. This  is  done  by  specifying  the upper left corner and lower right corner of
  2673. the edges of the mouse input field.  Use the same format as MMGETLOC (q.v.).
  2674.  
  2675. Example:
  2676.      LFTCOL=20*8-8: TOPROW=1*8-8
  2677.      RGTCOL=60*8-8: BOTROW=10*8-8
  2678.      CALL MMSETRANGE(LFTCOL,TOPROW,RGTCOL,BOTROW)
  2679.      REM  sets up a text-mode input field
  2680.  
  2681.  
  2682.  
  2683.  
  2684.  
  2685.  
  2686.  
  2687.  
  2688.  
  2689.  
  2690.  
  2691.  
  2692.  
  2693.  
  2694.  
  2695.  
  2696.  
  2697.  
  2698.  
  2699.  
  2700.  
  2701.  
  2702.  
  2703.  
  2704.  
  2705.  
  2706.  
  2707.  
  2708.  
  2709.  
  2710.  
  2711.  
  2712.  
  2713.  
  2714.  
  2715.  
  2716.  
  2717. Name: MLOAD
  2718.  
  2719. Type: Disk / DOS
  2720.  
  2721. Description:
  2722.      Works  the  same  way  as  the BLOAD statement does.  This is for use with
  2723. older  compilers,  which  don't  have  the  BLOAD statement implemented.  MLOAD
  2724. restores the information to the same place it was when BSAVEd.
  2725.  
  2726. Example:
  2727.      FIL$ = "SCRNSAVE.BIN" + CHR$(0)
  2728.      CALL MLOAD(FIL$)
  2729.  
  2730.  
  2731.  
  2732.  
  2733. Name: MONTH
  2734.  
  2735. Type: Miscellaneous / ANY
  2736.  
  2737. Description:
  2738.      Given  the  number  of  a  month  (1-12), this routine returns the name of
  2739. the  month  (January  -  December).   You must supply a string of at least nine
  2740. spaces in length to hold the month.
  2741.  
  2742. Example:
  2743.      MONTH$ = SPACE$(9)
  2744.      CALL MONTH(MONTH$,MLENGTH,MONTHNUMBER)
  2745.      MONTH$ = LEFT$(MONTH$,MLENGTH)
  2746.  
  2747.  
  2748.  
  2749.  
  2750.  
  2751.  
  2752.  
  2753.  
  2754.  
  2755.  
  2756.  
  2757.  
  2758.  
  2759.  
  2760.  
  2761.  
  2762.  
  2763.  
  2764.  
  2765.  
  2766.  
  2767.  
  2768.  
  2769.  
  2770.  
  2771.  
  2772.  
  2773.  
  2774.  
  2775.  
  2776.  
  2777.  
  2778.  
  2779.  
  2780.  
  2781.  
  2782.  
  2783. Name: MPRINTC
  2784.  
  2785. Type: Video / BIOS
  2786.  
  2787. Description:
  2788.      Using  this  function,  you  can  access  device drivers such as ANSI.SYS.
  2789. This  is  a  video  output  function  which goes through MS-DOS function calls.
  2790. It  prints  a  single  character  to  the  display.   Advantages: allows use of
  2791. ANSI.SYS    and   similar   video   drivers,   and   windowing   via   MWINDOW.
  2792. Disadvantages: is slower and takes more memory that the usual PRINT statement.
  2793.  
  2794. Example:
  2795.      CALL MPRINTC(CH$,COL,ROW): LOCATE ROW,COL
  2796.  
  2797.  
  2798.  
  2799.  
  2800. Name: MPRINT
  2801.  
  2802. Type: Video / BIOS
  2803.  
  2804. Description:
  2805.      Same  as  MPRINTC  (q.v.), only it allows you to send an entire string out
  2806. to the display, rather than just a single character.
  2807.  
  2808. Example:
  2809.      CALL MPRINT(ST$,COL,ROW): LOCATE ROW,COL
  2810.  
  2811.  
  2812.  
  2813.  
  2814.  
  2815.  
  2816.  
  2817.  
  2818.  
  2819.  
  2820.  
  2821.  
  2822.  
  2823.  
  2824.  
  2825.  
  2826.  
  2827.  
  2828.  
  2829.  
  2830.  
  2831.  
  2832.  
  2833.  
  2834.  
  2835.  
  2836.  
  2837.  
  2838.  
  2839.  
  2840.  
  2841.  
  2842.  
  2843.  
  2844.  
  2845.  
  2846.  
  2847.  
  2848.  
  2849. Name: MULTIAND
  2850.  
  2851. Type: String / ANY
  2852.  
  2853. Description:
  2854.      This  is  a  flexible  function  with many possible uses.  Every character
  2855. in  a  given  string  is  ANDed  with a value you supply.  One thing this could
  2856. be  used  for is translating Wordstar files to ASCII files, by using a bit mask
  2857. (the  value  that  will  be ANDed with the character) of &H7F, which strips off
  2858. the  high  bit  of  each character.  The string may be any length; the bit mask
  2859. is an integer, with only the low byte in use (value of 0-255).
  2860.  
  2861. Example:
  2862.      ST$ = "" : FOR X=65 TO 70: ST$ = CHR$(X)+CHR$(X+128): NEXT : PRINT ST$
  2863.      BITMASK = &H7F : CALL MULTIAND(ST$,BITMASK) : PRINT ST$
  2864.  
  2865.  
  2866.  
  2867.  
  2868. Name: MULTIOR
  2869.  
  2870. Type: String / ANY
  2871.  
  2872. Description:
  2873.      Does  the  exact  opposite  of  MULTIAND--  instead of stripping off bits,
  2874. it  turns  on  bits.   It ORs instead of ANDs.  One possible use for this would
  2875. be  to  encode  a  text  string by ORing with 128, and later decoding by ANDing
  2876. with  128.   This  would allow you to save the string to disk using text files,
  2877. even  if  the string included control codes.  It won't work right if the string
  2878. has  graphics  characters  (using ExtASCII codes, which are codes from 128-255)
  2879. in it, though.  The parameters are the same as for MULTIAND.
  2880.  
  2881. Example:
  2882.      ST$ = "ABCDE": PRINT ST$: SETBITS = &H80
  2883.      CALL MULTIOR(ST$,SETBITS): PRINT ST$
  2884.  
  2885.  
  2886.  
  2887.  
  2888. Name: MULTIXOR
  2889.  
  2890. Type: String / ANY
  2891.  
  2892. Description:
  2893.      An  exclusive-or  operation  for  strings.  Bits in the string will be set
  2894. only  if they are set in the string byte or mask byte, but not in both of them.
  2895. Note  that  this  can  be used as a "MULTINOT" function by using a mask of &HFF
  2896. or  255.   In  this  case,  all  bits are set in the mask, so the result of the
  2897. XOR  will  be  the  same  as a NOT operation on the string.  Note that XORing a
  2898. string  with  the  same  value  twice  will return the original string-- it can
  2899. thus be used to encode and decode strings.
  2900.  
  2901. Example:
  2902.      CALL MULTIXOR(ST$,MASK)
  2903.  
  2904.  
  2905.  
  2906.  
  2907.  
  2908.  
  2909.  
  2910.  
  2911.  
  2912.  
  2913.  
  2914.  
  2915. Name: MWINDOW
  2916.  
  2917. Type: Video / BIOS
  2918.  
  2919. Description:
  2920.      Sets up a window for the MPRINT and MPRINTC routines.  Windows are defined
  2921. by  their  upper  left  corner  and  lower right corner.  The default window is
  2922. thus  (0,0,80,24),  which  leaves  out  the  bottom line (BASIC's status line).
  2923. To  use  the full screen, call this routine with values (0,0,80,25).  Note that
  2924. the cursor should be positioned inside the window before using MPRINT/MPRINTC.
  2925. Note also that windows should be defined to contain at least two rows.
  2926.  
  2927. Example:
  2928.      LFTCOL = 20: TOPROW = 5: RTCOL = 60: BOTROW = 15
  2929.      CALL MWINDOW(LFTCOL,TOPROW,RTCOL,BOTROW): LOCATE TOPROW,LFTCOL
  2930.      REM  sets up a window (of 40 cols x 10 rows) in the middle of the screen.
  2931.  
  2932.  
  2933.  
  2934.  
  2935. Name: PRINTSCREEN
  2936.  
  2937. Type: Miscellaneous / BIOS
  2938.  
  2939. Description:
  2940.      This sends an image of the current screen display out to the first printer
  2941. device.   It  works  exactly  in  the  same way as doing a Shift-PrtSc from the
  2942. keyboard,  so  it  can  display  graphics  as  well as text if you have the DOS
  2943. GRAPHICS program installed.
  2944.  
  2945.  
  2946.  
  2947.  
  2948.  
  2949.  
  2950.  
  2951.  
  2952.  
  2953.  
  2954.  
  2955.  
  2956.  
  2957.  
  2958.  
  2959.  
  2960.  
  2961.  
  2962.  
  2963.  
  2964.  
  2965.  
  2966.  
  2967.  
  2968.  
  2969.  
  2970.  
  2971.  
  2972.  
  2973.  
  2974.  
  2975.  
  2976.  
  2977.  
  2978.  
  2979.  
  2980.  
  2981. Name: PUTSCREEN
  2982.  
  2983. Type: Video / CLONE
  2984.  
  2985. Description:
  2986.      This  restores  an  area  of the screen that was saved using the GETSCREEN
  2987. function  (q.v.).   You need not restore an area to the same screen coordinates
  2988. or to the same display page.
  2989.      It  is possible to change the shape of an area by changing the coordinates
  2990. specified.   For  instance,  suppose  you  had  saved a six character, one line
  2991. message,  "FOOBAR",  at  coordinates  (1,1)-(1,6).   You  could restore it as a
  2992. three  char  by  two  line  message,  "FOO" "BAR" by specifying the coordinates
  2993. (1,1)-(2,3).   Note  that  these  coordinates  are in Microsoft's mixed up form
  2994. of (ROW,COLUMN), not the normal algebraic format.
  2995.      It  is  also  possible  to restore only part of the screen that was saved.
  2996. For instance, suppose you had saved the entire screen in an array SCRN starting
  2997. at  element 0, and only wanted to restore the bottom half of the screen.  Using
  2998. the  calculation  for  screen  elements given in GETSCREEN, you would find that
  2999. 2000  elements  were  needed  for  the  whole screen, or only 1000 elements for
  3000. the  bottom  half  of the screen.  That means that in the array, elements 0-999
  3001. hold  the  top half of the screen, and 1000-1999 hold the bottom half (assuming
  3002. a  default  OPTION  BASE=0).   So, you would tell PUTSCREEN to start with array
  3003. element  SCRN(1000),  and  give  it  the starting and ending coordinates of the
  3004. corners of the lower half of the screen.
  3005.      Parameters specifications are the same as they are for GETSCREEN.
  3006.  
  3007. Example:
  3008.      CALL PUTSCREEN(SCRN(0),TOPROW,LFTCOL,BOTROW,RGTCOL,PAGE,SCRNMODE)
  3009.  
  3010.  
  3011.  
  3012.  
  3013.  
  3014.  
  3015.  
  3016.  
  3017.  
  3018.  
  3019.  
  3020.  
  3021.  
  3022.  
  3023.  
  3024.  
  3025.  
  3026.  
  3027.  
  3028.  
  3029.  
  3030.  
  3031.  
  3032.  
  3033.  
  3034.  
  3035.  
  3036.  
  3037.  
  3038.  
  3039.  
  3040.  
  3041.  
  3042.  
  3043.  
  3044.  
  3045.  
  3046.  
  3047. Name: QPRINT
  3048.  
  3049. Type: Video / CLONE
  3050.  
  3051. Description:
  3052.      This  function  bypasses  the  usual  video  routines, and prints a string
  3053. directly  on  the screen, at a -much- higher speed than the normal PRINT state-
  3054. ment  does.   It  also contains a built-in LOCATE statement, and doesn't affect
  3055. the  cursor  position.   Note  that control characters will show up as graphics
  3056. characters instead of having their original functions, and the color/attributes
  3057. used  will  be  the ones already on the screen.  Display page zero is used with
  3058. color adapters.
  3059.  
  3060. Example:
  3061.      ST$ = "This is a test of fast screen printing"
  3062.      ROW = 10: COL = 20
  3063.      CALL QPRINT(ST$,ROW,COL)
  3064.  
  3065.  
  3066.  
  3067.  
  3068.  
  3069.  
  3070.  
  3071.  
  3072.  
  3073.  
  3074.  
  3075.  
  3076.  
  3077.  
  3078.  
  3079.  
  3080.  
  3081.  
  3082.  
  3083.  
  3084.  
  3085.  
  3086.  
  3087.  
  3088.  
  3089.  
  3090.  
  3091.  
  3092.  
  3093.  
  3094.  
  3095.  
  3096.  
  3097.  
  3098.  
  3099.  
  3100.  
  3101.  
  3102.  
  3103.  
  3104.  
  3105.  
  3106.  
  3107.  
  3108.  
  3109.  
  3110.  
  3111.  
  3112.  
  3113. Name: READBITF
  3114.  
  3115. Type: Miscellaneous / ANY
  3116.  
  3117. Description:
  3118.      Reads  a  word  from  an  array  of  arbitrary bit length, given an index.
  3119. The  words  in  the  array  may be made of one to eight bits.  Indices begin at
  3120. zero and are limited by integer range.  That is up to &HFFFF, subject to memory
  3121. constraints--  the  index is taken to be an unsigned integer value.  This func-
  3122. tion  allows  very memory-efficient storage of arrays of numbers, provided that
  3123. the  numbers are within a restricted range.  The simulated array is held within
  3124. a  normal  integer  array,  which  must be dimensioned large enough to hold all
  3125. of  the  arbitrary-length  words  (will  depend  on bits per word and number of
  3126. words desired).
  3127.  
  3128. Example:
  3129.      OPTION BASE 0: DEFINT A-Z: DIM INTARRAY(50): BITFSIZE=8
  3130.        .
  3131.        .
  3132.      ARRAYLOC=VARPTR(INTARRAY(0))
  3133.      CALL READBITF(ARRAYLOC,NDX,BITFSIZE,VALUE)
  3134.      REM  Returns a value from the array location indexed by NDX,
  3135.      REM  where the array is composed of bytes (8-bit words).
  3136.      REM  See the disk file BITFTEST.BAS in the source files
  3137.      REM  for a working example program (compiled BASIC only!!!)
  3138.  
  3139.  
  3140.  
  3141.  
  3142. Name: RECOLOR
  3143.  
  3144. Type: Video / CLONE
  3145.  
  3146. Description:
  3147.      Takes  everything  on  the  screen that's of a given color and changes its
  3148. color  to  whatever  you  like.   This can be used for special effects, or just
  3149. to  change  the  screen  color  without  having to clear the screen.  This will
  3150. work  only  in  text mode.  The color attributes must be defined from the fore-
  3151. ground and background colors using the CALCATTR routine.
  3152.  
  3153. Example:
  3154.      CALL CALCATTR(FOREGND,BACKGND,OLDCOLR)
  3155.      CALL CALCATTR(NEWFORE,NEWBACK,NEWCOLR)
  3156.      CALL RECOLOR(OLDCOLR,NEWCOLR)
  3157.  
  3158.  
  3159.  
  3160.  
  3161.  
  3162.  
  3163.  
  3164.  
  3165.  
  3166.  
  3167.  
  3168.  
  3169.  
  3170.  
  3171.  
  3172.  
  3173.  
  3174.  
  3175.  
  3176.  
  3177.  
  3178.  
  3179. Name: RESETPOINT
  3180.  
  3181. Type: Video / BIOS
  3182.  
  3183. Description:
  3184.      Resets a point on a text screen.  This is the opposite of SETPOINT (see).
  3185.  
  3186. Example:
  3187.      ROW=0
  3188.      FOR COLUMN=0 to 79
  3189.         CALL RESETPOINT(COLUMN,ROW)
  3190.      NEXT COLUMN
  3191.      REM  this clears a line from the top of the screen
  3192.      REM  (undoes the line from the SETPOINT example)
  3193.  
  3194.  
  3195.  
  3196.  
  3197. Name: REVERSE
  3198.  
  3199. Type: String / ANY
  3200.  
  3201. Description:
  3202.      Reverses  the  order of characters in a string.  This can be combined with
  3203. the  XLATE  function  and  a  judiciously-designed translation table to provide
  3204. mirror images of strings for character-graphics-based displays.
  3205.  
  3206. Example:
  3207.      MSG$="This is a test": CALL REVERSE(MSG$): PRINT MSG$
  3208.  
  3209.  
  3210.  
  3211.  
  3212. Name: RROTATE
  3213.  
  3214. Type: String / ANY
  3215.  
  3216. Description:
  3217.      Rotates  the  characters  in a string right.  This is the same as LROTATE,
  3218. only in reverse.  See LROTATE for further details.
  3219.  
  3220. Example:
  3221.      ST$ = "12345": CALL RROTATE(ST$)
  3222.      REM  ST$ will end up being "51234"
  3223.  
  3224.  
  3225.  
  3226.  
  3227.  
  3228.  
  3229.  
  3230.  
  3231.  
  3232.  
  3233.  
  3234.  
  3235.  
  3236.  
  3237.  
  3238.  
  3239.  
  3240.  
  3241.  
  3242.  
  3243.  
  3244.  
  3245. Name: SCROLL
  3246.  
  3247. Type: Video / BIOS
  3248.  
  3249. Description:
  3250.      Scrolls any selected portion of the screen as many times as you like
  3251. (or  use  0  to  clear that part of the screen entirely).  There are five para-
  3252. meters  to this function: coordinates (LEFTCOL,TOPROW) of the upper left corner
  3253. of  the  area  to  be  scrolled,  coordinates (RTCOL,BOTROW) of the lower right
  3254. corner  of the area to be scrolled, and the number of times to scroll the area.
  3255. This  routine  may be used to create windows.  Note that RTCOL must be at least
  3256. one  greater  than  LEFTCOL  (no single-line scrolling, obviously).  Parameters
  3257. are not checked, so be careful not to use illegal screen coordinates.
  3258.  
  3259. Example:
  3260.      CALL SCROLL(LEFTCOL,TOPROW,RTCOL,BOTROW,NUMLINES)
  3261.  
  3262.  
  3263.  
  3264.  
  3265.  
  3266.  
  3267.  
  3268.  
  3269.  
  3270.  
  3271.  
  3272.  
  3273.  
  3274.  
  3275.  
  3276.  
  3277.  
  3278.  
  3279.  
  3280.  
  3281.  
  3282.  
  3283.  
  3284.  
  3285.  
  3286.  
  3287.  
  3288.  
  3289.  
  3290.  
  3291.  
  3292.  
  3293.  
  3294.  
  3295.  
  3296.  
  3297.  
  3298.  
  3299.  
  3300.  
  3301.  
  3302.  
  3303.  
  3304.  
  3305.  
  3306.  
  3307.  
  3308.  
  3309.  
  3310.  
  3311. Name: SCRREST
  3312.  
  3313. Type: Video / CLONE
  3314.  
  3315. Description:
  3316.      Restores  the  screen  display from an image put into an array by SCRSAVE.
  3317. Same requirements and limitations of SCRSAVE.
  3318.  
  3319. Example:
  3320.      WHERE = VARPTR(SCR(1)): CALL SCRREST(WHERE): LOCATE OLDROW,OLDCOL
  3321.  
  3322.  
  3323.  
  3324.  
  3325. Name: SCRSAVE
  3326.  
  3327. Type: Video / CLONE
  3328.  
  3329. Description:
  3330.      Stores  the  current screen display (page 0 only) in an array.  Text modes
  3331. only.   Requires  an  array  of  4000 bytes, and an integer which points to the
  3332. location of the array.  The cursor position is not saved.
  3333.  
  3334. Example:
  3335.      DEFINT A-Z: OPTION BASE 1: DIM SCR(2000)
  3336.       .
  3337.       .
  3338.      WHERE = VARPTR(SCR(1)): CALL SCRSAVE(WHERE)
  3339.      OLDCOL = POS(0) : OLDROW = CSRLIN
  3340.      REM  Dim of 2000 w/ option base 1 gives us 2000 integers, each of
  3341.      REM  which occupy two bytes, giving 4000 bytes of storage space.
  3342.      REM  Note: you can store more than one screen in an array by
  3343.      REM  dimensioning it large enough.  Use WHERE=VARPTR(SCR(2001))
  3344.      REM  to locate the second screen, and so forth.
  3345.  
  3346.  
  3347.  
  3348.  
  3349. Name: SCRRESTP, SCRRESTPD, SCRSAVEP, SCRSAVEPD
  3350.  
  3351. Type: Video / CLONE
  3352.  
  3353. Description:
  3354.      These  functions are variations of SCRREST and SCRSAVE.  All of them allow
  3355. specification  of a page number, for color monitors.  They will save or restore
  3356. text  to a given page.  When used with monochrome monitors, the page specifica-
  3357. tion  should  always  be  zero.   SCRRESTPD and SCRSAVEPD write directly to the
  3358. screen  at  high  speed.   This  will cause "snow" if you have an old or poorly
  3359. designed  color  display  adapter  and  are  writing to the active screen page.
  3360. Under those conditions, you should use SCRRESTP/SCRSAVEP or SCRREST/SCRSAVE.
  3361.  
  3362. Example:
  3363.      WHERE = VARPTR(SCR(1)) : SCRNPAGE = 0
  3364.      CALL SCRRESTP(WHERE,SCRNPAGE) : LOCATE OLDROW,OLDCOL
  3365.  
  3366.  
  3367.  
  3368.  
  3369.  
  3370.  
  3371.  
  3372.  
  3373.  
  3374.  
  3375.  
  3376.  
  3377. Name: SETCOMM
  3378.  
  3379. Type: Miscellaneous / CLONE
  3380.  
  3381. Description:
  3382.      Sets  communications  parameters on an opened communications device.  This
  3383. allows  you  to set  the  baud  rate  higher than BASIC normally allows, and to
  3384. change the comm parameters without having to close the comm device.
  3385.      Note  that  BASIC  currently limits access to comm ports one and two.  You
  3386. can  set parms on ports 1-4 using SETCOMM, however.  Hopefully a future release
  3387. of ADVBAS will allow you to use the other two ports if you have them.
  3388.      Why  is  it  bad to have to close the comm device?  Because that will make
  3389. the  DTR  signal  drop,  which  will  cause many modems to drop the carrier and
  3390. lose  your  connection.   In  fact,  for  Hayes-type modems, that's a much more
  3391. reliable way to end communications than using the ATH "hang up modem" command.
  3392.      If  you  try to set a comm port which does not exist, the port number will
  3393. be  set  to  zero  after  the  call.  If you give illegal parameters elsewhere,
  3394. the  port  will  be set to a default of 300 baud, Even parity, Seven-bit words,
  3395. and One stop bit (any of the parms which were legal will be used).
  3396.  
  3397. Example:
  3398.      OPEN"R",1,"COM1:300,E,7,1,RS,CS,DS"
  3399.      COMMPORT = 1 : BPS = 6 : PARITY = 0 : WORDLENGTH = 8 : STOPBITS = 1
  3400.      CALL SETCOMM(COMMPORT,BPS,PARITY,WORDLENGTH,STOPBITS)
  3401.      REM sets the port to 19200 baud, No parity, 8 bit words, 1 stop bit.
  3402.  
  3403. Settings:
  3404.      COMMPORT  may  be  1  - 2, and will be returned as 0 if the specified port
  3405. doesn't exist.  Four ports are allowed, but you can only access 1 and 2.
  3406.      BPS  ("baud  rate")  is  specified  by a number from 0 - 7.  Use 0 for 300
  3407. bps,  1  for  600, 2 for 1200, 3 for 2400, 4 for 4800, 5 for 9600, 6 for 19200,
  3408. and  7  for  38400 bps.  Whether you can actually get higher speeds will depend
  3409. on the quality of your communications port.
  3410.      PARITY is a number 0-2.  Use 0 for None, 1 for Odd, and 2 for Even.
  3411.      WORDLENGTH is 7 or 8, and STOPBITS is 1 or 2, just as you'd expect.
  3412.  
  3413.  
  3414.  
  3415.  
  3416. Name: SETDRV
  3417.  
  3418. Type: Disk / DOS
  3419.  
  3420. Description:
  3421.      Sets  the  default drive.  The drive string must be at least one character
  3422. long, and start with a letter specifying a disk drive.
  3423.  
  3424. Example:
  3425.      DRV$="B:"
  3426.           .
  3427.           .
  3428.      CALL SETDRV(DRV$)
  3429.  
  3430.  
  3431.  
  3432.  
  3433.  
  3434.  
  3435.  
  3436.  
  3437.  
  3438.  
  3439.  
  3440.  
  3441.  
  3442.  
  3443. Name: SETFATTR
  3444.  
  3445. Type: Disk / DOS
  3446.  
  3447. Description:
  3448.      Sets  file  attribute.   See section on file attributes at the end of this
  3449. manual.
  3450.  
  3451. Example:
  3452.      FIL$ = FIL$ + CHR$(0): CALL SETFATTR(FIL$,ATTR)
  3453.  
  3454.  
  3455.  
  3456.  
  3457. Name: SETFTD
  3458.  
  3459. Type: Disk / DOS
  3460.  
  3461. Description:
  3462.      Sets  file  time/date  stamp.   The filename must be terminated with a NUL
  3463. character.   The  year  may  be  either a four digit or two digit number (e.g.,
  3464. may  be  either  1986 or just 86).  DOS will round the seconds value off to the
  3465. next  lower  even  number.   If there is a problem with the filename, the month
  3466. will be returned as -1.
  3467.  
  3468. Example:
  3469.      FIL$=FIL$+CHR$(0)
  3470.      CALL SETFTD(FIL$,MONTH,DAY,YEAR,HOUR,MINUTE,SECOND)
  3471.  
  3472.  
  3473.  
  3474.  
  3475.  
  3476.  
  3477.  
  3478.  
  3479.  
  3480.  
  3481.  
  3482.  
  3483.  
  3484.  
  3485.  
  3486.  
  3487.  
  3488.  
  3489.  
  3490.  
  3491.  
  3492.  
  3493.  
  3494.  
  3495.  
  3496.  
  3497.  
  3498.  
  3499.  
  3500.  
  3501.  
  3502.  
  3503.  
  3504.  
  3505.  
  3506.  
  3507.  
  3508.  
  3509. Name: SETMATI
  3510.  
  3511. Type: Miscellaneous / ANY
  3512.  
  3513. Description:
  3514.      Sets the first SIZ elements of an integer array to a given (scalar) value,
  3515. INITVAL.   It will work on multi-dimensional arrays, in which case the leftmost
  3516. dimension increments first.  See examples for clarification.
  3517.  
  3518. Example:
  3519.      OPTION BASE 0: DEFINT A-Z: DIM BANANA(9)
  3520.      SIZ=10: INITVAL=-3: ARLOC=VARPTR(BANANA(0))
  3521.      CALL SETMATI(ARLOC,SIZ,INITVAL)
  3522.      REM  we have just initialized all 10 elements of the array to
  3523.      REM  the value -3.
  3524.  
  3525. Example:
  3526.      OPTION BASE 1: DEFINT A-Z: DIM FOO(3,5)
  3527.      SIZ=5: INITVAL=20000: ARLOC=VARPTR(FOO(1,1))
  3528.      CALL SETMATI(ARLOC,SIZ,INITVAL)
  3529.      REM  we have just set the first five elements of the array to
  3530.      REM  20000.  The first five elements are FOO(1,1), FOO(2,1),
  3531.      REM  FOO(3,1), FOO(1,2), FOO(2,2).  If you wanted to initialize
  3532.      REM  the whole array to 20000, you'd set SIZ=3*5 for OPTION BASE 1,
  3533.      REM  or SIZ=(3+1)*(5+1) for OPTION BASE 0, in this case...
  3534.      REM  By changing the first element (in the ARLOC assignment), you
  3535.      REM  can set any part of the array, not just the first elements.
  3536.      REM  See SCRSAVE/SCRREST if you need to clear up that last point.
  3537.  
  3538.  
  3539.  
  3540.  
  3541.  
  3542.  
  3543.  
  3544.  
  3545.  
  3546.  
  3547.  
  3548.  
  3549.  
  3550.  
  3551.  
  3552.  
  3553.  
  3554.  
  3555.  
  3556.  
  3557.  
  3558.  
  3559.  
  3560.  
  3561.  
  3562.  
  3563.  
  3564.  
  3565.  
  3566.  
  3567.  
  3568.  
  3569.  
  3570.  
  3571.  
  3572.  
  3573.  
  3574.  
  3575. Name: SETKBD
  3576.  
  3577. Type: Input / CLONE
  3578.  
  3579. Description:
  3580.      Sets  the  status  of  the  keyboard toggles.  The toggle is set on if the
  3581. value  is  nonzero,  and  off  if the value is zero.  Good style suggests that,
  3582. before  using  this  function  for  the  first time, you should get the toggles
  3583. with  GETKBD  (see)  and  save  them.   You should then restore the keyboard to
  3584. that original state before exiting the program.
  3585.  
  3586. Example:
  3587.      REM  Let's turn off Insert, Caps Lock, and Scroll Lock
  3588.      REM  and put the keypad into numeric mode by turning on Num Lock
  3589.      INSERT=0: CAPSLOCK=0: NUMLOCK=1: SCROLLLOCK=0
  3590.      CALL SETKBD(INSERT,CAPSLOCK,NUMLOCK,SCROLLLOCK)
  3591.  
  3592.  
  3593.  
  3594.  
  3595. Name: SETPOINT
  3596.  
  3597. Type: Video / BIOS
  3598.  
  3599. Description:
  3600.      Sets  a  point  on  a text screen.  This allows low-resolution graphics on
  3601. monochrome  as  well  as  color  monitors.   Normal text can also be mixed with
  3602. the  graphics.   Resolution  is  80x50  (0-79  columns by 0-49 rows).  See also
  3603. RESETPOINT and TESTPOINT.
  3604.  
  3605. Example:
  3606.      ROW=24
  3607.      FOR COLUMN=0 TO 79
  3608.         CALL SETPOINT(COLUMN,ROW)
  3609.      NEXT COLUMN
  3610.      REM  this draws a line across the middle of the screen.
  3611.  
  3612.  
  3613.  
  3614.  
  3615. Name: SETSUB
  3616.  
  3617. Type: Disk / DOS
  3618.  
  3619. Description:
  3620.      Sets  the  default subdirectory.  The subdirectory string must be at least
  3621. one  character  in  length,  since  it  must  be terminated by a NUL character.
  3622. The ERRCODE will be set if there was a problem moving to the given subdirectory
  3623. (either it's not available on the default drive, or a bad name, most likely).
  3624.  
  3625. Example:
  3626.      TMP$ = SUB$+CHR$(0): CALL SETSUB(TMP$,ERRCODE)
  3627.      IF ERRCODE THEN bad subdir ELSE new default subdir selected
  3628.  
  3629.  
  3630.  
  3631.  
  3632.  
  3633.  
  3634.  
  3635.  
  3636.  
  3637.  
  3638.  
  3639.  
  3640.  
  3641. Name: SHIFTL
  3642.  
  3643. Type: Miscellaneous / ANY
  3644.  
  3645. Description:
  3646.      Shifts  all  the  bits  in  an integer left COUNT times, putting zeroes in
  3647. the  bit  positions  which  have been vacated.  This effectively multiplies the
  3648. value  by  a  power  of  two  in most instances.  This function is included for
  3649. those  advanced  programmers  who know what it's good for... if that's not you,
  3650. be careful!
  3651.  
  3652. Example:
  3653.      VALUE = 47: COUNT = 3
  3654.      CALL SHIFTL(VALUE,COUNT)
  3655.      REM  we just shifted VALUE left three bits
  3656.      REM  (in this case getting 47 * 2^3, or 376)
  3657.  
  3658.  
  3659.  
  3660.  
  3661. Name: SHIFTR
  3662.  
  3663. Type: Miscellaneous / ANY
  3664.  
  3665. Description:
  3666.      Same  as  SHIFTL,  but  shifts  the  bits  right instead of left.  This is
  3667. similar in effect to an integer divide by a power of two.
  3668.  
  3669. Example:
  3670.      VALUE = 47: COUNT = 3
  3671.      CALL SHIFTR(VALUE,COUNT)
  3672.      REM  we just shifted VALUE right 3 bits
  3673.      REM  (here getting 47 \ 2^3, or 5)
  3674.  
  3675.  
  3676.  
  3677.  
  3678.  
  3679.  
  3680.  
  3681.  
  3682.  
  3683.  
  3684.  
  3685.  
  3686.  
  3687.  
  3688.  
  3689.  
  3690.  
  3691.  
  3692.  
  3693.  
  3694.  
  3695.  
  3696.  
  3697.  
  3698.  
  3699.  
  3700.  
  3701.  
  3702.  
  3703.  
  3704.  
  3705.  
  3706.  
  3707. Name: SOUNDEX
  3708.  
  3709. Type: String / ANY
  3710.  
  3711. Description:
  3712.      This  routine  returns  the  Soundex  code  for a string you give it.  I'm
  3713. not  sure  who  invented  Soundex,  but it's pretty handy.  The Soundex routine
  3714. takes  a  word  and returns a string which represents what the word sounds like
  3715. in  an  abstract  format.  Similar-sounding words can thus be identified easily
  3716. by  your  program after Soundex processing.  This can be useful in applications
  3717. where  a  person  is  not  sure of the exact spelling of a word/name/city, etc.
  3718. To  use,  put  the  word  in  WORD$, initialize the return string SCODE$ to the
  3719. same  length  as  WORD$, and execute the routine.  SLEN% will return the actual
  3720. length  of  SCODE$, which may vary from zero to the length of WORD$.  If SCODE$
  3721. is  not  as  long  as  WORD$ when the routine is called, SLEN% will be returned
  3722. as  -1  to  flag  an error.  The Soundex code is returned as a series of digits
  3723. in SCODE$, although you can represent this any way you choose in your program.
  3724.  
  3725. Example:
  3726.      WORD$ = "AnyWord": SCODE$=WORD$: CALL SOUNDEX(WORD$,SCODE$,SLEN)
  3727.      PRINT"The Soundex code for ";WORD$;" is ";LEFT$(SCODE$,SLEN);"."
  3728.      REM  Try this routine a few times to get a feel for it.
  3729.  
  3730.  
  3731.  
  3732.  
  3733. Name: SPEAKER
  3734.  
  3735. Type: Miscellaneous / CLONE
  3736.  
  3737. Description:
  3738.      This  function  allows  you  to  turn  the speaker on or off.  This allows
  3739. you  to  disable  sound  effects for a program.  Your sound routines will still
  3740. be  executed,  but  will  not  produce any sound if you have turned the speaker
  3741. off.   Thus,  your routines will execute at the same speed whether or not sound
  3742. is  turned  on, and the timing will remain the same.  Note that you should turn
  3743. the speaker back on before exiting the program!
  3744.      Use zero to turn off the speaker, nonzero to turn it back on.
  3745.  
  3746. Example:
  3747.      SPKR = 0
  3748.      CALL SPEAKER(SPKR)
  3749.      REM  turn the speaker off
  3750.  
  3751.  
  3752.  
  3753.  
  3754.  
  3755.  
  3756.  
  3757.  
  3758.  
  3759.  
  3760.  
  3761.  
  3762.  
  3763.  
  3764.  
  3765.  
  3766.  
  3767.  
  3768.  
  3769.  
  3770.  
  3771.  
  3772.  
  3773. Name: STRIP
  3774.  
  3775. Type: String / ANY
  3776.  
  3777. Description:
  3778.      Strips  all  occurrences  of  a given target character from a given source
  3779. string.   The  source  string  may  be any length; the target string must be at
  3780. least  one  character.   The  new  length of the source string will be returned
  3781. as an integer, since external routines may not change the length of BASIC
  3782. strings directly.
  3783.  
  3784. Example:
  3785.      MSG$="12 - 2 =   10"
  3786.           .
  3787.           .
  3788.      CH$=" ": CALL STRIP(MSG$,CH$,MLEN): MSG$ = LEFT$(MSG$,MLEN)
  3789.  
  3790.  
  3791.  
  3792.  
  3793.  
  3794.  
  3795.  
  3796.  
  3797.  
  3798.  
  3799.  
  3800.  
  3801.  
  3802.  
  3803.  
  3804.  
  3805.  
  3806.  
  3807.  
  3808.  
  3809.  
  3810.  
  3811.  
  3812.  
  3813.  
  3814.  
  3815.  
  3816.  
  3817.  
  3818.  
  3819.  
  3820.  
  3821.  
  3822.  
  3823.  
  3824.  
  3825.  
  3826.  
  3827.  
  3828.  
  3829.  
  3830.  
  3831.  
  3832.  
  3833.  
  3834.  
  3835.  
  3836.  
  3837.  
  3838.  
  3839. Name: STRIPRANGE
  3840.  
  3841. Type: String / ANY
  3842.  
  3843. Description:
  3844.      Strips  all  characters  within a given range out of a source string.  The
  3845. source  string  may  be  any  length.  The new length of the source string will
  3846. be returned as an integer.
  3847.  
  3848. Example:
  3849.      MSG$="ALL uppercase letters will be G-O-N-E gone"
  3850.      LO = ASC("A"): HI = ASC("Z")
  3851.      CALL STRIPRANGE(MSG$,LO,HI,MLEN): PRINT LEFT$(MSG$,MLEN)
  3852.  
  3853.  
  3854.  
  3855.  
  3856. Name: SUBEXIST
  3857.  
  3858. Type: Disk / DOS
  3859.  
  3860. Description:
  3861.      Tests  to see if a given subdirectory exists.  A nonzero value is returned
  3862. if  it does, zero if it doesn't.  You may include a drive spec in the subdirec-
  3863. tory name, which must be terminated by a null.
  3864.  
  3865. Example:
  3866.      SUBDIR$ = "C:\TEMP" + CHR$(0)
  3867.      CALL SUBEXIST(SUBDIR$,VALID)
  3868.      IF VALID THEN PRINT"Subdirectory exists" ELSE PRINT"No such subdirectory"
  3869.  
  3870.  
  3871.  
  3872.  
  3873.  
  3874.  
  3875.  
  3876.  
  3877.  
  3878.  
  3879.  
  3880.  
  3881.  
  3882.  
  3883.  
  3884.  
  3885.  
  3886.  
  3887.  
  3888.  
  3889.  
  3890.  
  3891.  
  3892.  
  3893.  
  3894.  
  3895.  
  3896.  
  3897.  
  3898.  
  3899.  
  3900.  
  3901.  
  3902.  
  3903.  
  3904.  
  3905. Name: TESTPOINT
  3906.  
  3907. Type: Video / BIOS
  3908.  
  3909. Description:
  3910.      Tests  a  pixel  on  a  text screen to see if it's on or off (see SETPOINT
  3911. for  information  about  text graphics).  The value returned will be set if the
  3912. point is set, or reset if the point is not set.
  3913.  
  3914. Example:
  3915.      COL=39: ROW=24: REM  check a point near the middle of the screen
  3916.      CALL TESTPOINT(COL,ROW,STATUS)
  3917.      IF STATUS THEN PRINT"The point is lit" ELSE PRINT"The point is not lit"
  3918.  
  3919.  
  3920.  
  3921.  
  3922. Name: TIME2INT
  3923.  
  3924. Type: Miscellaneous / ANY
  3925.  
  3926. Description:
  3927.      Squeezes  the  time down to a single integer, for reduced storage require-
  3928. ments.   You  will  lose  some accuracy in the seconds, which will be converted
  3929. to  an  even  number  (odd  numbers will be rounded down).  To avoid ambiguity,
  3930. it  is  recommended  that  you  specify  hours using a 24-hour clock.  See also
  3931. INT2TIME.
  3932.  
  3933. Example:
  3934.      CALL(HOUR,MIN,SEC,SQZTIME)
  3935.  
  3936.  
  3937.  
  3938.  
  3939. Name: TIMEN2S
  3940.  
  3941. Type: String / ANY
  3942.  
  3943. Description:
  3944.      Converts  the  time  from  numbers  to  a string.  The string should be at
  3945. least eight bytes long.  See also TIMES2N.
  3946.  
  3947. Example:
  3948.      HOUR=13: MIN=30: SEC=48: TIM$=SPACE$(8)
  3949.      CALL TIMEN2S(HOUR,MIN,SEC,TIM$)
  3950.      REM  We get TIM$ = "13:30:48" from this
  3951.  
  3952.  
  3953.  
  3954.  
  3955.  
  3956.  
  3957.  
  3958.  
  3959.  
  3960.  
  3961.  
  3962.  
  3963.  
  3964.  
  3965.  
  3966.  
  3967.  
  3968.  
  3969.  
  3970.  
  3971. Name: TIMES2N
  3972.  
  3973. Type: String / ANY
  3974.  
  3975. Description:
  3976.      Converts  the  time  from  a string to numbers.  The seconds are optional,
  3977. and will be set to zero if nonexistent.
  3978.  
  3979. Example:
  3980.      TIM$ = "13:09:42"
  3981.      CALL TIMES2N(HOUR,MIN,SEC,TIM$)
  3982.      REM  We get HOUR=13, MIN=9, SEC=42
  3983.      TIM$ = "03:15"
  3984.      CALL TIMES2N(HOUR,MIN,SEC,TIM$)
  3985.      REM  We get HOUR=3, MIN=15, SEC=0
  3986.  
  3987.  
  3988.  
  3989.  
  3990. Name: TINSTR
  3991.  
  3992. Type: STRING / ANY
  3993.  
  3994. Description:
  3995.      Allows  you  to  search  for  a  given  type of character within a string.
  3996. You  may  search  for  any  of  several character types by adding the values of
  3997. the  types  to  search  for.   This  also allows you to search for the opposite
  3998. of a character type (that is, search for anything other than that type).
  3999.  
  4000. Character types:
  4001. 1
  4002.      Alphabetic  A-Z, a-z
  4003. 2
  4004.      Numeric     0-9
  4005. 4
  4006.      Symbolic    (anything not covered by other types)
  4007. 8
  4008.      Control     (control codes: ASCII 0-31, 127)
  4009. 16
  4010.      Graphics    (PC graphics codes: 128-255)
  4011. 32
  4012.      Blank       (a blank space, ASCII 32)
  4013.  
  4014. Example:
  4015.      CHRTYPE = 1+2+4+8+16  : REM search for first non-blank character
  4016.      CALL TINSTR(ST$,CHRTYPE,PLACE)
  4017.      IF PLACE=0 THEN PRINT "The string contains no non-blank characters" _
  4018.      ELSE PRINT "The first nonblank character is at location";PLACE;"."
  4019.  
  4020. Example:
  4021.      CHRTYPE = 2  : REM search for first numeric character
  4022.      ST$ = "Springfield, VA 22152"
  4023.      CALL TINSTR(ST$,CHRTYPE,PLACE)
  4024.      PRINT "The zip code is: ";MID$(ST$,PLACE,5)
  4025.  
  4026.  
  4027.  
  4028.  
  4029.  
  4030.  
  4031.  
  4032.  
  4033.  
  4034.  
  4035.  
  4036.  
  4037.  
  4038.  
  4039.  
  4040.  
  4041.  
  4042.  
  4043. Name: UPCASE
  4044.  
  4045. Type: String / ANY
  4046.  
  4047. Description:
  4048.      Converts  a  string  to  all  uppercase.  Leaves non-alphabetic characters
  4049. untouched.  String may be any length.
  4050.  
  4051. Example:
  4052.      MSG$="Four score and seven years ago"
  4053.                .
  4054.                .
  4055.      CALL UPCASE(MSG$)
  4056.  
  4057.  
  4058.  
  4059.  
  4060.  
  4061.  
  4062.  
  4063.  
  4064.  
  4065.  
  4066.  
  4067.  
  4068.  
  4069.  
  4070.  
  4071.  
  4072.  
  4073.  
  4074.  
  4075.  
  4076.  
  4077.  
  4078.  
  4079.  
  4080.  
  4081.  
  4082.  
  4083.  
  4084.  
  4085.  
  4086.  
  4087.  
  4088.  
  4089.  
  4090.  
  4091.  
  4092.  
  4093.  
  4094.  
  4095.  
  4096.  
  4097.  
  4098.  
  4099.  
  4100.  
  4101.  
  4102.  
  4103.  
  4104.  
  4105.  
  4106.  
  4107.  
  4108.  
  4109. Name: WEEKDAY
  4110.  
  4111. Type: Miscellaneous / DOS
  4112.  
  4113. Description:
  4114.      Returns  an  integer  from  1  -  7 indicating the day of the week, Sunday
  4115. through Saturday.  The example routine turns this integer into the week day.
  4116.  
  4117. Example:
  4118.      CALL WEEKDAY(DAY%): DLEN% = VAL(MID$("3346535",DAY,1))
  4119.      DLOC% = ASC(MID$("ADGKQVY",DAY%))-64: REM  This string MUST be uppercase!
  4120.      PRINT"Today is ";MID$("SunMonTuesWednesThursFriSatur",DLOC%,DLEN%);"day."
  4121.  
  4122.  
  4123.  
  4124.  
  4125. Name: WRITEBITF
  4126.  
  4127. Type: Miscellaneous / ANY
  4128.  
  4129. Description:
  4130.      Allows  a  value  to be written into a given location of a simulated array
  4131. of  words  of  arbitrary  bit  length  (1-8 bits per word).  This goes with the
  4132. READBITF  function  above.   The "BITF" is for Bit Field, because the functions
  4133. work  by  creating  fields  of  arbitrary bit length within what is actually an
  4134. integer array.
  4135.  
  4136. Example:
  4137.      CALL WRITEBITF(ARRAYLOC,INDEX,BITFSIZE,VALUE)
  4138.      REM  See the READBITF function, and check out the BITFTEST.BAS if you
  4139.      REM  have the ADVBAS contributor disk, to better idea of what these
  4140.      REM  functions do.  This function is not for novice programmers!
  4141.  
  4142.  
  4143.  
  4144.  
  4145.  
  4146.  
  4147.  
  4148.  
  4149.  
  4150.  
  4151.  
  4152.  
  4153.  
  4154.  
  4155.  
  4156.  
  4157.  
  4158.  
  4159.  
  4160.  
  4161.  
  4162.  
  4163.  
  4164.  
  4165.  
  4166.  
  4167.  
  4168.  
  4169.  
  4170.  
  4171.  
  4172.  
  4173.  
  4174.  
  4175. Name: XLATE
  4176.  
  4177. Type: String / ANY
  4178.  
  4179. Description:
  4180.      This  function  translates a string, character by character, using a table
  4181. you  supply.   The  character's  ASCII value is used as the index to the table,
  4182. and  the  value  at  that location replaces the character's current value.  The
  4183. character  may  be  one  byte  in  length, in which case it will be translated,
  4184. or  zero  bytes,  in  which  case  nothing will happen.  The translation string
  4185. must  be  256  bytes  long  (remember,  strings may be longer than 255 bytes in
  4186. Compiled BASIC, so this is ok).
  4187.  
  4188. Example:
  4189.     XLT$ = "": FOR X=0 TO 255: XLT$=XLT$+CHR$(X): NEXT
  4190.     MID$(XLT$,1,5) = "ABCDE": CH$ = CHR$(0)
  4191.     CALL XLATE$(CH$,XLT$): PRINT CH$
  4192.     REM  CH$ ends up "A", since the start of the table + zero bytes
  4193.     REM      contains "A".  We add zero bytes, because CH$ was
  4194.     REM      originally equal to CHR$(0).
  4195.  
  4196.  
  4197.  
  4198.  
  4199. Name: XMPRINT
  4200.  
  4201. Type: Video / BIOS
  4202.  
  4203. Description:
  4204.      This  routine  combines the XLATE and MPRINTC functions.  It takes a char-
  4205. acter,  runs it through a translation table, and prints it to the screen unless
  4206. the  translated  value  is  NUL  (ASCII  zero).  If it's NUL, no printing takes
  4207. place.   MS-DOS  calls  are  used for printing, so ANSI.SYS will work.  See the
  4208. XLATE and MPRINTC routines for further information.
  4209.  
  4210. Example:
  4211.      CALL XMPRINT(CH$,XLATE$,COL,ROW): LOCATE ROW,COL
  4212.  
  4213.  
  4214.  
  4215.  
  4216.  
  4217.  
  4218.  
  4219.  
  4220.  
  4221.  
  4222.  
  4223.  
  4224.  
  4225.  
  4226.  
  4227.  
  4228.  
  4229.  
  4230.  
  4231.  
  4232.  
  4233.  
  4234.  
  4235.  
  4236.  
  4237.  
  4238.  
  4239.  
  4240.  
  4241. Name: XQPRINT
  4242.  
  4243. Type: Video / CLONE
  4244.  
  4245. Description:
  4246.      This  function  is  an  extended  version of QPRINT.  It is more flexible,
  4247. and  only  a  trifle slower.  XQPRINT has two advantages over QPRINT: it allows
  4248. you  to  choose  a  color/attribute  to use, and lets you choose a display page
  4249. (color/graphics  adapters  only!).   The  attribute  ATTR  must be set up using
  4250. the CALCATTR routine.  The page argument is ignored for monochrome adapters.
  4251.  
  4252. Example:
  4253.      ST$ = "This is a test of fast screen printing"
  4254.      ROW = 10: COL = 20: PAGE = 0
  4255.      CALL CALCATTR(FOREGND,BACKGND,ATTR)
  4256.      CALL XQPRINT(ST$,ROW,COL,ATTR,PAGE)
  4257.  
  4258.  
  4259.  
  4260.  
  4261. Name: XQPRINTD
  4262.  
  4263. Type: Video / CLONE
  4264.  
  4265. Description:
  4266.      This  function  is  identical  to  XQPRINT, with the one exception that it
  4267. writes directly to the screen.  That makes it even faster than XQPRINT, but
  4268. means  that  it  will  cause  snow  on some color monitors when printing to the
  4269. active display page.
  4270.  
  4271.  
  4272.  
  4273.  
  4274.  
  4275.  
  4276.  
  4277.  
  4278.  
  4279.  
  4280.  
  4281.  
  4282.  
  4283.  
  4284.  
  4285.  
  4286.  
  4287.  
  4288.  
  4289.  
  4290.  
  4291.  
  4292.  
  4293.  
  4294.  
  4295.  
  4296.  
  4297.  
  4298.  
  4299.  
  4300.  
  4301.  
  4302.  
  4303.  
  4304.  
  4305.  
  4306.  
  4307.                                 File Attributes
  4308.  
  4309.  
  4310.  
  4311.  
  4312.      Every  file  has an "attribute byte" which tells something about the file.
  4313. This  can  be  modified  to  some  extent.   For instance, any file can be made
  4314. "hidden",  in  which  case  it will be invisible; this includes subdirectories,
  4315. which  can  still be used even if you can't see that they're there.  Some kinds
  4316. of  changes  are  not  possible,  however: you can't change a subdirectory into
  4317. a normal file, for example.
  4318.  
  4319.  
  4320. Attribute      Code      Description
  4321.  
  4322. Normal         00h       A normal file.
  4323. Read-only      01h       File can be renamed, but not killed or modified.
  4324. Hidden         02h       File disappears from directory, can't be opened.
  4325. System         04h       Like HIDDEN.  Used for system (DOS, BIOS) files.
  4326. Volume-ID      08h       A disk's volume id.  Can only be one, in root dir.
  4327. Directory      10h       Subdirectory.  Can't be changed to another attribute.
  4328. Archive        20h       Usually set.  Sometimes used for hard disk backup.
  4329.  
  4330.  
  4331.      Combinations  of the codes are possible, as I've mentioned.  For instance,
  4332. a  hidden  subdirectory  would  have a code of 10h + 02h = 12h.  A normal file,
  4333. because  of  the  archive bit, might show up as either 00h or 20h... and so on.
  4334. Note  this  is  all  in hexadecimal, hence the "h" postfix.  Convert to decimal
  4335. form  as  necessary  when calling routines which use the file attribute.  BASIC
  4336. has  functions  to  handle  this  for you if you don't understand hex-- see the
  4337. HEX$ function and &H prefix in your BASIC manual.
  4338.  
  4339.  
  4340.  
  4341.  
  4342.  
  4343.  
  4344.  
  4345.  
  4346.  
  4347.  
  4348.  
  4349.  
  4350.  
  4351.  
  4352.  
  4353.  
  4354.  
  4355.  
  4356.  
  4357.  
  4358.  
  4359.  
  4360.  
  4361.  
  4362.  
  4363.  
  4364.  
  4365.  
  4366.  
  4367.  
  4368.  
  4369.  
  4370.  
  4371.  
  4372.  
  4373.                              New file I/O routines
  4374.  
  4375.  
  4376.  
  4377.      This  contains  some  general information about the new file I/O routines:
  4378. FCLOSE, FCREATE, FOPEN, FREAD, FSETEND, FSETREC, and FWRITE.
  4379.  
  4380.      These  routines  duplicate  a  number of extant BASIC functions.  They are
  4381. useful,  however,  for  a  number  of reasons.  They provide you with low-level
  4382. control  over  the  details  of file input and output.  They may be safely used
  4383. in  subprograms,  since  they  return error codes rather than using error trap-
  4384. ping  (subprograms  have  severe  limitations  on use of error trapping).  They
  4385. provide  access  to  the  file-level locking capabilities of DOS 2.0 and above,
  4386. which  allows  creation  of  programs which work on normal computers as well as
  4387. those  with  multitasking or networking (BASIC's record-level locking is incom-
  4388. patible with normal computers unless SHARE is activated).
  4389.  
  4390.      In  BASIC,  you  give the file a number when you open it, and refer to the
  4391. file  by  that  number  from then on.  With the ADVBAS functions, you are given
  4392. a  "handle"  when  you open the file, which serves the same purpose.  In BASIC,
  4393. a  file  is  automatically  created  (or truncated if it exists) if you open it
  4394. for  output.   With  ADVBAS,  you  must use FCREATE to produce that result.  If
  4395. you  have  an  existing  file  which  you  want to modify (or read), use FOPEN.
  4396. With  ADVBAS,  like  BASIC,  you  can read or write to a file, or move the file
  4397. pointer  to  a  given  record  or  to  the end of file (to append information).
  4398. Also like BASIC, you must close a file when you are finished using it.
  4399.  
  4400. The error codes returned by these functions are as follows:
  4401.   -1    Unable to read or write the entire record
  4402.    2
  4403.         File not found
  4404.    3    Path not found
  4405.    4    No handle available
  4406.    5    Access denied
  4407.    6    Invalid handle
  4408.   15    Invalid drive specification
  4409.  
  4410.      If  you get "no handle available", you have run out of room to open files.
  4411. You  can fix this by not opening so many files at the same time, or by increas-
  4412. ing the FILES=xx statement in your CONFIG.SYS.  See your DOS manual for further
  4413. information.
  4414.  
  4415.  
  4416.  
  4417.  
  4418.  
  4419.  
  4420.  
  4421.  
  4422.  
  4423.  
  4424.  
  4425.  
  4426.  
  4427.  
  4428.  
  4429.  
  4430.  
  4431.  
  4432.  
  4433.  
  4434.  
  4435.  
  4436.  
  4437.  
  4438.  
  4439.  
  4440.                                   BASCOM Bugs
  4441.  
  4442.  
  4443.  
  4444. Microsoft QuickBASIC Compiler v1.00:
  4445.  
  4446.      If  there  is not enough memory when you try to execute the SHELL command,
  4447. your  program  will crash.  There is no way to avoid this using error trapping,
  4448. because  the  memory  reallocation  will  have fried the stack.  So even if you
  4449. trap  the  OUT  OF MEMORY error, you'll still crash with a RETURN WITHOUT GOSUB
  4450. if  you  try  to return from a subroutine, or a STRING SPACE CORRUPT error when
  4451. the  compiler  gets  around  to  doing  a string garbage collection.  Bad news.
  4452. It would be nice if it tried to check to see if there was enough memory first.
  4453.  
  4454.      The error STRING FORMULA TOO COMPLEX appears erratically in some programs,
  4455. even  with  the  simplest possible string formulae (like V$="TEST").  This only
  4456. seems  to  happen  in  programs  which  do  a lot of string manipulation, which
  4457. suggests  that  the compiler has a flaky and is doing something wrong with gar-
  4458. bage  collection,  or  something  like  that.   There seems to be no way to get
  4459. around  this bug either-- also bad news.  If you have this problem, I recommend
  4460. that you complain vociferously to Microsoft!
  4461.  
  4462.  
  4463. Microsoft QuickBASIC Compiler v1.02:
  4464.  
  4465.      I  haven't  had  a  chance  to  test it out much, but they claim that this
  4466. release  solves  the  SHELL  crash  problem.  Also, more control characters are
  4467. now  printed  out  just  like  BASICA.   Many  miscellaneous problems have been
  4468. fixed...
  4469.           But not the infamous STRING FORMULA TOO COMPLEX error.  Sigh.
  4470.  
  4471.  
  4472.  
  4473.  
  4474.  
  4475.  
  4476.  
  4477.  
  4478.  
  4479.  
  4480.  
  4481.  
  4482.  
  4483.  
  4484.  
  4485.  
  4486.  
  4487.  
  4488.  
  4489.  
  4490.  
  4491.  
  4492.  
  4493.  
  4494.  
  4495.  
  4496.  
  4497.  
  4498.  
  4499.  
  4500.  
  4501.  
  4502.  
  4503.  
  4504.  
  4505.  
  4506.  
  4507.                                   BASCOM Bugs
  4508.  
  4509.  
  4510.  
  4511. Microsoft QuickBASIC Compiler v2.00:
  4512.  
  4513.      Well,  this  release  fixes  yet  more  compiler bugs.  The STRING FORMULA
  4514. TOO  COMPLEX  error  lives  on,  however.  I'm going to have to track that down
  4515. and  send  in  an  example program to Microsoft, I guess, as soon as I can find
  4516. the  time.   A few new functions have been added, but nothing particularly use-
  4517. ful.   The  new  programming environment (a la Turbo Pascal) is poorly designed
  4518. for  an  environment  which is evidently supposed to mimic the "intuitive" feel
  4519. of  the  MacIntosh  (later  note: it  works  fairly sensibly with a mouse, just
  4520. not  with  the  keyboard).   The editor really isn't adequate, and suffers from
  4521. a  number  of  irritating  bugs.  The compiler is now a massive 180K, and takes
  4522. forever  to  load.  The new "user library feature" is a nuisance-- it is incom-
  4523. patible  with  standard  libraries,  and  is poor from a developer's standpoint
  4524. because  you  are  required  to  list all the names of all the subprograms in a
  4525. library whenever you modify the library.
  4526.      The  one  thing  that is really good about the new version of the compiler
  4527. is the manual, which is quite excellent-- enormous, clear and detailed.
  4528.  
  4529. ANNOYANCES:
  4530.      The  editor  has a defective search-and-replace function, adds blank lines
  4531. at  the  end  of  the  program  under certain conditions, and allows you to put
  4532. some  control  characters  directly  into the program (which gives the compiler
  4533. odd problems).
  4534.      When  entering  the  filename,  you have to use Shift-Backspace instead of
  4535. the  Delete  key  to delete characters.  The use of TAB, SPACE, RETURN, and the
  4536. arrow  keys when making a choice on the menus is arbitrary, weird, and counter-
  4537. intuitive  in  the  extreme  (later  note: it works better if you use a mouse).
  4538. If  you  use  the  old  method of compiling, bypassing the new environment, you
  4539. no  longer get any error messages, just an error count.  You can't get a source
  4540. listing any more, either.
  4541.  
  4542. BUGS:
  4543.      If your program uses error trapping, it must have at least one line number
  4544. in  the  program,  even  if  lines  are only accessed by labels.  Otherwise, if
  4545. you  get  an  error,  the  program  crashes  out  instead of going to the error
  4546. handler.  
  4547.      Screen paging doesn't work.
  4548.      If  you  have  a  REMark  on the same line as a DATA statement, you'll get
  4549. peculiar error messages.
  4550.  
  4551.  
  4552. Microsoft QuickBASIC v2.01:
  4553.      This  is  an  update  to  v2.00, which is being distributed free of charge
  4554. to  registered  owners of QB 2.00.  It consists entirely of fixes to an amazing
  4555. number  of bugs in the v2.00 compiler, and corrections to errors in the manual.
  4556. Get this by all means!
  4557.  
  4558.  
  4559.  
  4560.  
  4561.  
  4562.  
  4563.  
  4564.  
  4565.  
  4566.  
  4567.  
  4568.  
  4569.  
  4570.  
  4571.  
  4572.  
  4573. Wish list for Microsoft's QuickBASIC:
  4574.  
  4575.      Recursive functions.
  4576.      No bugs!  At least, less blatant ones!
  4577.      Production of code which can be linked with other languages.
  4578.      A smaller compiler (make the new environment and editor an option, please,
  4579. and put the error messages back!).
  4580.      Less massive overhead for producing stand-alone programs.
  4581.      An  error  trapping  function  that returns the label of the routine where
  4582. the error took place (like ERL, only for labels).
  4583.      Communications  functions  which  don't  produce  errors  whenever you get
  4584. the slightest bit of line noise.
  4585.  
  4586.  
  4587. Notes on Borland's Turbo BASIC, shipping around April of 1987:
  4588.  
  4589.      Like  QuickBASIC,  it's  almost completely compatible with BASICA/GWBASIC.
  4590. Unlike  QuickBASIC,  it  supports recursive functions, and real local variables
  4591. as  well  as those weird static local variables.  It has a programming environ-
  4592. ment  which  appears  to  be  a cross between Turbo Pascal and QuickBASIC.  I'm
  4593. hoping  that  the  editor is the same Wordstar-type editor as T.Pascal, and not
  4594. something  bizarre  like  the  QuickBASIC editor.  Turbo BASIC looks good.  Its
  4595. main  fault  seems to be that it lacks an assembly language interface-- it uses
  4596. the  same  machine  language  INLINE  format as Turbo Pascal.  This is going to
  4597. make  it  a  nuisance  to  convert ADVBAS for use with Turbo BASIC, if I decide
  4598. to do so.
  4599.      I've  only  had the chance to play around a bit with a pre-production ver-
  4600. sion of T.BASIC, so don't take these remarks as gospel.
  4601.  
  4602.  
  4603.  
  4604.  
  4605.  
  4606.  
  4607.  
  4608.  
  4609.  
  4610.  
  4611.  
  4612.  
  4613.  
  4614.  
  4615.  
  4616.  
  4617.  
  4618.  
  4619.  
  4620.  
  4621.  
  4622.  
  4623.  
  4624.  
  4625.  
  4626.  
  4627.  
  4628.  
  4629.  
  4630.  
  4631.  
  4632.  
  4633.  
  4634.  
  4635.  
  4636.  
  4637.  
  4638.  
  4639.                                   BASIC Bugs
  4640.  
  4641.  
  4642.  
  4643.  
  4644.      This  is  a  peculiar  one... it  seems that BASIC can create files having
  4645. names  which  contain  blank  spaces.  This is a problem, because DOS considers
  4646. the  space  to  be a delimiter, and thus cannot handle these files.  Such files
  4647. will not be listed correctly in the directory, and will be impossible to manipu-
  4648. late  from  DOS  (can't  read,  delete,  or otherwise handle the file).  So, be
  4649. careful  to  screen  out  spaces  when  creating files from BASIC!  This caveat
  4650. also  applies  to  subdirectories,  including  those  created  with the MAKESUB
  4651. routine of ADVBAS.
  4652.  
  4653.  
  4654.  
  4655. Call for help:
  4656.  
  4657.      If  you  find  any  other  bugs in any IBM/Microsoft BASIC compiler, or in
  4658. ADVBAS  for  that  matter,  please  let me know.  If I can't fix it, at least I
  4659. can warn people!
  4660.  
  4661.  
  4662.  
  4663.  
  4664.  
  4665.  
  4666.  
  4667.  
  4668.  
  4669.  
  4670.  
  4671.  
  4672.  
  4673.  
  4674.  
  4675.  
  4676.  
  4677.  
  4678.  
  4679.  
  4680.  
  4681.  
  4682.  
  4683.  
  4684.  
  4685.  
  4686.  
  4687.  
  4688.  
  4689.  
  4690.  
  4691.  
  4692.  
  4693.  
  4694.  
  4695.  
  4696.  
  4697.  
  4698.  
  4699.