Joining 2 variables together for one name
Hi there
I was wondering if anyone could help me. I'm pretty sure it's something really basic but I've been scratching my head for a while now!
I have an update process page, with one section of code being:
Dim Command1__content_title
Command1__content_title = ""
if(Request("content_title") <> "") then Command1__content_title = Request("content_title")
I then have one for Command1__content_title2 (which follows the same format) and this format continues up to Command1__content_title8.
So, i thought i'd do a loop around the 2 - 8 names variables...
Dim i
for i = 2 to 8
Dim Command1__content_title & i
Command1__content_title & i = ""
if(Request("content_title" & i) <> "") then Command1__content_title & i = Request("content_title" & i)
next
BUT i'm getting an error message saying that a names being redefined (assume this is the Command1__content_title part of my loop bit)
So, what am I doing wrong with the naming of my variable to get the Command1__content_title & i to come out as Command1__content_title2, Command1__content_title3 etc?
Thanks in advance
Lucy xx
|