Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Strange behavior of Select
Message
De
27/11/2012 03:49:08
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Strange behavior of Select
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01558144
Message ID:
01558144
Vues:
99
I was just notified of a very strange behavior of the Select command and the Select() function, by Maharastra Kolhapur on Foxite. What he told me, and which I didn't know, was that Select() also performs an implicit Select command "behind the scene" when you supply a work area that is actually used. And even "worse", VFP makes no distinction between Select(myWorkArea) and Select (myWorkArea), note the space, they both are treated as Functions!

Here is a small, slightly modified, excerpt from my message on Foxite. Please read carefully, the impact may be bigger than you immediately think.
myWorkArea = 'myTable' && myTable is already used in another work area
1. ?Select(myWorkArea) && Function
2. ?Select (myWorkArea) && Function or Command? Looks like a command but is treated as a function. 
3. Select (myWorkArea) && Function or Command? Looks like a command but is treated as a function. 
Note that the only difference between 1 and 2 is the space. I would expect an error on 2.
And that the only difference between 2 and 3 is the question mark.
Since we have the "option 3", maybe it's a good thing that Select() also performs an implicit Select command?

I am really grateful for your discovery, which I will keep in mind. Luckily we have the debugger.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform