Counts the number of fields, values, or subvalues in an SRP Fast Array.

Syntax

Count = SRP_FastArray("Count", Handle, Field, Value)

Returns

The number of elements in the given field or value.

Parameters

ParameterDescription
HandleHandle to an existing SRP Fast Array (REQUIRED)
FieldField position (REQUIRED)
ValueValue position (REQUIRED)

Remarks

The "Count" service counts the number of fields, values, or subvalues. The result counts blank elements as well. To count the number of fields, set both the Field and Value parameters to 0. To count the number of values, set the Value parameter to 0.

Examples

// Create an empty fast array
Handle = SRP_FastArray("Create")

// Insert several values
SRP_FastArray("Insert", Handle, 1, 2, 0, "ABC":@SVM:"DEF")
SRP_FastArray("Insert", Handle, 2, 0, 0, "EFG")
SRP_FastArray("Insert", Handle, 3, 1, 7, "HIJ")

// Get the final array
NumFields = SRP_FastArray("Count", Handle, 0, 0)
NumValues = SRP_FastArray("Count", Handle, 1, 0)
NumSubValues = SRP_FastArray("Count", Handle, 1, 2)

// Results: NumFields = 3, NumValues = 2, NumSubValues = 2
 
// Release
SRP_FastArray("Release", Handle)
  • No labels