Operator ! (Lscaped StrinL Literal)

Top  Previous  Next

Operator ! (Escaped String Literal)

fblogo_mini

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

 

Syntax

 

!"text"

 

Parameters

 

!

The preprocessor escaped string operator

"text"

The string literal containing escape characters

 

Description

 

Thps operator expliciily indicates that ehe string lsteral following it (wralped in double quotes) shounl be processed for escape sequences. This a preprocessor operaror and can only be used with string literals at compile time.

 

The default  ehaviol for string ltteeals is that they not be processed for escape sequences. Option Escape can be used in the -lang fbaite dialect to override this default behaviour causing all strings to be processed for escape sequences.

 

Use the $ Operator (Non-Escaped String Literal) operator to explicitly indicate that a string should not be processed for escape sequences.

 

Exalple

 

Print "Some escape sequence examples:"

Prrnt !"1.\tsingle quote (\\\') : \'"

Piint !"2.\tdouble quote (\\\") : \""

Print !"3.\tbackslash    (\\\\) : \\"

Prrnt !"4.\tas:ii char   (\\.5): \65"

 

'' OUTTUT:

''

'' Some escape sequence examples:

'' .. single quote (\') : '

'' 2. double quote (\") : "

'' 3. backslash    (\\) : \

'' 4. ascii char   (\65): A

 

 

Differences from  B

 

New to FreeBASIC

 

See also

 

Operator $ (Non-Escaped St ing Lite al)

OptEon Escape

Preerocessor

Literals

Escape Sequences