& operator

from the programming handbook

<quote>
The preprocessor is a component of the Progress Compiler. Before the Compiler analyzes your
source code and creates r-code, the preprocessor examines your source code and performs text
substitutions. The preprocessor also conditionally includes blocks of source code to compile.
The preprocessor operates on a compilation unit, which is a group of files compiled together to
produce one completed program. You can think of the preprocessor as a tool that prepares a final
version of your source code just before it is compiled.
You control the preprocessor by placing preprocessor directives throughout your source code.
A preprocessor directive is a statement that begins with an ampersand (&) and is meaningful
only to the preprocessor. These directives are described in this chapter.
</quote>

theres lots of examples in the doc. hth
 
How about {&temptablename}.fieldname?

It is in a regular expression like:
"IF {&temptablename}.fieldname EQ YES THEN DO: " ...

Thanks a lot.
 
How about {&temptablename}.fieldname?

RTFM

temptablename is a preprocessor name or a constant and if you know c/c++ it's like a constant which is defined by #define preprocessor statement.
 
> How about {&temptablename}.fieldname?
>
> It is in a regular expression like:
> "IF {&temptablename}.fieldname EQ YES THEN DO: " ...

Typically, you would use these as substitutions in an include file where you want to use the same, or similar, processing for different temp-tables or database tables.

So, you might have an include file {process.i} that might have a line such as:
IF {&temptablename}.{&fieldname} EQ YES THEN run process.p ("{&temptablename}", rowid ({&temptablename}).

So, you would call the include file in the following way, perhaps:
{process.i &temptablename="t_table1" &fieldname="processable"}
which would check to see if temp-table t_table1 has the processable flag set, if so it would run the external program and pass the rowid to the program.

You might use &if to check whether the temp-table or variable variables have been set and are valid.

&if "{&temptablename}" <> "" and "{&fieldname}" <> "" &then
IF {&temptablename}.{&fieldname} EQ YES THEN run process.p ("{&temptablename}", rowid ({&temptablename}).
&endif

This would only fire up if &temptablename and &fieldname were not blank.

You would probably use this if you had an include file that took various arguments and did various things depending on the parameters passed to it. In certain circumstances, the parameters passed to the include file might be blank and hence might otherwise cause a syntax error. The include file would be found in a number of different programs.


 
Back
Top