Help Center
Help CenterFreeBASIC

Operator $ (Non-Escaped String Literal)operator

Explicitly indicates that a string literal should not be processed for escape sequences.

Operatorsoperatordocumented

Syntax

$"text"

Description


This operator explicitly indicates that the string literal following it (wrapped in double quotes) should not be processed for escape sequences. This a preprocessor operator and can only be used with string literals at compile time.

The default behavior for string literals is that they not be processed for escape sequences. However, Option Escape in the -lang fblite dialect can be used to override this default behaviour causing all strings to be processed for escape sequences.

Use the ! Operator (Escaped String Literal) to explicitly indicate that a string should be processed for escape sequences.

Remarks

Differences from QB


  • New to FreeBASIC

See also


Example


'' Compile with -lang fblite or qb



#lang "fblite"



Print "Default"

Print "Backslash  : \\"

Print !"Backslash !: \\"

Print $"Backslash $: \\"

Print



Option Escape



Print "Option Escape"

Print "Backslash  : \\"

Print !"Backslash !: \\"

Print $"Backslash $: \\"

Print



'' OUTPUT:



'' Default

'' Backslash  : \\

'' Backslash !: \

'' Backslash $: \\



'' Option Escape

'' Backslash  : \

'' Backslash !: \

'' Backslash $: \\


Reference

  • Documented in KeyPgOpPpNoescape.html