home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / calculat / sm30a.zip / SYMBMATH.H16 < prev    next >
Text File  |  1993-11-07  |  3KB  |  66 lines

  1.         3.3.7  Read and Write Statements
  2.     The format of the readfile statement is
  3.         readfile("filename")
  4. The filename is any MS-DOS file anme. It seems to copy the file into the 
  5. user program.
  6. e.g. to read a file named "inte.sm":
  7.         readfile("inte.sm")
  8.     The file to be read must be in the current directory.
  9.     After a file is read, you can call any part of this 
  10. package from a second package, as it seems the part of the first 
  11. program has already been in the second program. you can read 
  12. many files into the SymbMath program at a time. However, all names 
  13. of the variables are public and name conflicts must be avoided.
  14.     Write a file to disk by
  15.         openfile("file")
  16.         ...
  17.         closefile("file")
  18.         
  19.     Table 3.3.7.         Reading and Writing Statements
  20. ---------------------------------------------------------------------
  21. readchar                read a charactor from  keyboard.
  22. readline                read a line of strings from keyboard.                                                
  23. readfile("file")        read (run or include) the file named "file".
  24. ......................................................................
  25. openfile("file")        open the disk file "file" for writing.
  26. closedfile("file")      closed the file "file".
  27. writes(s)               write s on screen, only on graphics mode.
  28. newline                 write next text on a new line.
  29. null                    not write.
  30. block(a,b)              write the value of the last arguement, b.
  31. ---------------------------------------------------------------------
  32. where the filename is any MS-DOS filename.
  33.     Note that the file must be closed by the closefile() command when
  34. writing a file with the openfile() command, but the file is automatically
  35. closed after reading the file. There must be the end statement at the end
  36. of file for reading.
  37.     SymbMath can read expressions from a disk file, then manipulate 
  38. the expression, and finally write the result into another disk file.
  39.     Example: an expression y:=x^6 is already in the file "y.in",
  40.  
  41. The contents of the file "y.in":
  42. ---------------------------------------------------------------------
  43. y:=x^6
  44. -----------------------------------------------------------------------
  45.  
  46.     run this SymbMath program
  47. ----------------------------------------------------------------------------
  48. readfile("y.in")        # read the expression y:=x^6 from the file "y.in"
  49. openfile("y.out")       # open a disk file "y.out" for writing
  50. d(y,x)                  # differentiate y and write the result to the file
  51. closefile("y.out")      # close the file and return output to SymbMath
  52. ----------------------------------------------------------------------------
  53.  
  54. The contents of the file "y.out":
  55. ---------------------------------------------------------------------
  56. 6*x^5
  57. ---------------------------------------------------------------------
  58.  
  59. In this way you can interface to other software (see 3.7. Interface with
  60. Other Software).
  61.     These outputs in the disk file can be edited in the Edit window 
  62. or the Aux Edit window. 
  63.     It is recommended to use the BASIC output format by setting 
  64. the switch output:=basic when you write the output into the disk file.
  65. The default switch is output:=math.
  66.