home *** CD-ROM | disk | FTP | other *** search
/ Black Box 4 / BlackBox.cdr / ibm1 / do101j2.arj / OPEN.SCR < prev    next >
Text File  |  1991-12-28  |  2KB  |  48 lines

  1. .pg wi full clr cy
  2.     COMMAND NAME»gray«: »%t« OpenFile »ye«
  3.  
  4.     /OPEN {handle} {filename} {mode} [{extension}] [{label}]
  5. /cw
  6.     »%t«OpenFile»#« opens a »ye«TEXT file»#« for reading or writing.
  7.  
  8.     »cy«{handle}»#«      A file handle is a number between 1-10.
  9.     »cy«{filename}»#«    The name of the file to be opened.
  10.     »cy«{mode}»#«        How the file is to be opened:
  11.                   »ye«W»gy« = »#«write
  12.                   »ye«R »gy«= »#«read
  13.                   »ye«A »gy«= »#«append
  14.     »cy«{extension}»#«   An optional parameter indicating the file is to be
  15.                   backed up before use to a file with the indicated
  16.                   extension.
  17.     »cy«{label}»#«       A label to jump to incase of an error opening the file.
  18.                   If no label is included, an error causes the command to
  19.                   jump to »gr«:OPENERROR»#«.
  20.  
  21. .pg clr
  22. Here are some examples:
  23.  
  24.     »cy«/OPEN 1 MYFILE.TXT W»#«
  25.         Open »ye«MYFILE.TXT»#« for writing.  This will »re«delete»#« any
  26.         text in the file if it exists.
  27.  
  28.     »cy«/OPEN 2 DOCUMENT.TXT A»#«
  29.         Open »ye«DOCUMENT.TXT»#« as file »ye«2»#« and append text to the
  30.         end of the file.  This does »re«NOT»#« delete any existing
  31.         text.  If the file does not exist, "»ye«A»#«" will function
  32.         exactly like "»gr«W»#«".
  33.  
  34. .pg cy
  35.     /OPEN 9 TEST.TXT W BAK»#«
  36.         Open »ye«TEST.TXT»#« for writing and clear all the text in
  37.         an existing file.  But first, backup TEST.TXT to
  38.         »gr«TEST.BAK»#«.
  39.  
  40.     »cy«/OPEN 3 BOOK.DOC R "" NoFile»#«
  41.         Open »ye«BOOK.DOC»#« for reading.  Do not back it up.  Jump
  42.         to the label  "»cy«:NOFILE»#«" if the file is not successfully
  43.         opened.
  44.  
  45. /ENDEXEC
  46.  
  47.  
  48.