Solved

creating variable names from looping statements

Posted on 2013-01-11
1
242 Views
Last Modified: 2013-01-11
Hi

I'm trying to convert something like this:

q1 = cint(request.form("q1"))
q2 = cint(request.form("q2"))
q3 = cint(request.form("q3"))
q4 = cint(request.form("q4"))
q5 = cint(request.form("q5"))

into something like this:

for i = 1 to 5
      q&i = Request.Form(q&i)
next

any ideas?
0
Comment
Question by:arielbf
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 56

Accepted Solution

by:
Bill Prew earned 500 total points
ID: 38766753
Typically an array variable would be used for something like that, so you would have:

Dim q(5)
for i = 1 to 5
      q(i) = Request.Form("q" & i)
next

~bp
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

622 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question