RecordSet.getLength( ) Method | Flash 6 |
returns the length of a recordset |
An integer specifying the number of rows in the RecordSet object.
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.
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)); }
Chapter 4, "Loops and Repeated Operations" in Chapter 12