Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to get an object number ?
Message
 
 
To
19/04/2000 10:11:31
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00361187
Message ID:
00361384
Views:
18
In that case, I would reccomend you pass in the title and check the .Caption property instead of the name. If your captions are the same, well ... How does an end user differentiate between the two forms in that case? If they have to go to each form and examine the data displayed, that would be a bad design (IMHO).

>>>the _screen.objects(nindex)... allows to uniquely identify an object in the _scree but how can i know this 'nindex' for a form ?
>>>Is there a command which returns this number ? i'd like to get it in the init event of the form.
>>>
>>The only way I know of is to create your own function that looks in the _Screen.Forms[] collection and finds the form based on some criteria you pass (e.g. form title or name). But at this point you have the form and can get an object reference to it as Erik suggested in another post.
>>
>>The following code will return an object reference to the desired form or a .NULL. variable.
>>lparameters tcformname
>>local luretval
>>luretval = .NULL.
>>for lxx = 1 to _Screen.FormCount
>>   With _Screen.Forms[lxx]
>>      if upper(.BaseClass) = "FORM" ;
>>         and upper(.Name) = upper(tcformname) then
>>         luretval = _Screen.Forms[lxx]
>>      endif
>>   Endwith
>>endfor
>>return luretval
>
>
Larry,
>Unfortunately this wouldn't work with forms that are instantiated more than once as :
>do form ...
>
>where all instances of the form would have the same name.
>Cetin
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform