Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can we find object by name
Message
 
 
To
26/07/2005 12:21:31
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01035941
Message ID:
01035960
Views:
12
>>Hi everybody,
>>
>>If I know the object's name (the object is on the form, like grid), but don't know its hierarchy, is there a way to receive an object reference?
>>
>>Thanks a lot in advance.
>
>Hi Nadya,
>
>Would something like this do the trick?
>
>cName = yourobjectsname
>FOR i = 1 TO ThisForm.Objects.Count
>   IF ThisForm.Objects(i).Name = m.cName
>      * You have the reference - do what you want with it.
>   ENDIF
>ENDFOR
>
>Regards,

Yes, I was thinking about something like that. but it's going to become tricky, if you have pageframes or containers. So, I scratched the idea and decided to use the full reference.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform