SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Apr 2006
    Posts
    89
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    for loop condition

    I feel silly asking this but I have had not luck so far in achieving a result.

    While the condition is being evaluated in a for loop how would a sub-condition be written that pulls out a specific block of the whole that is being executed.

    Say, if one was iterating through 900 or so records and the user only wanted records 50 through 100 one time and maybe another time the user wanted records 325 through 399.

    Thanks for any help . . .

  2. #2
    ✯✯✯ silver trophybronze trophy php_daemon's Avatar
    Join Date
    Mar 2006
    Posts
    5,284
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Well, so you specify different initial value and different value in condition.

    Code JavaScript:
    var start=50;
    var count=100;
     
    for(i=start; i<count; i++)
    Saul

  3. #3
    SitePoint Enthusiast
    Join Date
    Apr 2006
    Posts
    89
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you daemon . . .


Bookmarks

Posting Permissions

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