Option Escape
Specifies that string literals should be processed for C-like escape sequences by default
Option Escape
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.
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.
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)
#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)
Dialect Differences
- Only available in the -lang fblite and -lang qb dialects.
Differences from QB
- New to FreeBASIC
See also