235B ScratchOpen¶
Stub MON 235B (157 decimal) · Mnemonic SCROP · Group: File Operations (manual section 2.4)
Available from: All programs (manual compatibility box)
Emulation source: src/handlers/mon_235B_ScratchOpen.c
Description¶
Opens a file as a scratch file. A maximum of 64 pages of the file is kept when you close the file. Use SET-CLOSED-FILE-SIZE in the SINTRAN-SERVICE-PROGRAM to change this.
Notes¶
- The scratch file is closed like any other opened file.
Parameters¶
| Name | Type | Direction | Description |
|---|---|---|---|
FileNo |
INTEGER | Out | File number returned for use with other monitor calls. |
AccessCode |
INTEGER | In | Access code: 0=seq write, 1=seq read, 2=random R/W, 3=random read, 4=seq R/W, 5=seq write append, 6-9=contiguous file modes. |
FileName |
STRING | In | Name of the file to be opened. |
FileType |
STRING | In | Default file type without colon. |
Direction: In = the program supplies the value, Out = the call returns it, In/Out = both.
See also¶
OpenFile, SetPermanentOpen, DirectOpen, CloseFile, @SCRATCH-OPEN
Compatibility¶
| Machines | Users | Programs |
|---|---|---|
| ND-100 and ND-500 | All users | All programs |
The manual's compatibility box for this call, word for word.
Yes/no fields from the YAML extraction (not in the manual's words):
| ND-100 | ND-500 | User programs | RT programs | System programs |
|---|---|---|---|---|
| Yes | Yes | Yes | Yes | No |
Examples¶
From the manual (OCR text, not corrected).
INTEGER : FileNo, AccessCode
BYTES : FileName(0:63), FileType(0:3)
...
ON ROUTINEERROR DO
IF ErrCode <> 0 THEN ...
ENDON
Monitor_Call('ScratchOpen', FileNo, AccessCode, FileName, FileType)
INTEGER FileNo, AccessCode
CHARACTER FileName*64, FileType*4
...
Monitor_Call('ScratchOpen', FileNo, AccessCode, FileName(1:64), FileType(1:4))
IF (ErrCode .NE. 0) THEN ...
FileNo, AccessCode : INTEGER2;
FileName : PACKED ARRAY [0..63] OF CHAR;
FileType : PACKED ARRAY [0..3] OF CHAR;
...
ScratchOpen (FileNo, AccessCode, FileName, FileType);
IF ErrCode <> 0 THEN ...
01 FileNo COMP.
01 AccessCode COMP.
01 FileName PIC X(64).
01 FileType PIC X(4).
01 ErrCode COMP.
...
MONITOR-CALL "ScratchOpen" USING FileNo, AccessCode, FileName, FileType.
CALL "CbError" USING ErrCode.
IF ErrCode NOT = 0 GO ...
FileNo : W BLOCK 1
AccessCode : W BLOCK 1
FileName : STRINGDATA 'EXAMPLE'''
FileType : STRINGDATA 'SYMB'''
ErrCode : W BLOCK 1
ScratchOpen : EQU 37B9 + 235B
...
CALLG ScratchOpen, 4, FileNo, AccessCode, FileName, FileType
IF K GO ERROR
...
ERROR : W1 := ErrCode %ErrorCode in W1 register.
LDX (FILE %Address of file name string.
LDA (TYPE %Address of default file type string.
LDT ACODE %Access code.
MON 235 %Monitor call ScratchOpen.
JMP ERROR %Error return from monitor call.
STA FILNO %Normal return, store file number.
...
ERROR, ... %Error number in register A.
...
FILNO, 0
ACODE, ...
FILE, 'EXAMPLE' %Open EXAMPLE:SYMB as a scratch file.
TYPE, 'SYMB'
ndmonlib implementation¶
Stub Registered MON_STATUS_NOT_IMPLEMENTED: the handler is a stub. mon_dispatch() in src/core/mon_dispatch.c reports the call as unimplemented without calling it.
| Handler | mon_235B_ScratchOpen |
| Code lines | 8 (non-blank, non-comment lines in the file) |
Source¶
SINTRAN III Monitor Calls (ND-860228.2 EN).