Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SETting Environment
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00457247
Message ID:
00458006
Views:
26
>>Why do I get a syntax error for this?
>>
>>**Setup.prg
>>PUBLIC gcExclude
>>gcExculde = SET("EXCLUSIVE")
>>SET EXCLUSIVE OFF
>>
>>
>>**Cleanup.prg
>>SET EXCLUSIVE (gcExclude) <--- This is where I get a syntax error, why?
>>
>>
>>p.s. these are just snippets from each of the respective programs.
>>
>>Thanks
>>
>>Elgin
>
>Elgin,
>
>Are you sure, you want use public variables for these settings? If they are defined in main program, you can use private variables instead. Better yet, make these settings to be properties of your application object. Then, in object destroy you can restore your settings back to original. BTW, I usually use this syntax:
>
>local lOldSetExact
>lOldSetExact=set('exact')
>set exact off
>***** Other code *******
>if lOldSetExact="ON"
>   set exact on && Avoid macro, if possible
>endif
>
Nadya,

Thanks so much for the info. I will use your syntax. It works great. The reason I'm using a public variable is because I have 3 separate PRGs. One is Main.prg which calls Setup.prg then starts the event loop READ EVENTS. After the event loop I have a call to my Cleanup.prg. Not sure if there's any advantage to having 3 separate prgs instead of just one called MAIN.PRG. I read this in Booth's "Visual Foxpro Unleashed". What do you think? See any problems with having the 3, or should I be all in 1 for that program.

Thanks again.
Elgin Rogers
Epic Solutions
www.epicsolutions.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform