/****************************************************************************/
/* SpHyDir_Decode Procedure */
/* */
/* Processes the list of "variable=value" pairs transmitted by a remote */
/* Web Browser in a "Forms" style query. */
/* Each variable is decoded and turned into a local Rexx variable of the */
/* same name. */
/****************************************************************************/
SpHyDir_Decode:
parse arg _SpHyDir_list
do while _SpHyDir_list<>""
parse var _SpHyDir_list _SpHyDir_item "&" _SpHyDir_list
parse var _SpHyDir_item _SpHyDir_variable "=" _SpHyDir_value
_SpHyDir_value=packur(translate(_SpHyDir_value," ","+"))
ok =value(_SpHyDir_variable,_SpHyDir_value)
end
return
/****************************************************************************/
/* SpHyDir_Reply Procedure */
/* */
/* Called by Rexx program in GOSERVE environment to insert values */
/* from program variables into an HTML file being sent back to a remote */
/* user of the "Forms" interface. */
/* */
/* Arguments: Library name (in HTMLLIB) of template HTML file */
/* Name of temporary output file */
/* */
/* Note: This routine extracts variable names from the calling program, */
/* so it cannot run as an external file or under a PROCEDURE statement. */
/* It is embedded into the calling program either with an editor or */
/* using the VX-Rexx "shared code" include facility. */
/****************************************************************************/
SpHyDir_Reply:
parse arg _SpHyDir_infile,_SpHyDir_outfile
ok=VRCreateFile(_SpHyDir_outfile)
_SpHyDir_inpath=translate(value("HTMLLIB",,"OS2ENVIRONMENT")'\'_SpHyDir_infile,'\','/')
_SpHyDir_from=1
if SysGetEA(_SpHyDir_inpath,"PCLT-SPHYDIR.VARIABLES","_SpHyDir_EA")=0 then
do
_SpHyDir_EA=substr(_SpHyDir_EA,5)
do while _SpHyDir_EA<>""
parse var _SpHyDir_EA _SpHyDir_type _SpHyDir_name _SpHyDir_offset _SpHyDir_length '0D0A'x _SpHyDir_EA
if _SpHyDir_type="RADIOBUT" then parse var _SpHyDir_name _SpHyDir_name "=" selection
call charout _SpHyDir_outfile, charin(_SpHyDir_inpath,_SpHyDir_from,_SpHyDir_offset-_SpHyDir_from+1)
if (_SpHyDir_type<>"SELECT" & symbol(_SpHyDir_name)="VAR") |,
(_SpHyDir_type="SELECT" & symbol(_SpHyDir_name".0")="VAR") then
select
when wordpos(_SpHyDir_type,"ENTRY MLE PUSHBUT PARA PRE")>0 then
call charout _SpHyDir_outfile, value(_SpHyDir_name)
when _SpHyDir_type="CHECKBOX" & wordpos(value(_SpHyDir_name),"1 ON YES CHECKED")>0 then
call charout _SpHyDir_outfile, "CHECKED"
when _SpHyDir_type="RADIOBUT" & (value(_SpHyDir_name)= selection) then
call charout _SpHyDir_outfile, "CHECKED"
when _SpHyDir_type="SELECT" then
do i = 1 to value(_SpHyDir_name".0")
call lineout _SpHyDir_outfile, "<OPTION>" value(_SpHyDir_name"."i)
end
otherwise NOP
end
else
if _SpHyDir_length>0 then call charout _SpHyDir_outfile, charin(_SpHyDir_inpath,_SpHyDir_offset+1,_SpHyDir_length)
_SpHyDir_from=_SpHyDir_offset+_SpHyDir_length+1
end
end
call charout _SpHyDir_outfile, charin(_SpHyDir_inpath, _SpHyDir_from,100000)
call lineout _SpHyDir_outfile
return 'FILE ERASE TYPE text/html NAME' _SpHyDir_outfile
exit