Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Set command and arrays
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00124046
Message ID:
00124537
Views:
20
>Jim,
>Thanks for your words of caution.
>
>I had to use the set comp on statement in order to open certain files with the fopen() function and this was blowing away some arrays that I had set up prior to issuing the command.
>
>If I immediately issue the set comp off, after the fopen() will these nasty dangers disappear or will I continue to see my arrays blown away if I redemension them.
>
Sandy,

The best way to handle any code dependent st commands is to practice defensive programming. That is save teh current setting, change to what you need and then retore the setting. For set compatible you would;
LOCAL lcComp
lcComp = SET("COMPATIBLE")
SET COMPATIBLE ON
Fopen(...)
SET COMPATIBLE &lcComp
This way you never have to worry about some routiner changing the environment on you, because they all restore things before they exit.
Previous
Reply
Map
View

Click here to load this message in the networking platform