[0001]
[0002]
[0003]
[0004]
[0005]
[0006]
[0007]
[0008]
[0009]
[0010]
[0011]
[0012]
[0013]
[0014]
[0015]
[0016]
[0017]
[0018]
[0019]
[0020]
[0021]
[0022]
[0023]
[0024]
[0025]
[0026]
[0027]
[0028]
[0029]
[0030]
[0031]
[0032]
[0033]
[0034]
[0035]
[0036]
[0037]
[0038]
[0039]
[0040]
[0041]
[0042]
[0043]
[0044]
[0045]
[0046]
[0047]
[0048]
[0049]
[0050]
$! CGICALLOUTSINGLEBYTE.COM
$! demonstrate/test-bench single-byte output + callout
$! 22-JAN-2003  MGD  initial
$!
$ lf[0,8] = 10
$ open /read CgiPlusIn CGIPLUSIN
$!
$ call bout "Content-Type: text/plain"
$ call bout ""
$!
$ call bout "ALL I/O WILL BE ONE BYTE AT A TIME"
$ call bout "----------------------------------"
$ call bout "(check this using WATCH)"
$ call bout ""
$!
$ call bout "Map ''WWW_PATH_INFO' using the following callout request ..."
$ call bout ""
$ call bout "MAP-PATH: ''WWW_PATH_INFO'"
$ call bout ""
$!
$ call bout "''f$trnlnm("CGIPLUSESC")'"
$ call bout "MAP-PATH: ''WWW_PATH_INFO'"
$ read CgiPlusIn /end=EndRequestLoop Response
$ call bout "''f$trnlnm("CGIPLUSEOT")'"
$!
$ call bout "Server response was ..."
$ call bout ""
$ call bout " ""''Response'"" "
$ call bout ""
$ call bout "Yielding a file specification of ..."
$ call bout ""
$ call bout "  ''f$extract(4,999,Response)'"
$!
$ exit
$!
$!(output the string supplied is P1 one byte/character at a time)
$ bout: subroutine
$ length = f$length(p1)
$ count = 0
$ byteLoop:
$    if count .eq. length
$    then
$!      (indicate end-of-record)
$       write sys$output ""
$       exit
$    endif
$    write sys$output f$extract(count,1,p1)
$    count = count + 1
$    goto byteLoop
$ endsubroutine