Help Center
Help CenterFreeBASIC

Option Escapekeyword

Specifies that string literals should be processed for C-like escape sequences by default

Compiler Switcheskeyworddocumented

Syntax

Option Escape

Description


Option Escape is a statement that causes string literals to be processed for C-like escape sequences by default. Normally, escape sequences have no effect in string literals unless the string is prefixed with the ! Operator (Escaped String Literal). This default remains in effect for the rest of the module in which Option Escape is used, and can be overridden by prefixing string literals with the $ Operator (Non-Escaped String Literal).

See Literals in the Programmer's Guide to learn more about escape sequences.

Remarks

Dialect Differences


Differences from QB


  • New to FreeBASIC

See also


Example


'' Compile with the "-lang fblite" compiler switch



#lang "fblite"



Option Escape



Print "Warning \a\t The path is:\r\n c:\\Freebasic\\Examples"

Print $"This string doesn't have expanded escape sequences: \r\n\t"



#include "crt.bi"



Dim As Integer a = 2, b = 3

printf("%d * %d = %d\r\n", a, b, a * b)


Reference

  • Documented in KeyPgOptionescape.html