[UP]


Manual Reference Pages  - expand (3)

NAME

expand(3f) - [M_strings:NONALPHA] expand C-like escape sequences (LICENSE:PD)

CONTENTS

Synopsis
Description
Examples
Author
License

SYNOPSIS

function expand(line,escape) result(lineout)

character(len=*) :: line character(len=1),intent(in),optional :: escape character(len=:),allocatable :: lineout

DESCRIPTION

EXPAND() expands sequences used to represent commonly used escape sequences or control characters. By default ...

Escape sequences

\ backslash
a alert (BEL) -- g is an alias for a
b backspace
c suppress further output
e escape
f form feed
n new line
r carriage return
t horizontal tab
v vertical tab
oNNN byte with octal value NNN (3 digits)
dNNN byte with decimal value NNN (3 digits)
xHH byte with hexadecimal value HH (2 digits) -- h is an alias for x

The default escape character is the backslash, but this may be changed using the optional parameter ESCAPE.

EXAMPLES

Sample Program:

    program demo_expand
    !  test filter to expand escape sequences in input lines
    use M_strings, only : expand
    character(len=1024) :: line
    integer             :: ios
       READFILE: block
          do
             read(*,’(A)’,iostat=ios)line
             if(ios /= 0) exit READFILE
             write(*,’(a)’)trim(expand(line))
          enddo
       endblock READFILE
    end program demo_expand

Sample input:

     \e[2J
     \tABC\tabc
     \tA\a
     \nONE\nTWO\nTHREE

AUTHOR

John S. Urban

LICENSE

Public Domain


expand (3) July 05, 2020
Generated by manServer 1.08 from 2efbb536-da64-4ff8-ba59-f1b17fb153e4 using man macros.