Denso RC5 Specifications Page 545

  • Download
  • Add to my manuals
  • Print
  • Page
    / 692
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 544
Chapter 20 Preprocessor
20-1
20.1 Symbol Constants · Macro Definitions
#define (Preprocessor Statement)
Function
Replaces a designated constant or macro name in the program with a
designated character string.
Format
#define <Symbol constant> <Character string>
or
#define <Macro name (Argument)> <Argument included character string>
Explanation
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.
Related Terms
#undef
Example
#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.
Page view 544
1 2 ... 540 541 542 543 544 545 546 547 548 549 550 ... 691 692

Comments to this Manuals

No comments