$procReturnContext

Get context information about the value returned by the ProcScript instruction that last set $procReturnContext.

Result = $procReturnContext

Return Values

When used after selected ProcScript instructions, $procReturnContext returns an associative list of items concerning that ProcScript instruction. The content of the list depends on the command that set it. The following table lists the common items.

Common Items Returned by $ProcReturnContext
Item Description
Context = Context Value indicating the previously executed command that set $procReturnContext; one of:
  • EntityCopy
  • StructToComponent
  • StructToXml
  • XmlToStruct
  • StructToJson
  • JsonToStruct
  • UDE Copy
  • UDE Import
  • UDE Exist
  • UDE Export
  • UDE Compile
Infos=Number

Warnings=Number

Errors=Number

Number of messages, warnings, and non-fatal errors generated during processing
DETAILS = String Messages, warnings, and non-fatal errors encountered during processing, structured as a Uniface list

An item is omitted if its value is zero or an empty string.

ProcScript Commands that Set $procReturnContext

The $procReturnContext function provides additional information for ProcScript instructions that are typically involved in batch processing and data conversion. It can be used after:

The information returned in $procReturnContext depends on the command that was used. The following examples show the different outputs that may be produced (formatted for readability).

$procReturnContext after $ude ("compile")

Context=UDE compile ;
InputComponents=2 ;
OutputComponents=1 ;
Infos=32 ;
Warnings=2 ;
Errors=1 ;
Details=
 ID=1016!!;
  MESSAGE=(Fields for) entity DEBUG not found in application model, generating now...!!; 
  SEVERITY=Warning!;
 ID=1301!!;
  MESSAGE=Component variable "LNR" is not referenced in the component.!!;
  SEVERITY=Info!;
...

$procReturnContext after entitycopy

Context=EntityCopy;
 InputRecords=9;
 OutputRecords=9;
 InputDescriptors=5;
 OutputDescriptors=5;
 InputXmlFiles=1;
 Release=9.5;
 DETAILS=
  Operation=entitycopy!!;
    From=mycars.xml!!;
    To=!!;
    InputRecords=0!!;
    OutputRecords=0!!;
    DETAILS=·!·;
  Operation=entitycopy!!;
    From=mycars.xml!!;
    To=!!;
    InputRecords=1!!;
    OutputRecords=0!!;
    DETAILS=
      ID=8078!!!!;
      MESSAGE=8078 - Copy from 'mycars.xml' to 'DEF:UCSCH.DICT'.!;
  Operation=entitycopy!!;
    From=mycars.xml!!;
    To=!!;
    InputRecords=0!!;
    OutputRecords=1!!;
    DETAILS=
      ID=8074!!!!;
      MESSAGE=8074 - Copied from 'mycars.xml' to 'DEF:UCSCH.DICT' total records/rows 1.!;
   Operation=entitycopy!!;
     From=mycars.xml!!;
     To=!!;
     InputRecords=1!!;
     OutputRecords=0!!;
     DETAILS=
       ID=8078!!!!;
       MESSAGE=8078 - Copy from 'mycars.xml' to 'DEF:UCTABLE.DICT'.!;
....

$procReturnContext after structToXML

Context=StructToXml;
Warnings=1;
DETAILS=
  ID=-1160!!;
    SEVERITY=Warning!!;
    MNEM=<STRUCTERR_TAGVALUE_NOT_APPLICABLE>!!;
    DESCRIPTION=Struct tag value not applicable in conversion from struct!!;
    CURRENTSTRUCT=""->#comment{1}!!;
    ADDITIONAL=
      TAGNAME=xmlClass!!!;
      TAGVALUE=commen!!!;  
      EXPECTED=Struct valid on XML document level

$procReturnContext after structToJson

Context=StructToJson;
Warnings=2;
DETAILS=
    SEVERITY=Warning!;
    CURRENTSTRUCT=""!;
    ADDITIONAL=Encountered unexpected jsonClass: Xobject!!;  
    SEVERITY=Warning!;
    CURRENTSTRUCT=""!;
    ADDITIONAL=Duplicate struct member name encountered: a 
History
Version Change
9.7.04 (G412) Added UDE Exist to the accepted Context values.
9.5.01 Added structToComponent and structToXml to the ProcScript commands that can set this function.

Replaced the AdditionalInfo section with DETAILS section containing messages, warnings, and errors.

9.1.01

Introduced

Related Topics