tldm-universe/Ardent/UV/APP.PROGS/508E
2024-09-09 17:51:08 -04:00

64 lines
1.9 KiB
Plaintext
Executable File

SUBROUTINE U508E(ANS,STATUS,DATA,TYPE)
*******************************************************************************
*
* 508E - LIST CONTENTS OF A RECORD SUBROUTINE
*
* Module %M% Version %I% Date %H%
*
* (c) Copyright 1998 Ardent Software Inc. - All Rights Reserved
* This is unpublished proprietary source code of Ardent Software Inc.
* The copyright notice above does not evidence any actual or intended
* publication of such source code.
*
*******************************************************************************
*
* Maintenence log - insert most recent change descriptions at top
*
* Date.... GTAR# WHO Description.........................................
* 10/14/98 23801 SAP Change copyrights.
* 07/25/88 - - Maintenence log purged at 5.2.1, see release 5.1.10.
*
*******************************************************************************
$OPTIONS DEFAULT
ANS = ''
STATUS = 0
OPEN '',@FILENAME TO FILE.NAME ELSE
ABORT 'CAN NOT OPEN ':@FILENAME
END
IF STATUS() = 1 AND @RECORD = '' THEN
READ RECORD FROM FILE.NAME,@ID ELSE RECORD = ''; STATUS = 1
@RECORD = RECORD
END
PRINT
PRINT @ID
MAX = DCOUNT(@RECORD,@AM)
TERMW = SYSTEM(2)
FOR X = 1 TO MAX
PRTLN = ''
IF X LE 99 THEN
PRTLN = PRTLN:STR('0',3-LEN(X)):X
MARG = 3
END ELSE
PRTLN = PRTLN:X
MARG = LEN(X)
END
PRTLN = PRTLN:' '
MARG += 1
LINE = @RECORD<X>
LMAX = LEN(LINE)
PTR = 1
CC = TERMW - MARG
LOOP UNTIL LMAX LE 0 DO
IF PTR GT 1 THEN PRTLN = PRTLN:SPACE(MARG)
PRTLN = PRTLN:LINE[PTR,CC]
PRINT PRTLN
PRTLN = ''
PTR += CC
LMAX -= CC
REPEAT
NEXT X
STATUS = 0
RETURN
END