Access/VBA Library

Pad Method

Pads the array to the specified length with a value.

Syntax

array_.Pad( Size, Value [, AtBeginning] )
Parameters
Name Type Description
array_   The name of an object of type array_
Size Integer Required. The new size of the array.
Value Variant Required. Value to pad if the array is less than size.
AtBeginning Boolean Optional. Indicator if the padding should be done at the beginning of the array.
Default: False

Remarks

  • If Size is less or equal the current size of the array, no padding takes place.
Example
  Dim x As New Array_
  x.FromArray(Array(1, 2, 3)).Pad(5, "?")
  'Result:
  'Array (
  ' [1] = > 1
  ' [2] = > 2
  ' [3] = > 3
  ' [4] = > ?
  ' [5] = > ?
  ')