SetElemCount Method (VARIANT)


8.7, PLBCMP GUI Only

 

The SetElemCount method changes the number elements in a single dimensioned VARIANT object array. The method uses the following format:

 

[label]

{object}.SetElemCount

[GIVING {return}] USING [*Size=]{size}

 

Where:

label

Optional. A Program Execution Label.

object

Required. A VARIANT object that is accessed.

return

Optional. A Numeric Variable that indicates the success or failure of the method.

size

Required. A Numeric Variable that specifies the new variant element count.

Flags Affected: EOS, OVER, ZERO

Note the following:

  1. If the value returned is zero, the ZERO Condition Flag is set.

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

  3. If the {object} is a $VT_ARRAY type variant and the returned value is zero, the resizing action was successful. A non-zero value indicates that the resizing was unsuccessful.

  4. It is an error and no resizing is done if the {object} is a $VT_ARRAY variant and the {size} specified is zero. The returned value is non-zero in this case.

  5. If the {object} is not a $VT_ARRAY variant, the returned value is a zero and no action is performed.

  6. For improved performance in the Application Server environment, do not specify the optional return value unless needed.

 

 

See Also: Method Syntax, VARIANT Methods

 



PL/B Language Reference PutElement Method (VARIANT)