Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Aselobj()
Message
 
À
19/12/1999 20:56:50
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00305952
Message ID:
00306000
Vues:
31
>i was tinkering with the aselobf() function for possible use. i observed that the order is based on objects created. just another newbie question, how can i arrange the order based on objects selected. i'm using vfp5.
>
>TIA,

You can copy a reference of the object, and the object properties that determine a specific order, and then sort the copy.

Eg.

ln=AselObj(laSelObj)
Local laSortObj[ln,3]

For J=1 to ln
laSortObj[J,1] = laSelObj[J] && reference to selected object
laSortObj[J,2] = laSelObj[J].Top
laSortObj[J,3] = laSelObj[J].Left
EndFor

* Sort From Top to bottom (vertical) by .Top property
ASort(laSortObj, 2)
*...
* Sort From Left to Right (Horizontal) by .Left property
ASort(laSortObj, 3)

* Access the objects in the sorted array
For J=1 to ln
loObject = laSortObj[J,1]
*...
EndFor

Just an opinion... Not a fact.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform