253B NewFileVersion¶
Stub MON 253B (171 decimal) · Mnemonic CRALN · Group: File Operations (manual section 2.4)
Available from: All programs (manual compatibility box)
Emulation source: src/handlers/mon_253B_NewFileVersion.c
Description¶
Creates new versions of a file. You may create new versions for both indexed, contiguous and allocated files.
- You must have directory access to the user area where you create the file. User SYSTEM and RT get the owners access rights.
- The number following the semicolon in a file name is the version number. For example, TEST:SYMB:4 version 4 of the file.
- The file must exist in advance.
- Use DeleteFile to delete file versions.
Parameters¶
| Name | Type | Direction | Description |
|---|---|---|---|
FileName |
STRING | In | The file name including the version number (up to 64 chars). The version number defines the total number of versions. |
FirstPage |
INTEGER | In | Start address of the first new version. Use 0 for contiguous and indexed files. |
NoOfPages |
INTEGER | In | File size in pages. Use 0 for indexed files. |
Direction: In = the program supplies the value, Out = the call returns it, In/Out = both.
See also¶
CreateFile, @CREATE-NEW-VERSIONS, and @ALLOCATE-NEW-VERSIONS
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 | No | No | No |
Examples¶
From the manual (OCR text, not corrected).
INTEGER4 : FirstPage, NoOfPages
BYTES : FileName(0:63)
...
ON ROUTINEERROR DO
IF ErrCode > 0 THEN ...
ENDON
Monitor_Call('NewFileVersion', FileName, FirstPage, NoOfPages)
CHARACTER FileName*64
INTEGER*4 FirstPage, NoOfPages
...
Monitor_Call('NewFileVersion', FileName(1:64), FirstPage, NoOfPages)
IF (ErrCode .NE. 0) THEN ...
FileName : PACKED ARRAY [0..63] OF CHAR;
FirstPage, NoOfPages : LONGINT;
...
NewFileVersion(FileName, FirstPage, NoOfPages);
IF ErrCode <> 0 THEN ...
01 FileName PIC X(64).
01 FirstPage COMP PIC S9(10).
01 NoOfPages COMP PIC S9(10).
01 ErrCode COMP.
...
MONITOR-CALL "NewFileVersion" USING FileName, FirstPage, NoOfPages.
CALL "CbError" USING ErrCode.
IF ErrCode NOT = 0 GO ...
FileName : STRINGDATA 'EXAMPLE:SYMB;2''' %Make a 2nd version of ...
FirstPage : W BLOCK 1
NoOfPages : W BLOCK 1
ErrCode : W BLOCK 1 % EXAMPLE:SYMB.
NewFileVersion : EQU 37B9 + 253B
...
CALLG NewFileVersion, 3, FileName, FirstPage, NoOfPages
IF K GO ERROR
...
ERROR : W1 =: ErrCode %ErrorCode in W1 register.
LDX (FILE %Address of string containing file name.
LDD PAGNO %Page number of first page.
LDT (PAGES %Address of number of pages.
MON 253 %Monitor call NewFileVersion.
JMP ERROR %Error return from monitor call.
... %Normal return.
ERROR, ... %Error number in register A.
FILE, 'EXAMPLE:SYMB;2' %Create 2nd version of file EXAMPLE:SYMB
PAGNO, ... %
... %A double word.
PAGES, ... %
... %A double word.
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_253B_NewFileVersion |
| Code lines | 8 (non-blank, non-comment lines in the file) |
Source¶
SINTRAN III Monitor Calls (ND-860228.2 EN), page 351.