Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Use of macro substitution vs. string valued variables
Message
From
23/07/1999 18:44:12
 
 
To
23/07/1999 03:47:29
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00244254
Message ID:
00245596
Views:
15
>There is more fun, after I upgrade to VFP 6.0 I found I need to do something with the command set collate, here is what I found:
>
>coldcollate = set("collate")
>set collate to &coldcollate && NOT WORKING
>set collate to coldcollate && WORKING

>
>It seems that there are no consistency in the VFP SET command at all.

Actually Chen, the above example is consistent with my guess about SET commands. Namely, some SET commands really do not have arguments and some do.

SET EXCLUSIVE ON
SET EXCLUSIVE OFF

Are examples of two commands which do not take arguments.

SET COLLATE TO is a command which accepts a string argument. But if you use a macro, the interpreter expands it just before interpreting (compiling?) it. So

SET COLLATE TO &coldcollate

results in

SET COLLATE TO collate

and since collate is not a name of a variable which contains a string, an error results.

SET COLLATE TO coldcollate works because coldcollate is the name of a variable which contains a string argument that SET COLLATE TO accepts. I bet all of the following will work!

collate = set("collate")
SET COLLATE TO &collate
SET COLLATE to collate
"The Iron Fish: The water is cold...but the fish don't mind"
...Jay Jenks, boyhood chum
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform