Conditional Statement

Results 1 to 3 of 3

Thread: Conditional Statement

  1. #1
    illsorted Guest

    Default Conditional Statement

    I have a script that should loop through database records until the end of the database or until it hits a user-defined number of records. My while statement looks like this:<BR><BR>While (intCount &#060; intHowMany) AND Not objRS.EOF<BR> &#039do some stuff here<BR>Wend<BR><BR>Where intCount is the current record, and intHowMany is the number of records to process. The problem is that it processes until objRS.EOF = True no matter what.<BR><BR>Do I need to group the terms differently or put "Not objRS.EOF" in parentheses?

  2. #2
    KPW Guest

    Default RE: Conditional Statement

    It would help to post your actual code, but in lieu of that I would suggest using a Response.Write statement during each iteration of your loop in order to check the value of intCount.<BR><BR>This is probably a dumb question, but I&#039ll ask anyway. Your pseudo-code just says<BR><BR>&#039 do some stuff here<BR><BR>In that "stuff," are you incrementing intCount?<BR><BR>I don&#039t mean to be insulting, it&#039s just that I&#039ve forgotten to increment counters often enough that I hope I&#039m not an isolated case.<BR><BR>HTH

  3. #3
    illsorted Guest

    Default RE: Conditional Statement

    You&#039re definitely not an isolated case, I&#039ve had my share of mindless programmer errors too.<BR><BR>But in this case, yes, I am incrementing the counter (and also using objRS.MoveNext).

Posting Permissions

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