tldm-universe/Ardent/UV/APP.PROGS/31AD

90 lines
2.8 KiB
Plaintext
Raw Permalink Normal View History

2024-09-09 21:51:08 +00:00
subroutine U31AD( proc, ibn, pib, sib, ip, obn, pob, sob )
*******************************************************************************
*
* Retrieve nnP into a proc, where nn is the terminal number
*
* 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.
* 01/14/91 7930 JWT added patch supplied by Siemens/Nixdorf
* 02/15/90 6563 JWT made target 'S' append result (per 01AD)
* 07/25/88 - - Maintenence log purged at 5.2.1, see release 5.1.10.
*
*******************************************************************************
*
* This "user-exit" returns the user's terminal number in file name form
* onto the terminal or into the primary input buffer or current output
* buffer of a proc.
*
* Usage: proc line n: U31AD
* line n+1: target
* line n+2: normal return
*
* where target can be: T - print on the terminal screen
* P - place into primary input buffer
* S - place into the current output buffer
* A - place into the other output buffer
*
* Arguments to this subroutine are:
* proc - the text of the proc itself
* ibn - the current input buffer switch (0 = primary;
* 1 = secondary)
* pib - the primary input buffer
* sib - the secondary input buffer
* ip - the input buffer pointer
* obn - the current output buffer switch (0 = primary;
* 1 = secondary)
* pob - the primary output buffer
* sob - the secondary output buffer
*
*
*******************************************************************************
REMOVE target FROM proc SETTING x
target = TRIM( target )
answer = @USER.NO : "P"
IF LEN( answer ) < 3 THEN answer = "0" : answer
BEGIN CASE
CASE target = "S"
IF( obn ) THEN
sob := answer
END ELSE
pob := answer
END
CASE target = "A"
IF( obn ) THEN
pob = answer
END ELSE
sob = answer
END
CASE target = "P"
IF pib[ ip, 1 ] = @AM THEN ip += 1
first.part = pib[ 1, ip - 1 ] : answer : @AM
last.part = pib[ ip + 1, len( pib )]
IF pib[ ip, 1 ] # @AM THEN DEL last.part< 1 >
pib = first.part : last.part
CASE target = "T"
print answer
CASE target = "T+"
print answer:
END CASE
RETURN
END