Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
More Trouble with sql macros
Message
De
02/12/2005 17:58:19
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
02/12/2005 17:55:05
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP1
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01074439
Message ID:
01074443
Vues:
19
>Hi. Having trouble (still) with macro substitution in formulas.
>
>The latest:
>
>
>DO CASE
>CASE 1
> rfield = field1
>CASE 2
> rfield = field2
>ENDCASE
>
>
>...now, use rfield in a command:
>
>
>Brow for rfield = 'myname'
>
>
>The browse doesn't error, it just browses blank.
>
>Thanks, Randy

That it should be blank is quite logical. For every record, VFP evaluates whether the contents of variable rfield is equal to "myname". In other word, VFP checks, for instance, whether "field1" = "myname". And this condition is not fulfilled for any record.

You should change this to:
browse for &rfield = "myname"
This will substitute rfield with the field name, before executing the browse command.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform