Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5

Thread: loop error

  1. #1
    Senior Coder
    Join Date
    Jun 2002
    Location
    UK
    Posts
    1,137
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cool loop error

    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
    Spammers next time you spam me consider the implications:
    (1) that you will be persuaded by me(in a legitimate mannor)
    (2)It is worthless to you, when i have finished

  • #2
    Regular Coder
    Join Date
    Dec 2002
    Location
    the windy city
    Posts
    140
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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???

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That looks incomplete, you need three parts inside the for () condition and you've only got two listed.

    for (initilization,test,increment) ...

  • #4
    Regular Coder
    Join Date
    Dec 2002
    Location
    the windy city
    Posts
    140
    Thanks
    0
    Thanked 0 Times in 0 Posts
    *lol*, so i was right after all, just could not phrase it as nicely as Roy did. what a boost to my ego!

  • #5
    Senior Coder
    Join Date
    Jun 2002
    Location
    UK
    Posts
    1,137
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thank you both there was nothing wrong with the conditions just the way my loop was setup, thank you fro your examples

    scroots
    Spammers next time you spam me consider the implications:
    (1) that you will be persuaded by me(in a legitimate mannor)
    (2)It is worthless to you, when i have finished


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •