home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 224 / 224.d81 / t.manual4 < prev    next >
Text File  |  2022-08-26  |  5KB  |  162 lines

  1. u
  2.            D A T A T O O L
  3.  
  4.  
  5. SAVE FILES
  6.  
  7.  Similar to loading, you have the
  8. option to save a worksheet including
  9. all settings as a Datatool program
  10. file, or to export data to any
  11. destination by using your own BASIC
  12. code.
  13.  
  14.  To Save a worksheet, just type in the
  15. filename (you can use quotation marks
  16. to fix the length of the filename) and
  17. press RETURN in the cell of your
  18. choice: save, verify, or both. To
  19. overwrite an existing file, enter @:
  20. before the actual filename. The system
  21. will then scratch the file on disk
  22. before saving (it will not use the
  23. buggy floppy command to overwrite).
  24. Worksheet files are stored as a "prg"
  25. file, and you can actually run them:
  26. If you start a session on the C64, you
  27. can load a worksheet file and run it,
  28. as well as you can load "datatool",8,1
  29. first, and the file afterwards.
  30.  
  31.  The Export option is the counterpart
  32. to the Import option described above.
  33. The opening code is executed once, the
  34. export row code is executed for every
  35. filled data row or result row in the
  36. worksheet (label, pause or BASIC rows
  37. are ignored), and finally the BASIC
  38. sequence for closing the file is
  39. called.
  40.  
  41.  You may use this option for
  42. transferring data to another program
  43. -- e.g. a word processor -- or for
  44. exchanging data between worksheets.
  45. But keep a few rules in mind:
  46.  
  47. * When opening a file, do not use a
  48.    secondary address lower then 2 or
  49.    any higher then 14, because they
  50.    are reserved for floppy commands.
  51.    E.g. open 2,8,2,"filename,s,w"
  52.    would be okay to write to a
  53.    sequential file. (The examples
  54.    later on build up on this opening
  55.    example.)
  56.  
  57. * Although the floppy directory
  58.    distinguishes between prg and seq
  59.    files, you can't use the same
  60.    filename for different filetypes.
  61.  
  62. * Do not forget to delete a file that
  63.    you want to rewrite, using the disk
  64.    command
  65.  
  66.     open1,8,15,"s:filename":close1
  67.  
  68.    before opening the actual file for
  69.    writing. The BASIC statements
  70.    print#, get#, and input#, are quite
  71.    comfortable for exchanging data,
  72.    but a little bit tricky also. Here
  73.    is an overview:
  74.  
  75. Send
  76.   Strings
  77.     print#2,x$ sends the content of x$
  78.     and a "carriage return" (CR =
  79.     CHR$(13)) afterwards, which tells
  80.     the end of the variable. (You can
  81.     supress the CR by adding a
  82.     semicolon (print#2,x$;).)
  83.  
  84.     If the variable is supposed to be
  85.     received with input#, it should
  86.     not contain a comma, and it should
  87.     not be empty (check empty string
  88.     before: if x$="" then x$=" " )
  89.  
  90.   Numbers
  91.     print#2,x sends a number - not in
  92.     any special numeric format, but it
  93.     converts it into a string of
  94.     digits, ended with a CR. For
  95.     sending single Bytes (0-255) you
  96.     can convert the Byte in a single
  97.     character and send the ASCII-code:
  98.     print#2,chr$(x);.
  99.  
  100.     The print# statement can be used
  101.     with several variables strung
  102.     together, separated by semicolons
  103.     or commas. The effect is that all
  104.     variables will be sent without
  105.     recognizable separation, loosing
  106.     their allocation. This only might
  107.     be useful in the case that
  108.     variables consists of one single
  109.     byte by design. Otherwise a single
  110.     print# statement should be used
  111.     for each variable.
  112.  
  113. Receive
  114.   String
  115.     get#2,x$ will fetch one single
  116.     byte or character. The only
  117.     exception is that if the byte is
  118.     zero, x$ won't contain a zero
  119.     code, but will have zero length.
  120.     If you want to do the
  121.     ASC-function, you must calculate
  122.     it as x=asc(x$+chr$(0)) in order
  123.     to avoid a BASIC error.
  124.  
  125.   Number
  126.     get#2,x expects a single digit
  127.     coded in ASCII. Any aberration
  128.     will be prompted with an error
  129.     message. Therefore this variation
  130.     is seldom. In order to get a
  131.     single byte, use get#2,x$ and the
  132.     ASC-function instead.
  133.  
  134.     input#2,x$ will collect characters
  135.     until a comma (ASCII 44) or a CR
  136.     (ASCII 13) tells the end of the
  137.     variable. The received string is
  138.     not allowed to have zero length,
  139.     and the maximum length is limited
  140.     to 80 characters.
  141.  
  142.     input#2,x acts like with string
  143.     variables, but converts the
  144.     collected string into a numeric
  145.     variable. If the received
  146.     characters don't fit, it causes an
  147.     error message.
  148.  
  149.  The get# and input# statements can be
  150. used with several variables strung
  151. together, separated by commas. This is
  152. not a counterpart to the similar
  153. looking print# statement. The
  154. variables strung together will be
  155. received in the same way as it would
  156. be with several single statements
  157. concerning one variable each.
  158.  
  159.  FK
  160.             MORE TO COME!
  161.  
  162.  
  163.