#define (Preprocessor Statement)


Replaces a designated constant or macro name in the program with a designated character string.


#define <Symbol constant> <Character string>
or
#define <Macro name (Argument)> <Argument included character string>


This statement replaces <Symbol constant> or <Macro name> in the program with a designated character string. In the case of a macro name, it is replaced with the arguments already included.
<Symbol constant> or character strings of <Macro name> in " " (double quotations) are not replaced.
You must describe the #define statement on one line.
You must place 1 or more space characters between <Symbol constant> and <Character string>.
Do not place a space between a macro name and the parentheses of an argument.
You can redefine <Symbol constant> and <Macro name>, however, you need to make them invalid with #undef at least once. The most recently defined ones become valid.
<Symbol constant> and <Macro name> must be within 64 characters.
You can use a maximum of 2048 macro names in one program. There is no limitation to the number of macro function arguments you may use.



#DEFINE NAME "Denso Corporation"
'Assigns "Denso Corporation" to the symbol constant NAME.
#DEFINE mAREA(radius) PI * POW(radius, 2)
'Declares mAREA(radius) as a macro function.
S1 = NAME
'Assigns "Denso Corporation" to S1.
D1 = mAREA(10)
'Assigns the calculation value of PI*POW(10,2) to D1.


Top