Skip to content

FB_QUOTE


Intrinsic define (macro) performed by the compiler.

Syntax

` FB_QUOTE( arg )

`

Parameters

arg

argument

Description

Converts the argument to a string, similar to stringize operator (#) but can be used anywhere (will expand the argument before conversion).

More precisely, __FB_QUOTE__ returns an over-quoted text (prefixed with the Operator $ (Non-Escaped String Literal)) compared to the one passed through the argument (the argument may already be a string, and so the return will be an over-quoted string in this case).

Examples

start GeSHi

vb
#macro m( arg )
    Scope
        Dim s1 As String = #arg
        Print s1
        Dim s2 As String = __FB_QUOTE__( arg )
        Print s2
    End Scope
#endmacro

m(Hello)
Print
m("Hello")

Sleep

/' Output:
Hello
Hello

"Hello"
"Hello"
'/

end GeSHi

start GeSHi

vb
#macro m( arg1, arg2 )
    Scope
        'Dim s0 As String = #arg1##arg2  ' does not work because arg1##arg2 is not developped before applying #
        Dim s1 As String = #arg1###arg2  ' workaround because #arg => $"arg" and not only "arg"
                                         '    (otherwise the result would be "arg1""arg2" => "arg1"arg2")
        Print s1
        Dim s2 As String = __FB_QUOTE__( arg1##arg2 )
        Print s2
    End Scope
#endmacro

m(Free, BASIC)

Sleep

/' Output:
FreeBASIC
FreeBASIC
'/

end GeSHi

See also __FB_UNQUOTE__ example.

Version

  • Since fbc 1.08.0

Differences from QB

  • New to FreeBASIC

See also

  • __FB_UNQUOTE__
  • __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