GetElement Method (VARIANT)


8.7, PLBCMP GUI Only

 

The GetElement method retrieves the specified VARIANT from a VARIANT array. The method uses the following format:

 

[label]

{object}.GetElement

[GIVING {return}] USING [*Index=]{index}[:

 

 

[[*Index1=]{index1}]:

 

 

[[*Index2=]{index2}]:

 

 

[[*Index3=]{index3}]:

 

 

[[*Index4=]{index4}]]

 

Where:

label

Optional. A Program Execution Label.

object

Required. A VARIANT object that has been created as a $VT_ARRAY.

return

Optional. A VARIANT that receives the specified array element.

index

Required. A Numeric Variable that specifies the zero-based indexed value for the variant element in the first dimension of the VARIANT array.

index1 - index5

Optional. Decimal numbers or Numeric Variables that specify the zero-based indexed value for the variant elements in each respective dimension of the array.

Flags Affected: EOS, OVER, ZERO

Note the following:

  1. If there is an error, the returned VARIANT will have a VARTYPE of $VT_EMPTY.

  2. The ZERO, OVER and EOS Condition Flags are always cleared.

  3. The CREATE VARIANT operation can only create a one dimensional VARIANT array. This method supports multiple dimensions for a VARIANT array that has been created by a control or another third party application.

 

 

See Also: Method Syntax, VARIANT Methods

 



PL/B Language Reference GetDim Method (VARIANT) GetElemCount Method (VARIANT)