HP Pascal/iX Programmer's Guide (31502-90023)
A-: 4
Example
PROGRAM prog (outfile);
VAR
i : integer;
outfile : text;
BEGIN
rewrite(outfile);
FOR i := 1 TO 20000 DO
writeln(outfile,i);
END.
If PRG is the program file for prog and you execute the MPE/iX command
sequence
:FILE OUTFILE = FILE2
:RUN PRG
then output goes to FILE2 instead of OUTFILE.
If you execute the MPE/iX command sequence
FILE OUTFILE; DISC=21000; REC=-20,,F,ASCII
RUN PROG
then a nondefault attribute file is created.
Default File Attributes
When HP Pascal creates a file, the physical file attributes depend on the
file component type.
Table A-1 gives the default file attributes of files built by HP
Pascal programs. After the program has executed, the MPE/iX command
LISTF shows these values for the files that the program built (LISTF
attribute names are in parentheses).
Table A-1. Default File Attributes
------------------------------------------------------------------------------------------------
|| |
| How Program | Default File Attribute |
| Declares File | |
|| |
------------------------------------------------------------------------------------------------
||||||
||Record Size | File Type (TYP) | Current File Size | Maximum File Size |
||(SIZE) ||(EOF) | (LIMIT) |
||||||
------------------------------------------------------------------------------------------------
||||||
| FILE OF type | Component size | Fixed length | Number of | 1023 |
| | | binary (FB) | components | |
| | | | written | |
||||||
------------------------------------------------------------------------------------------------
||||||
| Text | 256 bytes | Variable length | Number of lines | 1023 |
| | | ASCII with | written | |
| | | carriage control | | |
| | | (VAC) | | |
||||||
------------------------------------------------------------------------------------------------
Standard Modules
Two standard modules are available on MPE/iX:
stdinput
and
stdoutput
.
If a module imports the
stdinput
module, it can use the predefined file
input
in I/O statements such as
read
and
readln
.
If a module imports the
stdoutput
module, it can use the predefined file
output
in I/O statements such as
write
and
writeln
.