Revision history for KeyPgPpmacro


Revision [20459]

Last edited on 2016-02-10 16:06:58 by DkLwikki [Update link format]
Additions:
**#macro** //identifier//( [ //parameters//, ] //[[KeyPgDots|variadic_parameter...]]// )
##**#macro**## is the multi-line version of ##[[KeyPgPpdefine|#define]]##.
- ##[[KeyPgPpdefine|#define]]##
- ##[[KeyPgPpifdef|#ifdef]]##
- ##[[KeyPgPpundef|#undef]]##
Deletions:
**#macro** //identifier//( [ //parameters//, ] //[[KeyPgDots variadic_parameter...]]// )
##**#macro**## is the multi-line version of ##[[KeyPgPpdefine #define]]##.
- ##[[KeyPgPpdefine #define]]##
- ##[[KeyPgPpifdef #ifdef]]##
- ##[[KeyPgPpundef #undef]]##


Revision [15308]

Edited on 2011-10-01 09:44:01 by DkLwikki [Point to #define instead of duplicating]
Additions:
**#macro** //identifier//( [ //parameters// ] )
//body//
**#macro** //identifier//( [ //parameters//, ] //[[KeyPgDots variadic_parameter...]]// )
//body//
##**#macro**## is the multi-line version of ##[[KeyPgPpdefine #define]]##.
print a;
print " ";
print b;
print "!"
Deletions:
**#macro** //macro_name//( [ //parameters// ] )
//macro body//
**#macro** //macro_name//( [ //parameters//, ] //variadic_parameter//[[KeyPgDots ...]] )
//macro body//
##**#macro**## defines a function like macro where ##//macro body//## may span multiple lines.
Parameters supplied to the function like macro are substituted where they occur in the ##//macro body//##. The entire ##//macro body//## is substituted where ever ##//macro_name//## appears in the source code. The number of parameters supplied to a macro must match the number of parameters in its ##**#macro**## definition.
Using ##[[KeyPgDots ...]]## (an ellipsis) behind the last parameter of a macro allows to create a variadic macro, see [[KeyPgPpdefine #define]].
The ##[[KeyPgPpifdef #ifdef]]## and ##[[KeyPgPpifndef #ifndef]]## preprocessor conditionals can test if ##//macro_name//## exists or does not exist.
The ##[[KeyPgPpundef #undef]]## preprocessor directive will undefine a macro so that it may be redefined with another definition.
Macro substitution can be checked by using the -g -r switches. The compiler doesn't erase the intermediate .asm file where the code actually sent to the compiler can be seen close to its translation into assembler.
print a;
print " ";
print b;
print "!"
- ##[[KeyPgPpif #if]]##
- ##[[KeyPgPpelse #else]]##
- ##[[KeyPgPpelseif #elseif]]##
- ##[[KeyPgPpendif #endif]]##
- ##[[KeyPgPpifndef #ifndef]]##
- ##[[KeyPgDefined defined]]##


Revision [14863]

Edited on 2010-10-12 08:37:36 by DkLwikki [Added variadic macros]
Additions:
**#macro** //macro_name//( [ //parameters// ] )

**#macro** //macro_name//( [ //parameters//, ] //variadic_parameter//[[KeyPgDots ...]] )

Using ##[[KeyPgDots ...]]## (an ellipsis) behind the last parameter of a macro allows to create a variadic macro, see [[KeyPgPpdefine #define]].
Deletions:
**#macro** //macro_name//( [ //param1// [, //param_list//] ] )


Revision [14424]

Edited on 2009-08-29 21:56:29 by CountingPine [Remove CamelCase links in "New to FreeBASIC"]
Additions:
- New to ""FreeBASIC""
Deletions:
- New to FreeBASIC


Revision [11644]

The oldest known version of this page was created on 2007-11-10 09:14:45 by JeffMarshall [Remove CamelCase links in "New to FreeBASIC"]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki



sf.net phatcode