Show Final Value of x=1, x=x+1 ?

Results 1 to 3 of 3

Thread: Show Final Value of x=1, x=x+1 ?

  1. #1
    Rodney Guest

    Default Show Final Value of x=1, x=x+1 ?

    if I have the following code, is there anyway to have an entry that shows the final value of x? I can&#039;t use recordcount because this code is part of an embedded query.<BR><BR>x=1<BR>do while not rs.eof<BR>rs("field")&x<BR>x=x+1<BR>rs.movenext<BR >loop<BR> <BR>so I would have record1<BR> record1<BR> record3<BR> total=3

  2. #2
    Join Date
    Dec 1969

    Default What are you doing with this?

    You could just do a response.write, but are you asking if you can store the value of x? X is not volitile, since it is not in a for loop, it will hold its value once the loop ends...<BR><BR>-- Whol

  3. #3
    Join Date
    Dec 1969

    Default And the code is wrong...

    The final value of x in that code will be 4, not 3.<BR><BR>Assuming you found 3 records.<BR><BR>Try starting with x=0 instead of x=1.<BR><BR>As to how to show it:<BR><BR>Response.Write "Total number of records is " & x & "&#060;P&#062;"<BR><BR>I would HOPE and assume that you don&#039;t mean that, so what *do* you mean?<BR><BR>

Posting Permissions

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