Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Custom classes instead of global variables
Message
From
17/01/2000 13:29:27
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00319087
Message ID:
00319100
Views:
14
I put the PROCEDURE and the PUBLIC after the class definition and that worked.

Thanks,

Michelle


>Hi Michelle,
>
>It looks like VFP treats everything after DEFINE CLASS as class definition.
>Try to rearange code as follow:
>
>PUBLIC goSettings
>
>goSettings = CREATEOBJECT('settings')
>
>RETURN
>
>
>DEFINE CLASS settings AS CUSTOM
> CurClient = ""
> CurProject = ""
> CurUser = ""
>ENDDEFINE
>
>
>
>>I'm trying to make a class to hold variables that I need to be public. I'm a bit confused, though, on how to do it. Here's my main program:
>>
>>
>>PROCEDURE main
>>
>>PUBLIC goSettings
>>
>>DEFINE CLASS settings AS CUSTOM
>>   CurClient = ""
>>   CurProject = ""
>>   CurUser = ""
>>ENDDEFINE
>>
>>goSettings = CREATEOBJECT('settings')
>>
>>ENDPROC
>>
>>
>>When I try to compile it, it stops on the goSettings = line and tells me it's not in a procedure. It looks like it's in a procedure to me. What is it that it's not liking?
>>
>>Thanks,
>>
>>Michelle
Previous
Reply
Map
View

Click here to load this message in the networking platform