Dim Array Problem in VBScript

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

 Date:  Thu, 24 Feb 2000 11:42:26 -0500
 To:  "'hwg-languages(at)hwg.org'" <hwg-languages(at)hwg.org>
  todo: View Thread, Original
I need to DIM an array with a value (t) determined by a string
passed via a form (Request.Form("c")).
Why won't the following script work?  The statement "Dim q(t)" 
generates the error, "Expected integer constant" although
I've made the "Request.Form" string result into an integer
varient type with "Cint".  Do I HAVE to use a literal integer 
where I want to use the varible "t"?
(When I use 1,2,3, etc., it works, but I have to know the 
value of "t" ahead of time, 
which defeats the purpose of what I'm trying to do.)

<%
Dim i
Dim t
t = Cint(Request.Form("c"))
Dim q(t)
For i = 1 to t
q(i) = Request.Form(i)
Next
%>

__________________________________
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.