...

View Full Version : loop error



scroots
01-15-2003, 09:44 PM
i have
for (ci==document.f.c.value;document.f.output.value+='</tr>';)

could somebody explain what is wrong with that?
i get an expected ) error

anybody got a solution?
much help apreciated

scroots

DoubleV
01-15-2003, 10:18 PM
scroots
i am not sure what you are trutinf to accomplish looking at that line of code alone, but the first thing that comes to mind is your "=="
"==" means comparison and not value assignment.
i.e. var a = 5 assigns the value of 5 to "a"
while if (a ==5) checks if the value of a is 5 or not

loop usually goes like this
for (i=number; i<other_number; i++) {
actions here
}
and your loop does not seem to follow that syntax.

or am i totally off here???

Roy Sinclair
01-15-2003, 10:21 PM
That looks incomplete, you need three parts inside the for () condition and you've only got two listed.

for (initilization,test,increment) ...

DoubleV
01-15-2003, 10:38 PM
*lol*, so i was right after all, just could not phrase it as nicely as Roy did. what a boost to my ego! :o ;) :D

scroots
01-17-2003, 12:17 PM
thank you both there was nothing wrong with the conditions just the way my loop was setup, thank you fro your examples

scroots



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum