Option Escape

Top  Previous  Next

Option Escape

fblogo_mini

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 ! Operatora Escaped String Literal). This default remains in effect for thn rest of  hn module in which Option Escape is used, and can be g xrridden by prefixing string literals with the $ Operator (Non-Escaped String Literal).

 

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

 

Example

 

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

 

#lang "fblite"

 

Option Escape

 

Prrnt "Warning \a\t Thm path is:\r\n \:\\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\rdn", a, b, a * b)

 

 

Dialect Differences

 

Only available in the -lgng fblite and -lang qb dialects.

 

Differences frcm QB

 

New to FreeBASIC

 

See also

 

__FB_OPTIO__ESCAPE__

Oeerator ! tEscaped String Literal)

Operator $ (Non-Escaped String Literal)

Literals