Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Vfp50-Appllication Object
Message
From
24/02/1997 10:51:02
 
 
To
24/02/1997 10:32:49
General information
Forum:
Visual FoxPro
Category:
User groups
Miscellaneous
Thread ID:
00021768
Message ID:
00021794
Views:
41
>>>>>What is the reason for the "Application Object" or
>>>>>"Application Class"?
>>>>>
>>>>>Rob
>>>>
>>>>If you want to scope some things (variables,procedures) for whole application, you can create App object (DEFINE CLASS, CREATEOBJECT()) in start module and use its properties and methods.
>>>
>>>Ed..
>>>
>>>When will you call this App object. Where do you put it. Is it like a
>>>"main.prg"?
>>>
>>>Rob
>>
>>Yes, I used to call it 'start.prg'. You can call app object anytime you need. For example, you have many messageboxes and you want to have common and portatble title for them. So, you use oApp.msgtitle property defined once in start.prg and use it as third parameter in all =messagebox() functions.
>
>Hi Ed...
>
>Not sure what you mean. How about a short sample?
>
>Rob

*** start.prg
oApp=createobject('app')

Define class app as custom
.msgtitle="System Error"
enddefine

*** some snippet
=messagebox("Cannot Proceed",1+16,oApp.msgtitle)
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform