View Full Version : loop error

01-15-2003, 10: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


01-15-2003, 11:18 PM
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, 11:21 PM
That looks incomplete, you need three parts inside the for () condition and you've only got two listed.

for (initilization,test,increment) ...

01-15-2003, 11: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

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