Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Set command and arrays
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00124046
Message ID:
00124537
Vues:
21
>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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform