home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / forth / compiler / fpc / help / handles.hlp < prev    next >
Encoding:
Text File  |  1989-09-21  |  6.1 KB  |  161 lines

  1. HANDLES.HLP     Hnadles documentation
  2.  
  3. HANDLE          ( | name --- )
  4.         creates an array/handle for name, which holds the files
  5.         attributes, handle number, and null terminated name.
  6.  
  7. >ATTRIB         ( handle --- attrib-addr )
  8.         Step to the attribute field of the handle.
  9.  
  10. >HNDLE          ( handle --- handle-addr )
  11.         Step to the handel storage field of the handle array.
  12.  
  13. >NAM            ( handle --- name-string-addr )
  14.         Step to the null terminated name field of the handle
  15.  
  16. FILE1           ( --- a1 )
  17. FILE2           ( --- a1 )
  18.         Define a couple of handles for testing
  19.  
  20. DEFEXT          ( --- a1 )
  21.         An array holding the default extention "SEQ".
  22.  
  23. ?DEF.EXT        ( --- )
  24.         If the specified file name has no "." indicating the
  25.         extension, then supply one from the default.
  26.  
  27. $>HANDLE        ( filename1  handle1 --- )
  28.         Move a counted filename1 string into handle1 for use by
  29.         the following words.
  30.  
  31. !HCB            ( a1 | name --- )
  32.         Get "name" from the input stream and move it into the handle a1.
  33.  
  34. FCB>HANDLE      ( a1 a2 --- )
  35.         Copy the file name and extention from the specified FCB a1 to
  36.         handle a2.
  37.  
  38. HANDLE>EXT      ( a1 --- a2 )
  39.         Moves the address from the handle to the decimal point in the
  40.         filename, if it exists.  Otherwise it steps to the null
  41.         immediately following the filename.
  42.  
  43. $>EXT           ( a1 n1 a2 --- )
  44.         Move the specified string a1,n1 to the extension field of the
  45.         handle a2. The string a1,n1 should be the file extension excluding
  46.         the decimal point. i.e. " XYZ"  not  " .XYZ"
  47.  
  48. HDOS1           ( cx dx fun -- ax cf | error-code 1 )
  49.         Define a dos call assembly word, which is later used by
  50.         HOPEN and HCREATE.
  51.  
  52. HDOS3   Yet another DOS call.
  53. HDOS4   Still another native DOS call.
  54.  
  55. MovePointer     ( double-offset handle --- )
  56.         Move the file pointer for handle to the position
  57.         double-offset in the file already open in handle.
  58.  
  59. EndFile         ( handle --- double-end )
  60.         Return the double-end pointer for the file open in
  61.         handle, also sets the pointer to the end of the file.
  62.         Useful for finding the end of a file, and for appending
  63.         to the end of a file.
  64.  
  65. PATHSET         ( handle --- f1 )
  66.         Set the current drive path into handle. returns boolean f1
  67.         true if an error occured while performing this operation.
  68.  
  69. <HRENAME>
  70.         Code primitive for the HRENAME function below.
  71.  
  72. HRENAME         ( handle1 handle2 --- return-code )
  73.         Change the name of the file specified in handle1 to the
  74.         name specified in handle2. Can be used to move a file
  75.         from one directory to another on the same drive.
  76.         Returns 18 if the rename was good, not zero.
  77.  
  78. HCREATE         ( handle --- error-code )
  79.         Create the file specified in handle, if the file already exists,
  80.         then it is ZEROed !! Returns zero if no error occured. The file
  81.         is automatically created ready for write operations.
  82.  
  83. RWMODE          ( --- a1 )
  84.         The variable rwmode, which defaults to a value of 2,
  85.         controls the read write mode of the file being opened,
  86.         the value 2 is read, or write, a value of 1 specifies
  87.         write only, and a value of 0 specifies read only.
  88.  
  89. R/W-DMODE       ( -- n1 )
  90.         Return the value of the current default read/write mode. This
  91.         value is used to restore the default mode after each HOPEN is
  92.         performed. See also DEF-RWMODE
  93.  
  94. DEF-RWMODE      ( -- )
  95.         This word allow you to set the default read/write mode used
  96.         by F-PC for all file open operations. It is used as follows:
  97.  
  98.                         READ-WRITE DEF-RWMODE
  99.                 or      READ-ONLY  DEF-RWMODE
  100.  
  101.         All further file open operations will be in the newly
  102.         specified mode.
  103.  
  104. READ-ONLY       ( -- )
  105.         The next file opened can be accessed with read operations only.
  106.  
  107. READ-WRITE      ( -- )
  108.         Open a file for read and write operations. See also READ-ONLY
  109.         and WRITE-ONLY.
  110.  
  111. WRITE-ONLY      ( -- )
  112.         Open a file for write only. See also READ-ONLY and READ-WRITE.
  113.         This word and the previous two words effect only the next HOPEN
  114.         operation to be performed. After the open is done, RWMODE
  115.         reverts to the default mode for later file opens.
  116.  
  117. HOPEN           ( handle --- error-code )
  118.         Open the file specified in handle, return error-code zero if the
  119.         file was opened properly. Unless otherwise specified, the file is
  120.         opened for both read and write operations.
  121.  
  122. HCLOSE          ( handle --- f1 )
  123.         Close the file specified by handle, return bool f1
  124.         non-zero if an error occured.
  125.  
  126. HDELETE         ( handle --- f1 )
  127.         Delete the file specified by handle, return bool f1
  128.         non-zero if an error occured.
  129.  
  130. EXHREAD         ( a1 n1 handle seg1 --- n2 )
  131.         Read from the file specified by handle to the extended segment
  132.         area specified by seg1, a1 for length n1. Returns n2 the
  133.         length actually read.
  134.  
  135. EXHWRITE        ( a1 n1 handle seg1 --- )
  136.         Write from memory a1,n1 in segment seg1 to the file specified
  137.         by handle.
  138.  
  139. HWRITE          ( a1 n1 handle --- n2 )
  140.         Write to a file specified by a handle from a1,n1 in the code
  141.         segment. Return n2 the length actually written.
  142.  
  143. HREAD           ( a1 n1 handle --- n2 )
  144.         Read from a file specified by a handle to a1,n1 in the
  145.         code segment.  Returns n2 the length actually read.
  146.  
  147. FINDFIRST       ( string --- f1 )
  148.         Begin a search for files specified by filespec string.
  149.         String is a null terminated un-counted string. F1 returned
  150.         indicates whether any files matched. The found file is placed
  151.         in the Data Transfer Area (DTA).
  152.  
  153.  
  154. FINDNEXT        ( --- f1 )
  155.         Continue the file search for a specified string. Returns
  156.         the bool f1 true if another match was found.
  157.  
  158. SET-DTA         ( a1 --- )
  159.         Set the Disk Transfer Area as a1.
  160.  
  161.