Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
More Trouble with sql macros
Message
From
02/12/2005 17:58:19
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
02/12/2005 17:55:05
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP1
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01074439
Message ID:
01074443
Views:
18
>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)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform