>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)