<< Prev        Next >>

ID : 602

UBound

Function

To return a maximum index number in the element of array.

Syntax

UBound(array variable name[, dimension])

Guaranteed entry

Array variable name
Designate an array variable name.
Dimension
Designate a dimension number of the required maximum index number by integer type data. This is an optional value. This should be 1 if this is omitted.

Return value

Return a maximum index number of the element in the specified dimension by integer type data.

Description

Return a maximum index number of the element in the specified dimension by integer type data.

Related Terms

Array

Attention

An index number of PacScript array variable should be started with "0", so the number of the elements is UBound(aaa)+1.

Example

'!TITLE "Function UBound Sample Program"
' The same process should be done to the entire elements in the array
Sub Sample_Ubound
  
  Dim aaa(10) As Position
  Dim n As Integer
  
  'Add (+) 100 to each element in the array aaa toward Z-direction
  For n = 0 To UBound(aaa)
    aaa(n) = Dev(aaa(n), v(0, 0, 100))
  Next

End Sub

ID : 602

<< Prev        Next >>