Specifies how the backslash is treated in character strings, Hollerith constants, H edit descriptors, and character string edit descriptors.
It can be treated as an escape character or as a backslash character. This language extension might be needed when you are porting programs from other platforms.
.-escape---. >>- -q--+-noescape-+-------------------------------------------><
@PROCESS:
@PROCESS ESCAPE | NOESCAPE
-qescape
When -qescape is specified, the backslash is interpreted as an escape character in these contexts. If you specify -qnoescape, the backslash is treated as the backslash character.
If you are writing or porting code that depends on backslash characters being passed through unchanged, specify -qnoescape so that they do not get any special interpretation. You could also write \\ to mean a single backslash character under the default setting.
$ # Demonstrate how backslashes can affect the output
$ cat escape.f
PRINT *,'a\bcde\fg'
END
$ xlf95 escape.f
** _main === End of Compilation 1 ===
1501-510 Compilation successful for file escape.f.
$ a.out
cde
g
$ xlf95 -qnoescape escape.f
** _main === End of Compilation 1 ===
1501-510 Compilation successful for file escape.f.
$ a.out
a\bcde\fg
In the first compilation, with the default setting of -qescape, \b is printed as a backspace, and \f is printed as a formfeed character.
With the -qnoescape option specified, the backslashes are printed like any other character.
The list of escape sequences that XL Fortran recognizes is shown in Escape sequences for character strings .