OPTION ESCAPE
- Source: https://www.freebasic.net/wiki/wikka.php?wakka=KeyPgOptionescape
- Last revised: 2016-03-13
Specifies that string literals should be processed for C-like escape sequences by default
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.
Examples
start GeSHi
vb
'' 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)end GeSHi
Dialect Differences
- Only available in the -lang fblite and -lang qb dialects.
Differences from QB
- New to FreeBASIC
See also
__FB_OPTION_ESCAPE__- Operator ! (Escaped String Literal)
- Operator $ (Non-Escaped String Literal)
- Literals
Back to DocToc