Skip to main content

Get-Array-Subscripts

Command Description

Get the number of elements (subscript) in an array

Command Prototype

iRet = UBound(arrData)

Parameter Description

ParameterRequiredTypeDefaultDescription
arrDataTrueexpression[]The array to be operated

return

iRet,The variable used to save the output of the command.

Demo

TracePrint("----------------------Get the maximum subscript of the array-------------------- ----") 
//-------------------------------------------------------------------------------
//[Remarks] Get the number of elements (subscript) of the array.
//Input parameter 1:
// arrData--The array to operate on.
//out parameters:
// iRet--The variable to which the output of the function call is saved.
//
//Command prototype: iRet=UBound(arrData)
//-------------------------------------------------------------------------------
iRet=UBound(["a","b","c"])
TracePrint(iRet)