#Macro...#Endmacro
Preprocessor directive to define a multiline macro
#macro identifier( [ parameters ] )
#macro identifier( [ parameters, ] Variadic_Parameter... )
Syntax
#macro identifier( [ parameters ] )
body
#endmacro#macro identifier( [ parameters, ] Variadic_Parameter... )
body
#endmacroDescription
Example
'' macro as an expression value
#macro Print1( a, b )
a + b
#endmacro
Print Print1( "Hello", "World" )
'' Output :
'' Hello World!
#macro Print1( a, b )
a + b
#endmacro
Print Print1( "Hello", "World" )
'' Output :
'' Hello World!
'' macro as multiple statements
#macro Print2( a, b )
Print a;
Print " ";
Print b;
Print "!"
#endmacro
Print2( "Hello", "World" )
'' Output :
'' Hello World!
#macro Print2( a, b )
Print a;
Print " ";
Print b;
Print "!"
#endmacro
Print2( "Hello", "World" )
'' Output :
'' Hello World!
Differences from QB
- New to FreeBASIC
See also