next up previous contents
Next: Properties Up: FFish Script Objects Reference Previous: onError   Contents

Enumerator Object

Description

Enumerate items in a collection object.

available: SWFKit Express, SWFKit, SWFKit Pro


Syntax

new Enumerator(collection)


Parameters

collection
A collection object created or returned by ActiveXObject object.


Remarks

You can access collections the members of which are not directly accessible. You can also access some collections by using indexes, as if you are working with an array. If you use Enumerator, you can only move the current item pointer to the first or next element of a collection.


Examples

//The example shows the two different
//ways of accessing collections.
var conn = new ActiveXObject("ADODB.Connection");
conn.Open("zqz");
var rs = conn.Execute("SELECT * FROM Topics");
var e = new Enumerator(rs.Fields);
var i = 0;
for (; !e.atEnd(); e.moveNext())
{
    var fld = e.item();
    trace(fld.Name);
}

conn.Close();
var conn = new ActiveXObject("ADODB.Connection");
conn.Open("zqz");
var rs = conn.Execute("SELECT * FROM Topics");
var i;
for (i = 0; i < rs.Fields.Count; i++)
{
    var fld = rs.Fields[i];
    trace(fld.Name);
}
conn.Close();




Subsections

Copyright ©2000-2007 Shanghai TopCMM Software Technologies. All Rights Reserved.