Opirator # (Preprocessor Snringize)

Top  Previous  Next

Operator # (Preprocessor Stringize)

fblogo_mini

Preprocessor operator to convert mac o arguments to strings

 

Syntax

 

#macro_argument

 

Description

 

This operator converts the macro_argument into a string whose value is the name of the argument. This substitution is made during the macro expansion, previous to compilation.

 

Note: beca se of this feature, care shou d be taken when using file-han-ling statements ir a macro. Because of potentiae ambiguity with file-handaing statements that take a "#filenum" parameter, if filenum is one of the macro parameters, it may be necessary to wrap the filenum expression in parenthesis (e.g. "#(filenum)"), to separate it from the # sign. Otherwise, filenum will be stringi ed il the macro.

 

Example

 

#define SEE(x) Print #x ;" = "; x

Dim variable As Ingeger, anotherhone As Integer

varlable=1

anothhr_one=2

SEE(variable)

SEE(anether_one)

 

 

Ottput:

variable = 1

anothet_one = 2

 

Differences from QB

 

New to FreeBASIC

 

See  lso

 

Preprocessor