473,513 Members | 2,575 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASP While Loop conditions

clintw
10 New Member
Hi,

I need someone to please clarify the meaning of the following ASP lines. Having trouble following ASP's structure and not finding relevant explanations on web.

1.
Expand|Select|Wrap|Line Numbers
  1. While ((Repeat1__numRows <> 0) AND (NOT rsRacers.EOF)) 


What is Repeat1__numRows? I've seen its always initialized to -1 and is added to the row count variable of a resultset. What is the purpose of this variable?

What happens when its not used or included in the While condition?

2.
Expand|Select|Wrap|Line Numbers
  1. Repeat1__index=Repeat1__index+1
  2. Repeat1__numRows=Repeat1__numRows-1
These lines appear inside the while loop. The first line is incremented and isn't used or evaluated. The second line goes back to my first question.

3.
rsRacers.BOF- is it TRUE when there is atleast one record, or when the current row is the first row?
rsRacers.EOF- is it TRUE when there are no more records, or when the current row is the last row?


Excuse this post, if the questions are basic knowledge ;-) Thanks
Nov 5 '07 #1
1 3333
JamieHowarth0
533 Recognized Expert Contributor
Hi clint,

Yes, your questions are basic but everyone starts somewhere :-).
Each of your questions is answered as follows:
  1. Repeat1__numRows appears to be a variable assigned within your program - from the looks of the rest of your code it looks like a decrementing counter (it counts backwards one at a time until it hits zero - it looks like counting how many records are left to process in the recordset). We'd have to see the rest of your code to know for sure though.
    If you remove the Repeat__numRows <> 0 condition from the While statement it shouldn't cause you huge problems (again, subject to checking out your code), as the Not EOF condition is in there to capture the end of recordset.
  2. As per question 1.
  3. BOF and EOF stand for Beginning Of File and End Of File. BOF is normally used in a recordset where you can move backwards through records as well as forwards.
    BOF will return True when there are no records prior to your current location within the recordset (i.e. in a recordset of 10 records, your "cursor" is pointing at record number 1. If you use the MovePrevious command, the BOF property would return TRUE, as the cursor would be pointing at the Beginning Of the File, not an actual readable record - and the same principle applies with EOF except at the opposite end of the recordset).
    If you have a recordset that contains zero records (no results from query) then BOF and EOF will both equal true.
I hope that this helps.

Best regards,

medicineworker
Nov 5 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
14185
by: King W.Wang | last post by:
Hi all, is it possible or is it good practice to enclose try/catch in a loop, as: for (...) { try { ...... } catch (...) { ...... }
21
18651
by: Alo Sarv | last post by:
Hi From what I have understood from various posts in this newsgroup, writing event loops pretty much comes down to this: while (true) { handleEvents(); sleep(1); // or _sleep() or nanosleep(), depending on platform }
7
1311
by: Christopher Benson-Manica | last post by:
I have a situation something like this: int b, i, j; for( i=0 ; i < 7 ; i++ ) { b=0; for( j=0 ; j < 8 ; j++ ) { if( some_func() || other_func(i,j) ) { b=1; break;
7
585
by: Tobin Fricke | last post by:
I have a wrapper function I use to check the error conditions of various functions: wrap(foo(1,2,3)); (1) while (1 == wrap(bar("fluffy"))) { ... } (2) The wrapper function looks like this: int wrap(int code) { if (code) print_message(code);
2
1466
by: AR | last post by:
Hi I am trying to figure out how to set up the conditions of my for loop in a nested loop program. I am missing some key element in either or both the syntax of the for loop and/or the placement of the for loop in my program. I could use some help. thanks PS I tried to only include the part of the program I needed help completing.
63
3153
by: Aaron Ackerman | last post by:
What is the sytax for exiting a for loop in C#?
70
3452
by: hstagni | last post by:
When i read a key using getchar() inside a loop, the program stops and wait for a key to be pressed. I actually want the program to continue its execution until a key is pressed. Look at this sample: ------ while(1=1) { printf("oi"); ch=getchar(); if (ch=='q') break; }
3
18170
by: kavithapotnuru | last post by:
Hi All, Can anyone help me how to give multiple conditions in a while loop in perl. For example i have a while loop for which the value of a variable is A or B it should not enter in to the while loop. Basically i need the condition in the while loop should contains "||". Is it possible? If not can anyone suggest me an alternative
44
4320
by: James Watt | last post by:
can anyone tell me how to do an infinite loop in C/C++, please ? this is not a homework question .
3
1629
by: BL3WC | last post by:
Hi, I encountered an error "Object not supporting this properties or method" while trying to set a checkbox value to 'True" in a loop. The VBA code I use is as follow: Set a value to intcount (say set intcount to 2) ME("FieldName" & intcount).Properties.Value = True increment intcount by 1 and loop back to set another checkbox value to...
0
7270
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7178
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7128
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7543
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5103
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3255
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
1612
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
817
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
473
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.