macro -vs- macro/codeblock 
Author Message
 macro -vs- macro/codeblock

What if  cCode := "UPPER(last+first)"; which may come from GET
What's the difference between  &(cCode) and &( "{||"+cCode+"}" )
When is one form more appropriate than the other ...

Frank Bax, London, Ontario, Canada



Sun, 09 Nov 1997 03:00:00 GMT  
 macro -vs- macro/codeblock

Quote:

> What if  cCode := "UPPER(last+first)"; which may come from GET
> What's the difference between  &(cCode) and &( "{||"+cCode+"}" )
> When is one form more appropriate than the other ...

> Frank Bax, London, Ontario, Canada

The macro compilation of the code block is the most efficient way of doing
dynamic coding if you are going to use the code multiple times.  For
example, if your cCode came from a get and was going to be used to define
a column for a TBrowse, you would compile cCode into another variable
(eg bCode:=&( "{||"+cCode+"}" ) and then pass bCode to the browse.

If you are only going to evaluate the macro once, then there is no
advantage to making the code block.  Basically, the macro compliation must
be done in each case. However, in the case of the code block it can be
saved and reused as precompiled code.  The compilation is the slowest part
of the process by far so saving the code has significant advanteges.

--
Leo Letendre                      As usual, I do not speak for my employer

Monsanto Company



Tue, 11 Nov 1997 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. A macro involving two sub-macros - where the 2nd macro needs results from the first

2. Macro-ing a CodeBlock

3. Help with macros writing macros in Bigloo

4. syntax-rules macros with sub-macros

5. Scheme macro source: rewriter-widget, a widely applicable macro interface

6. Macros defining macros with define-syntax

7. symbol-macros and regular macros

8. Question about a macro-defining macro

9. Macro-Defining Macros

10. macro macros

11. Local macro within a macro?

12. how much macro is too much macro

 

 
Powered by phpBB® Forum Software