Information générale
Catégorie:
Codage, syntaxe et commandes
>Does it matter where I use this code in My App or where I call it from.
>
>i.e. Does it have to be set up in the top most prg program ?
An application object is generally used to package a set of properties and methods that will be used on an application wide basis; therefore, you would create it before any other functions attempted to access it, usually before your main READ EVENTS loop.
So that your application object does not go out of scope (by accident or due to an error), you would normally assign it to a PUBLIC variable or attach it to the _SCREEN object.
The beauty of the application object is that even if you created it initially in the "wrong" place, you can easily move the CREATEOBJECT/NEWOBJECT statement vs having to cut, copy and paste a whole bunch of "non-object" variable declarations and assignments.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement