Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error : Illegal redefinition of variable
Message
From
25/07/2013 10:42:27
Mk Sharma
Shrishti Solutions
Mumbai, India
 
 
To
25/07/2013 08:18:43
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01579124
Message ID:
01579207
Views:
47
Please send me a example class of this kind to understand the working.

My email ID : mk_common@yahoo.com

Warm regards,
mk.



>>Thank you,
>>
>>The problem was Private Variable.
>>
>>We can declare a Public variable as Local OR as Public as much time we want.
>>But we can not declare a Private as Local OR Public
>
>I didn't see you already solved it. But just for the thought of it, (or depending how large your project is you can refactor), you may think to do it differently in the future.
>Instead of creating numerous public variables you can create one class with those variables as properties in this class. Then you can instantiate this class as PRIVATE in the main.prg (or make it public if you feel more comfortable).
>In the code then you can refer to the object and get it's properties, which now serve as kind of "public variables".
>For instance in the main prg:
>
>PUBLIC goPublicVariables
>goPublicVariables = NEWOBJECT("PublicVariables", "AppClasses.vcx")
>
>And in the code where you use those variables:
>
>LOCAL loPublicVariables AS PublicVariables OF AppClasses.vcx
>loPublicVariables = goPublicVariables
>Messagebox(loPublicVariables.OldProduct)
>
>This way you can also add comments to those properties and see the available variables in intellisense, making it easier when you have to refer to them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform