Forums
Now you can also the reStr return the default values if the parameter exists but has a blank value. To accomplish that simply apply the parameter I_DFT_IF_BLANK
If the URL looks like (note the the text parameter) http://systest.icebreak.org/reqReq.aspx?text=&nexparm=has%20a%20value then you can provide the default with:
text = reqStr('text': 'Default also if blank' : I_DFT_IF_BLANK); <% /* --------------------------------------------------------------------------------- *\ * Example: * simply echo the string from parameter 'text' to the response * * * try it on: * http://systest.icebreak.org/reqReq.aspx?text1=Hello1&text2=Hello2&text3=Hello3 * \* --------------------------------------------------------------------------------- */ var text1 varchar(4096) var text2 varchar(4096) var text3 varchar(4096) /free *inlr = *ON; // Yes !! This is RPG // get the "text" paramter from either querystring or form (in that order) text1 = reqStr('text1'); text2 = reqStr('text2': 'HasDefault'); text3 = reqStr('text3': 'Default also if blank' : I_DFT_IF_BLANK); %>Your "text1" parameter contains :<%= text1 %><br/><% %>Your "text2" parameter contains :<%= text2 %><br/><% %>Your "text3" parameter contains :<%= text3 %><br/><%
Best regards,
Niels Liisberg
Re: reqStr() - now with "options"
Thanks for the input!