Contents - Index


Print

 

The Print command can only be used in Internal Functions and Procedures to output intermediate results.  It cannot be used in the main program or in Subprograms.  The format of the Print command is

 

Print 'filename' x, y, z

 

Filename is the name of the text file into which the values of the designated variables will be written.  Filename can be a string constant or a string variable

 

x, y, and z are names of local variables that are defined and used within the Function or Procedure.  Both numerical and string variables are allowed.  Array name notation can be used, e.g., X[1..5].  The values of these variables will be written to the designated file.  The values of the variables appearing in the Print command must be defined before the Print command is executed.

 

The Print command will write the information to file each time the Print command is executed, creating a new row in the file output.  The first column of each row will show the name of the Function or Procedure followed by the number of times the Function or Procedure has been called since the start of the calculations in parentheses.  See the example below.

 

The file will be cleared at the start of the calculations unless the Print command is followed by the /A option.  In this case, the new information will be appended to the existing file; e.g.,

 

Print /A 'filename', x, y, z

 

If the /S option is provided, a small dialog window will open in EES after calculations are completed showing the contents of the file, as indicated in the example below

 

Example:  The following function will output values of i, x, and y in text file 'text.txt'.  

 

Function test(x,y)

 t=x+y

 F$='C:\temp\text.txt'

 i=0

 Repeat

        i=i+1

        print /S  F$, i,x,y  {Show the file after calculation are done.}

 Until (i>=t)

 test=t

End

 

g=test(2,3)