Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Aselobj()
Message
 
To
19/12/1999 20:56:50
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00305952
Message ID:
00306000
Views:
32
>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform