******************************************************************************************************
Collection (ways of referencing)
******************************************************************************************************
There are four ways to refer to an object in a collection:
collectionname!objectname ' Use the exclamation point reference to refer to an object in a collection explicitly by its name. This has the advantage of allowing you to refer to the object using a string expression that evaluates to the object's name.
collectionname("objectname") ' Use the index by name reference to refer to an object in a collection explicitly by its name. Similar to the former method, in that, you can create a string variable and use that for the object reference.
collectionname(index) ' Use the index by number reference to refer to an object in a collection by the index number assigned to it. [When you know the position number of an object in its collection, you can refer to the object using just the number. Note: Using a For Each. . . Next you can learn the position and/or name of an object in its collection! Remember the collection is zero-based] Looping through the collection is especially useful if turning a property (such as "Lock") on or off for all of the objects.
collectionname(objectvariable) ' Use the index by variable reference to refer to an object in a collection by using a string variable to refer to the object.
******************************************************************************************************
FoxPro (creating a FoxPro table)
|