dealing with NULL strings passed by <FORM>

by "Shull, Conrad" <cshull(at)shscares.org>

 Date:  Thu, 27 Jan 2000 13:34:10 -0500
 To:  "'hwg-languages(at)hwg.org'" <hwg-languages(at)hwg.org>
  todo: View Thread, Original
Is there an shortcut for this?  I am converting string variables passed via
<FORM> Post to Single Numbers, so calculations can be done on the variables.
The following code does the job fine, unless a NULL value is passed.  Then,
the VBScript chokes.

r1 = CSng(request.form("r1")
r2 = CSng(request.form("r2"))
r3 = CSng(request.form("r3"))
r4 = CSng(request.form("r4"))
r5 = CSng(request.form("r5"))

I can do something like this in place of each line:

if IsNull(request.form("r1")) then
r1 = 0
else 
r1 = CSng(r1)
end if

However, I have not five, but 84 such passed variables. A For/Next statement
would be nice to populate the "r" with 1 through 5 suffixes, but can I do
this in this case given the string type in the request.form?  Any advice?
(I also have to filter for any alphabetics erroneously passed, but that's
another issue.)

__________________________________
Conrad Shull
Information Technology Associate
Learning Resources Center
Susquehanna Health System
www.shscares.org
cshull(at)shscares.org
webmaster(at)shscares.org
570.321.2266

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA

This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.