| Next|| Previous || Top |

USER_PRINT

This keyword data block is used to define Basic programs that print user-defined quantities to the output file. Any Basic "PRINT" statement will write to the output file.

Example data block

Line 0: USER_PRINT
Line 1:      -start
Basic:  10 REM convert to ppm
Basic:  20 PRINT "Sodium:    ", MOL("Na+")* 22.99 * 1000 
Basic:  30 PRINT "Magnesium: ", MOL("Mg+2")* 24.3 * 1000 
Basic:  40 pairs = MOL("NaCO3-") + MOL("MgCO3") 
Basic:  50 PRINT "Pairs (mol/kgw): ", pairs
Basic:  60 REM print reaction increment
Basic:  70 PRINT "Rxn incr : ", RXN
Line 2:      -end

Explanation

Line 0: USER_PRINT

USER_PRINT is the keyword for the data block. No other data are input on the keyword line.

Line 1: -start

-start--Indicates the start of the Basic program. Optional.

Basic: numbered Basic statement

numbered Basic statement --A valid Basic language statement that must be numbered. The program should contain at least one "PRINT" statement. The statements are evaluated in numerical order. Statements and functions that are available through the Basic interpreter are listed in tables 8 and 9.

Line 2: -end

-end--Indicates the end of the Basic program. Optional. Note the hyphen is required to avoid a conflict with the keyword END.

Notes

USER_PRINT allows the user to write Basic programs to make calculations and print selected results as the program is running. Results of PRINT Basic statements are written directly to the output file after each calculation. More information on the Basic interpreter is available in the description of the RATES keyword. All of the functions defined in tables 8 and 9 are available in USER_PRINT Basic programs. Writing results of USER_PRINT can be enabled or suspended with the -user_print identifier in the PRINT data block. The USER_PUNCH data block is similar to USER_PRINT, except PUNCH Basic statements are used to write results to the selected-output file.

Example problems

The keyword USER_PRINT is used in example problem 6, 10, and 12.

Related keywords

PRINT, RATES, SELECTED_OUTPUT, and USER_PUNCH.


| Next|| Previous || Top |