Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Setting up appication objects
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00751147
Message ID:
00751158
Vues:
17
If you define oMyObj at the Highest level of the the command stack, and you declare the memvar as "Private" it should work well. In fact this is a common approach, however another approach which is always available is to add a property to the _screen and store your object revference there. Just remember to do "proper" housekeeping and destroy the reference upon "On Shutdown"

Glenn

>Hi.
>I am in the procees of changing some Global variables into application objects and would welcome any ideas on the best way of doing this.
>
>I was proceeeding alomg the following lines:
>
>1. Have a piece of code somewhere? which does following:
> (I'm not quire sure where to put this code though)
> oMyobj = CreateObject('Custom')
>
> && Create the variables
> oMyObject.Addproperty('MyVar1')
> oMyObject.Addproperty('MyVar2')
> oMyObject.Addproperty('MyVar3[10]')
>
> && initialize the variables
> oMyObject.MyVar1 = MyVal1
> oMyObject.MyVar2 = MyVal2
> oMyObject.MyVar3 = MyVal3
>
>2. When I want to reference the variables in a Prg file or a Form
> MyResult = oMyObject.MyVar1 + oMyObject.MyVar2
>
> Is this sysntax ok ? , ot do I need to prefix the oMyObject with something ?
>
>
>Any general guidelines appreciated
>
>Regards,
>
>Gerard
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform