tldm-universe/Ardent/UV/APP.PROGS/DC.ITEM

150 lines
5.2 KiB
Plaintext
Raw Permalink Normal View History

2024-09-09 21:51:08 +00:00
subroutine DC.ITEM( item, assoc.name, assoc.item, result )
*******************************************************************************
*
* Convert dictionary item(s) from Pick to Uni*Verse format:
* convert a single item
*
* 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/22/98 23801 SAP Change company name to Ardent.
* 10/14/98 23801 SAP Change copyrights.
* 06/30/90 7237 JWT pass pick conversions through without change
* 01/12/90 6779 JWT dont do vm to ; conversion
* 07/25/88 - - Maintenence log purged at 5.2.1, see release 5.1.10.
*
*******************************************************************************
*
* The basis for this Pick-to-Uni*Verse dictionary converter was a
* Microdata-to-Prime converter written by J. Michael Cannady and
* Thomas J. Rauschenbach of Fulcrum Computer Group, Inc. Ardent
* was granted permission to use that code by Infocel, Inc., a successor
* of Fulcrum.
*
*******************************************************************************
*
* Convert a single dictionary item from Pick to Uni*Verse format.
*
* Arguments:
* item - On entry, the Pick dictionary item to convert.
* On return, the Uni*Verse item to write.
* assoc.name - On entry, null. On return, the name of any
* "ASSOCnn" phrase to write to the dictionary.
* assoc.item - On entry, null. On return, the association phrase
* named by "assoc.name"
* result - Boolean: returned "true" if the conversion is
* successful, false otherwise
*
*******************************************************************************
*
$options DEFAULT
$include UNIVERSE.INCLUDE DC.COMM.DECL
*
equ true to 1
equ false to 0
equ CR to char( 13 ) : char( 10 )
CRT.COL = 26
LPTR.COL = 26
assoc.name = ""
assoc.item = ""
result = true
pick.item = item
*
*
*
*
******************************************************************************
*
* Look for associated multivalues. On regular Pick systems, they're
* specified in attribute 4 in the forms "C;AMC[;AMC...;AMC]" and "D;AMC".
* On a Microdata, they're specified as correlatives in the forms
* "D1;AMC[;AMC...;AMC]" and "D2;AMC". For convenience, we seek out the
* Microdata form and change it to the Pick form before processing.
*
******************************************************************************
*
if pick.item< 8 > <> "" then
assoc = ""
for i = 1 to ( count( pick.item< 8 >, @VM ) + 1 )
temp = pick.item< 8, i >
if temp matches "D1;0X" then
assoc = "C;" : temp[ 4, len( temp ) - 3 ]
pick.item = delete( pick.item, 8, i, 0 )
end else
if temp matches "D2;1N0N" then
assoc = "D;" : temp[ 4, len( temp ) - 3 ]
pick.item = delete( pick.item, 8, i, 0 )
end
end
next i
convert "," to ";" in assoc; * in case they can't type
pick.item< 4 > = assoc
end
*
*
*
A.AMC = pick.item< 2 > ;* set up COMMON variables
name = "@RECORD< " : A.AMC : " >"
*
* Strip leading spaces from correlative/conversion attributes.
*
pick.item<8> = trimf(pick.item<8>)
pick.item<7> = trimf(pick.item<7>)
psource = pick.item< 8 > ;* Pick correlative
ucode = "" ;* in COMMON
PARSE.ONLY = true ;* Really convert the code
call @DC.CORR.CONV( pick.item< 2 >, name, psource, ucode, result )
if result and ucode and psource = "" then
* convert @VM to ";" in ucode;
* pick.item< 8 > = ucode ;* I code from correlative
end else
if not( NO.ERR ) then
ins FILE : " " : ITEM.NAME before ERR.REC< -1 >
end
end
*
*
if result then
psource = pick.item< 7 > ;* Pick conversion(s)
if psource then
ucode = "" ;* in COMMON
PARSE.ONLY = true ;* just check the syntax
call @DC.CORR.CONV( pick.item< 2 >, name, psource, ucode, result )
if result and ucode and psource = "" then
* pick.item< 7 > = ucode ;* Uni*Verse conversion(s)
end else
if not( NO.ERR ) then
ins FILE : " " : ITEM.NAME before ERR.REC< -1 >
end
end
end
end
*
*
if pick.item< 4 > matches "C;0X" then; * primary associated mv
assoc.name = "ASSOC" : pick.item< 2 >
assoc.item = ""
assoc.item< 1 > = "PH"
assoc.item< 2 > = ITEM.NAME
for i = 2 to ( count( pick.item< 4 >, ";" ) + 1 )
assoc.item< 2 > = assoc.item< 2 >:" ":field( pick.item< 4 >, ";", i )
next i
assoc.item< 2 > = trim( assoc.item< 2 >)
end
universe.item = pick.item
item = universe.item
*
*
return
end