Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CREATEOBJECT vs DO FORM.. NAME..
Message
De
17/04/2007 04:43:37
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
14/04/2007 19:59:45
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
01215967
Message ID:
01216620
Vues:
14
This message has been marked as the solution to the initial question of the thread.
>Hi Everybody,
>
>In my forms manager class, I use DO FORM myform NAME somename to manage instances of each of the form my apps uses.
>
>What I am attempting to do now is convert my forms (like frmCustomerDataEntry for example) into a class.
>
>So, instead of:
>
>
> DO FORM frmCustomerDataEntry NAME ofrmCustomerDataEntry
>
>
>I want to:
>
>
>ofrmCustomerDataEntry = CREATEOBJECT( "frmCustomerDataEntry" )
>ofrmCustomerDataEntry.Show()
>
>
>Problem is, it doesn't work quite well. It appears like a ghost then disappears right away if it's Show'n as Modeless. I have to Show it as Modal for it work ( ofrmCustomerDataEntry.Show(1) ). Modal is kinda not the way I would like it.
>
>Obviously, the form object variable loses scope. Declaring the var public wouldn't be 'elegant'.
>
>Any help is appreciated. Or should I just leave it as DO FORM... NAME...?
>
>Thanks! Cheers!
>
>Dennis

Dennis,
How it works differ between the environments (runtime and IDE). In IDE you normally do not have read events while testing code. If you put a read events it'd stay there (as if it is working like "do form myForm name oFrm linked" from a code - not command window which creates the variables as public). In test environments it's fair to declare it as public.
If there is not a special reason for you doing so just leave them as "do form ...". Converting to classes has no serious advantages that I'm aware of.
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
Répondre
Fil
Voir

Click here to load this message in the networking platform