6 5 Lce3GLGetValue

LANSA Open Guide

6.5 Lce3GLGetValue

Retrieves the parameter value returned by the Lce3GLCall function.

BOOL

Lce3GLGetValue 

(int

iSession,

 

 

 Int

iParam,

 

 

 Int

iSubParam,

 

 

 Char far *

strValue)

  

Parameters

iSession

The session identifier as returned by LceGetSessionId.

iParam

The first level number of the parameter to be retrieved.

iSubParam

The number of the sub-parameter within this first level parameter.

strValue

The storage location to receive the returned value. The size of strValue should be at least iLength + 4 (as defined in Lce3GLDefineParameter).

  

Return Values

TRUE is returned if the session has got the parameter value.

FALSE is returned if an error occurs.

Notes

Portability Considerations

Lce3GLGetValue is only supported if your host system is an IBM i. Unpredictable data will be returned by Lce3GLGetValue if an error was returned by the host from Lce3GLCall.

  

The Lce3GLGetValue function retrieves the value of a sub-parameter from a first level parameter block, following a call to Lce3GLCall, so that a parameter passed back by the called IBM i program may be used in the application.

The sub-parameter requested in this function must be in a first level parameter block which has been declared using an Lce3GLDefineParameter function with a strDirection of "R" (parameter block is return by the 3GL program) or "B" (parameter block is passed in both directions).

The sub-parameter data is converted to a string. If the parameter you requested is numeric, strValue will contain a string value representing the numeric value. You need to convert the string value to a numeric before using it in your application.

If the parameter is defined as "Binary", the strValue "string" pointer passed in this parameter is used as the base into which to return exactly iLength bytes without regard for NULL string terminating characters. (That is, NULL value bytes are copied and do not terminate the data).

If the parameter is defined as "Date", "Time" or "DateTime", strValue will contain the date and/or time string in the current locale format.

An error will be returned if the 3GL program returned data in the parameter block that is not suitable for conversion using the defined type, length and decimals.

  • This function may be executed at any time after the session is opened.
  • This function performs no communications to the host.

Related Functions

6.4 Lce3GLDefineParameter

6.3 Lce3GLCall