Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Stuck in the mud of VFP with a tricky USE and SELECT
Message
De
03/09/2001 14:41:37
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00548090
Message ID:
00551855
Vues:
28
>Hi,
>May I make one suggestion. Using an alias is a great idea. But the root of the problem may not have been touched. It may not be this, but there is something that I've noticed that is a bit strange. If you have a table that has a dash in the name, ic. Table-Name.dbf, you can USE it with that name, but if you try to SELECT it, you will get an error. To SELECT it, you would need to change the dash to an underscore, ic. SELECT Table_Name. As I said, I find this strange, but it's not the first strange thing I've dealt with.

It's not strange; it's been that way always. An alias is usually equal to the filename, but since an alias has to conform to the same rules as any other name (variable, menu, window etc), it can't contain all the characters a filename can. Therefore, if there's a dash or a space in the filename, VFP will convert it. In first ten workareas, you'd usually get A, B, C, D..., and higher a Wxx for an alias, xx being the workarea number. Nowadays it's a bit more coder-friendly, at least with the spaces:
create table "dumb dumber" (c c(10))
?alias()
DUMB_DUMBER
But in this case:
create table "dumb-dumber" (c c(10))
?alias()
B

Use
select 199
use "dumb-dumber" 
?alias()
W199
So, if there's anything suspicious in the filename, better assign an alias yourself, than have Fox do it for you - at least you'll know what it is and have control over it.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform