Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Variable declaration scope
Message
From
21/12/2005 18:17:16
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01079865
Message ID:
01080060
Views:
14
>We use a menu that calls VFP compiled EXE's and many of the EXE's have PUBLIC var declarations with RELEASE ALL at the end. We want to release variables when the exe is done but keep some menu-level vars in memory. The issue now is that one or two of our many, many EXE's seem to get an error 1960 "Illegal Redefinition of variable..." which I believe is related to this problem. Any suggestions?

You can declare the variables as PRIVATE in the main program, or not declare them at all, just assign them a value. In either case, the variables will be visible in lower-level programs (i.e., all of them, since I am assuming you do this on the top level), but not in higher-level programs (meaning, they will be erased automatically as soon as you get back to the Command Window.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform