Hi,
I have an annoying problem that I have no idea where to start. What I want to do is create a var that is ‘discouverd’ from a loop that creates a string. I will give you my working example.
I have 2 arrays that loop though to create a string
[code]var days = new Array()
days[0] = “mon”
days[1] = “tues”
days[2] = “wed”
days[3] = “thurs”
days[4] = “fri”
var varname = new Array()
varname[0] = “date”
varname[1] = “who”
varname[2] = “where”
varname[3] = “time”
There are my 2 arrays, easy enough, now I want to create a string from these, so I have this;
[code]for(i=1;i<=weeks1;i++)
{
var varNew = i+days[0]+varname[0]
document.write(varNew)
}
This also works fine, the trouble is, I dont want to assign var varNew the string, I want the string to be a var it self. So 1mondate is the first string created, I want this to become a varible so I get var 1mondate and not varNew = 1mondate
I hope you understand, I am crap at explaning things ?.
So….create a var using a string created from a loop.
Thanks for your help
Chris