GET_PROCESS_INFO
Use the GET_PROCESS_INFO script function to retrieve general information, such as the number of columns or lines of data sequences. To do so, you must specify the data sequence to be retrieved and the information to be read.
Important! The specified data sequence must exist. Ensure that is has not yet been closed with a :CLOSE_PROCESS statement. Otherwise, a runtime error will occur. For more information, see :CLOSE_PROCESS.
Syntax
GET_PROCESS_INFO (Data sequence, Information [, Line])
Parameters
-
GET_PROCESS_INFO
Retrieves information from a data sequence -
Data sequence
Defines the data sequence whose information should be read
Format: script variable -
Information
Defines the type of information to be retrieved
Format: AE name
Allowed values:-
INDEX
Retrieves the current position of the process loop in which the data sequence is used. For more information, see :PROCESS... :TERM_PROCESS... :ENDPROCESS
-
COLUMNS
Retrieves the number of columns the defined Line has. Use this key with the Line parameter to define the number of the Line that should be used for that purpose. If you do not specify Line, the following applies:- The script function is used within a process loop: The Line that the loop currently uses applies
- The script function is used outside of a process loop: The first Line is retrieved.
-
ROWS
Retrieves the number of Lines the data sequence has
-
INDEX
- Line
(Optional) Defines the line whose number of columns should be retrieved
Format: A number without quotations, script literal or script variable
Note: You can only use this parameter when you retrieve the number of columns (Information = COLUMNS).
Return code
This script function returns the information from the data sequence.
When the number of columns should be read, you can additionally specify the corresponding line. If no line is given the used line depends on the usage of the script element:
Examples
The following example shows how you create a data sequence filled with the entries of a VARA object. Then, the number of columns is determined per line and printed in the activation report.
:SET &HND# = PREP_PROCESS_VAR(VARA.SQL,"*WIN*")
:SET &LNR# = GET_PROCESS_INFO(&HND#, ROWS)
:PROCESS &HND#
:SET &IND# = GET_PROCESS_INFO(&HND#,INDEX)
:SET &COL# = GET_PROCESS_INFO(&HND#,COLUMNS,&IND#)
:PRINT "Line &IND# / &LNR# has &COL# columns"
:ENDPROCESS
:CLOSE_PROCESS &HND#
See also: