Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to get an object number ?
Message
De
19/04/2000 10:11:31
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00361187
Message ID:
00361250
Vues:
17
>>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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform