Ship Stability Software
Command of the Week
(New or interesting aspects of GHS that you may not know about)
FIN and FOUT (PMX commands)
|Reading and writing text files in Part Maker (PMX) can be done by means of the FINPUT and FOUTPUT commands. Here is what is provided:|
Creates a new text file having the given name (path may be included).
Opens an existing file, positioned such that new output goes at the end.
FOUTput() literal text
Writes one line of text (omitting leading blanks).
Writes the n lines of text that follow the command or until the 5-character line %EOF% is encountered.
Writes the evaluation of the given expression
Writes the text with a comment character (`) at the beginning of the line
Closes the output file.
Opens a text file for input.
Reads one line into the given string variable.
Closes the input file.
IF %EOF% THEN
This IF block will detect that the input file is positioned at its end.
For example, in PMX you can do this:
FOUT(EVAL) "Part "+er+" has "+STR(nerd)+" deductions."
|No kidding. It's true. This has been in PMX a long time, but someone forgot to document it. Part Maker Updates has been updated to include this information.|
Questions, comments, or requests?
Contact Creative Systems, Inc.
Office hours: 7:00 am - 4:00 pm Pacific Time, Monday - Friday Mailing address:
PO Box 1910
Port Townsend, WA 98368 USA Click here for an index to this and previous COWs