6 4 Lce3GLDefineParameter

LANSA Open Guide

6.4 Lce3GLDefineParameter

Defines the attributes of and optionally sets the current value of a parameter. These parameters are for use by the Lce3GLCall function.

BOOL

Lce3GLDefineParameter 

(int

iSession,

 

 

 int

iparam,

 

 

 int

isubParam,

 

 

 char far *

strDirection,

 

 

 char far *

strDataType,

 

 

 int

ilength,

 

 

 int

idecimal,

 

 

 char far *

strValue)

  

Parameters

iSession

The session identifier as returned by LceGetSessionId.

iparam

The first level number of the parameter to be set. The maximum number of first level parameters is 20. The base level starts at zero, so this parameter will be an integer in the range 0 to 19.

isubParam

The number of the sub-parameter within this first level parameter. The maximum number of sub-parameters is 256, with the base number starting at zero. This parameter will be an integer in the range 0 to 255.

Sub-parameters for a first level parameter must be defined in separate Lce3GLDefineParameter calls in numerically ascending order, as this call resets all numerically higher sub-parameters to "undefined" and ensures that all numerically lower sub-parameters have been defined.

strDirection

The direction/s in which the entire first level parameter block will be passed. Its value should be:

P = pass the parameter block to the 3GL program.

R = the parameter block is returned by the 3GL program.

B  = it is passed in both directions.

This value will override any previous strDirection value supplied for this first level parameter number.

strDataType

The data type of this sub-parameter and must be one of the following:

A = Alphanumeric

P = Packed

S = Signed

B = Binary

iLength

The field length of this parameter.

The aggregate data length (iLength, except for "Packed") of all sub-parameters for any first level parameter block, must not exceed MAX_PARAM_LENGTH (i.e. the sum of the length of each sub-parameter for the specified block) as defined in the LCOE.H header file.

iDecimal

The number of decimal places of this parameter.

strValue

The string equivalent of the value to be passed to the 3GL program when strDirection is "P" or "B". It is ignored if strDirection is "R".

This parameter must be supplied and may consist of a NULL string (i.e. "").

An error will occur if the resulting value of a DBCS conversion is data longer than iLength.

If the parameter is defined as "Binary", the strValue "string" pointer passed in this parameter is used as the base to access exactly iLength bytes without regard for NULL string terminating characters.

  

Return Values

TRUE is returned if the parameter can be set.

FALSE is returned if an error occurs.

Notes

Portability Considerations

Lce3GLDefineParameter is only supported if your host system is an IBM i. If you make a call to any other platform an error will be returned by the host.

  

LANSA Open maintains a local parameter area which is used when passing parameters to and from the host using Lce3GLCall. On the IBM i, LANSA Open will call the 3GL program with pointers to each of the defined (and requested) blocks in the subsequent Lce3GLCall request.

  • This function may be executed at any time after the session has been opened.
  • This function performs no communication with the host.

Related Functions

6.3 Lce3GLCall

6.5 Lce3GLGetValue