Skip to content

FB_UNQUOTE


Intrinsic define (macro) performed by the compiler.

Syntax

` FB_UNQUOTE( arg )

`

Parameters

arg

argument

Description

Takes a literal string and converts it back to tokens.

More precisely, __FB_UNQUOTE__ returns a sub-quoted text compared to the one passed through the argument (the argument may already be an over-quoted string, and so the return will be a simple string in this case).

Examples

start GeSHi

vb
#macro m( arg )
    Scope
        Var v1 = arg
        #print TypeOf(v1)
        Print v1
        Var v2 = __FB_UNQUOTE__( arg )
        #print TypeOf(v2)
        Print v2
    End Scope
#endmacro

m("""Hello""")
m("1")

Sleep

/' Compiler output:
String
String
String
Integer
'/

/' Output:
"Hello"
Hello
1
 1
'/

end GeSHi

start GeSHi

vb
#define X __FB_QUOTE__( Print "hello" )
#macro Y( arg )
  __FB_UNQUOTE__( arg )
#endmacro

Print X
Y( X )

/' Output:
Print "hello"
hello
'/

end GeSHi

Version

  • Since fbc 1.08.0

Differences from QB

  • New to FreeBASIC

See also

  • __FB_QUOTE__
  • __FB_EVAL__

Back to DocToc

Translated from FreeBASIC official docs. Contact us for removal if infringed.
FreeBASIC is an open-source project, not affiliated with Microsoft