Solved

creating variable names from looping statements

Posted on 2013-01-11
1
234 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
1 Comment
 
LVL 52

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This script will sweep a range of IP addresses (class c only, 255.255.255.0) and report to a log the version of office installed. What it does: 1.)      Creates log file in the directory the script is run from (if it doesn't already exist) 2.)      Sweep…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …

929 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now