Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Vfp50-Appllication Object
Message
From
24/02/1997 12:50:27
 
 
To
24/02/1997 12:04:16
General information
Forum:
Visual FoxPro
Category:
User groups
Miscellaneous
Thread ID:
00021768
Message ID:
00021817
Views:
64
>>>>>>>*** start.prg
>>>>>>>oApp=createobject('app')
>>>>>>>
>>>>>>>Define class app as custom
>>>>>>> .msgtitle="System Error"
>>>>>>>enddefine
>>>>>>>
>>>>>>>*** some snippet
>>>>>>>=messagebox("Cannot Proceed",1+16,oApp.msgtitle)
>>>>>>Thanks Ed..
>>>>>>
>>>>>>OK - Does that mean I define a class as "application class"? and
>>>>>>in that class, have a property called "msgtitle"?
>>>>>>
>>>>>>rob
>>>>>
>>>>>You define a class as Custom (app is just an appropriate title), and this class may have msgtitle property and any other else you may define, e.g. path to data folder.
>>>>
>>>>OK... I get it...
>>>>
>>>>Your answers are great and I am learning...
>>>>
>>>>Custom, user-defined classes are classes with properties, events, and methods, but with no visual representation.
>>>>
>>>>This will be like your starting class or a class where you can put your
>>>>global stuff??
>>>>
>>>>Why will I have a custom class when I can write a prg with functions?
>>>>
>>>>
>>>>Rob
>>>
>>>Surely we can use system procedure prg file, and I still use both App class (to use properties) and sysproc (to use functions). Besides obvious not OO approach, prg file can get you in trouble if you have to reference a form inside a function (it's not clearly defined in VFP). So, I even sometimes have one more custom class ('commonmethods') which I insert into appropriate forms.
>>
>>OK..great...
>>
>>I understand now why in vfp50 you should use Custom(App) and when to use
>>sysproc (functions).
>>This means, I fire (invoke) my App with "App.do()" in my MAIN.prg. Does the app class fire off the rest of the application in the init events in app?
>>
>>Rob
>
>Not at all. You just oApp=CREATEOBJECT() in your main.prg. To fire some properties/methods of the object, you have to use 'oApp' reference in any place you want to fire them.

I see...After I CREATEOBJECT, everything is loaded... OK...now I use my
program talents to make calls(methods,properties), etc...

In my main.prg, I...
oapp= CREATEOBJECT("app")

I get back an error message saying..
"Class definition 'app' is not found"

I made a custom class called "app".
what happen...

Rob
Robert Keith
Independent Developer
San Antonio, Texas
E-mail address:
rebelrob1@yahoo.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform