RecordSet.getLength( )

RecordSet.getLength( ) MethodFlash 6

returns the length of a recordset
myRecordSet.getLength( )

Returns

An integer specifying the number of rows in the RecordSet object.

Description

The getLength( ) method returns an integer that contains the number of rows in the RecordSet object. This length is always be one more than the highest index number in the recordset. For example, a recordset that has 10 rows with index numbers from 0 to 9 has a length of 10.

Example

The following code gets the length of the RecordSet object and puts it into a variable:

var myRecordsetLength = myRecordset_rs.getLength( );

The length is typically used to loop through all records in a recordset, such as:

var myRecordsetLength = myRecordset_rs.getLength( );
for (var i; i < myRecordsetLength; i++) {
  trace(myRecordset_rs.getItemAt(i));
}

See Also

Chapter 4, "Loops and Repeated Operations" in Chapter 12



    Part III: Advanced Flash Remoting