MoveFirst method: Business Interlink class

Syntax

MoveFirst()

Description

Use the MoveFirst method to support dynamic output. This method moves your cursor to the first column, first row of the output buffer. You must use this method before you try to access any data.

Parameters

None.

Returns

Boolean: True if successfully positioned cursor at the first column, first row of the output buffer, False otherwise.

Example

In the following example, the Business Interlink object name is &MYBI. The example uses MoveFirst to move to the first row of the output buffer, and to the first column, or first field, in that row. The Repeat loop uses MoveNext to go through every row in the output buffer. The For loop processes every field in every row, using the GetFieldCount method to get the number of fields, or outputs, in the row.

/* Add inputs to the Business Interlink object, then call Execute to execute the⇒
 Business Interlink object. You are then ready to get the outputs using the⇒
 following code. */ 
If (&MYBI.MoveFirst()) Then  
   Repeat 
      For &I = 1 to &MYBI.GetFieldCount 
         &TYPE = &MYBI.GetFieldType(&I); 
         Evaluate &TYPE 
         Where = 1 
            &STRING_VARIABLE = &MYBI.GetFieldValue(&I); 
         /* test for and process other field types */ 
         End-Evaluate; 
      End-For; 
   Until Not(&MYBI.MoveNext()); 
Else 
   /* Process error - no output buffer */ 
End-If;