Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
&& within string gives error
Message
 
To
09/01/2002 20:43:38
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00601634
Message ID:
00602845
Views:
43
>Are you using it within strings? If yes, would you like to describe why?

Macros can save a lot of "case" and "if" statements.

It may sound over the top and i try to write clean code, but sometimes I have embedded a macro in a macro. The 'outside macro' would be stashed in a table as an object reference "string". With-in the "outside" reference string an embedded "&FunctionPointer" that referenced a "local" argument, which may be the current sate of a local variable or another function pointer (or a reference to another function pointer).

Lets see if i can reconstruct a simple exampl example:
create a prg call myproc and add two procedures
* myproc.prg
procedure proc1
return [PROC1]

procedure proc2
return [PROC2]
Then, at the command window:
set proc to myproc
cmac="? &call"
call="proc2()"
* and finally
&cmac && returns [PROC2]
It seemed necessary for the situation at the time. It controlled client routing off menu selects based on a client privlidge profile. It really saved a ton of case / if statements.

Some of us might argue that macros are possibly the hottest feature in VFP. When you have to go "out-of-the-box", they come in handy. Besides, EVAL() can't do everything.
Imagination is more important than knowledge
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform