[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]
[0051]
[0052]
[0053]
[0054]
[0055]
$! Simple demonstration that even DCL procedure, vanilla-CGI scripts
$! can use the CGIplus callout mechanism.
$! 19-APR-2008  MGD  add WATCH: callout
$! 03-JUN-2000  MGD  less sloppy CGI, add header!
$! 06-SEP-1999  MGD  initial
$!
$ say = "write sys$output"
$ open /read CgiPlusIn CGIPLUSIN
$!
$ say "Content-Type: text/plain"
$ say ""
$!
$ say "CGI variable symbols:"
$ say ""
$ show symbol www_*
$!
$ say ""
$ say "CGI(plus) callout example:"
$ say ""
$!
$ if f$type(WWW_WATCH_SCRIPT) .nes. ""
$ then
$    say f$trnlnm("CGIPLUSESC")
$    say "WATCH: WATCHing ... " + f$environment("PROCEDURE")
$    read CgiPlusIn /end=EndRequestLoop Response
$    acute_e[0,8] = 233
$    say "!WATCH: 8-bit ... R" + acute_e + "ponse"
$    say f$trnlnm("CGIPLUSEOT")
$ endif
$!
$ PathPtr = WWW_PATH_INFO
$ say "Map '" + PathPtr + "' using the following callout request ..."
$ say ""
$ say "  ""MAP-FILE: " + PathPtr + """"
$ say ""
$!
$!(this block is the actual callout)
$ say f$trnlnm("CGIPLUSESC")
$ say "MAP-PATH: " + PathPtr
$ read CgiPlusIn /end=EndRequestLoop Response
$ say f$trnlnm("CGIPLUSEOT")
$!
$ say "Server response was ..."
$ say ""
$ say "  """ + Response + """"
$ say ""
$ if f$extract(0,1,Response) .eqs. "2"
$ then
$    say "Yielding a file specification of ..."
$    say ""
$    say "  " + f$extract(4,999,Response)
$ else
$    say "The response indicated an error."
$    say "(try adding a path to the script URL)"
$ endif