Solved

creating variable names from looping statements

Posted on 2013-01-11
1
232 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 51

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

747 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

10 Experts available now in Live!

Get 1:1 Help Now