Continue While (REALbasic network user group Mailinglist archive)
Back to the thread list
Previous thread: Listbox.EditCell causes Listbox.LostFocus not to fire?
Next thread: Listbox Row Checks
| Continue While |
| Date: 01.03.10 01:23 (Sun, 28 Feb 2010 19:23:20 -0500) |
| From: Chip G. |
|
Why doesn't "continue while" work? I have code something like this:
> While Not rs.eof > If sometest Then > Beep > Continue While > End If > rs.movenext > Wend Every execution gives a beep and it seems to be stuck. This will do this all day without doing anything. The recordset is about 634 records long and I get much more than 634 beeps. Ugh! |
| Re: Continue While |
| Date: 01.03.10 13:10 (Mon, 01 Mar 2010 07:10:31 -0500) |
| From: Chip G. |
|
6 of 1, a half dozen of the other. The problem with your example, in my case, is that there are a lot of lines of code that will be inserted inside the if/else statement. Strictly speaking that is not a problem. Realistically speaking it makes it a little more difficult to read and follow. So in my example below, there are a lot of lines of code between the End If and the rs.MoveNext. In your example they would be between the Else and the End If. Within those lines of code are a ton of If and For loops. I don't know that one is faster than the other, perhaps that is worth considering, but I think mine is a little easier to read (less nested loops).
On Feb 28, 2010, at 20:39, Charles Yeomans wrote: >> So I need something more like: >> >>> While Not rs.eof >>> If sometest Then >>> Beep >>> rs.movenext >>> Continue While >>> End If >>> rs.movenext >>> Wend > > You need something like > > do until rs.EOF > if sometest then > beep > else > // > end if > rs.MoveNext > loop |
| Re: Continue While |
| Date: 01.03.10 02:39 (Sun, 28 Feb 2010 20:39:15 -0500) |
| From: Charles Yeomans |
|
On Feb 28, 2010, at 7:34 PM, Chip G. wrote: > On Feb 28, 2010, at 19:28, <email address removed> wrote: > >>>> While Not rs.eof >>>> If sometest Then >>>> Beep >>>> Continue While >>>> End If >>>> rs.movenext >>>> Wend >> >> Wouldn't your continue there just skip over rs.movenext, and thus >> totally defeat check for rs.eof? > > So I need something more like: > >> While Not rs.eof >> If sometest Then >> Beep >> rs.movenext >> Continue While >> End If >> rs.movenext >> Wend You need something like do until rs.EOF if sometest then beep else // end if rs.MoveNext loop Charles Yeomans _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives: <http://support.realsoftware.com/listarchives/lists.html> |
| Re: Continue While |
| Date: 01.03.10 01:34 (Sun, 28 Feb 2010 19:34:37 -0500) |
| From: Chip G. |
|
On Feb 28, 2010, at 19:28, <email address removed> wrote:
>>> While Not rs.eof >>> If sometest Then >>> Beep >>> Continue While >>> End If >>> rs.movenext >>> Wend > > Wouldn't your continue there just skip over rs.movenext, and thus totally defeat check for rs.eof? So I need something more like: > While Not rs.eof > If sometest Then > Beep > rs.movenext > Continue While > End If > rs.movenext > Wend |
| Re: Continue While |
| Date: 01.03.10 01:33 (Sun, 28 Feb 2010 19:33:54 -0500) |
| From: Charles Yeomans |
|
On Feb 28, 2010, at 7:23 PM, Chip G. wrote: > Why doesn't "continue while" work? I have code something like this: > >> While Not rs.eof >> If sometest Then >> Beep >> Continue While >> End If >> rs.movenext >> Wend > > Every execution gives a beep and it seems to be stuck. This will do > this all day without doing anything. The recordset is about 634 > records long and I get much more than 634 beeps. Ugh! > Continue works; your code does not. Continue causes a jump to the end of the loop, so rs.MoveNext is not called. Charles Yeomans _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives: <http://support.realsoftware.com/listarchives/lists.html> |
| Re: Continue While |
| Date: 01.03.10 01:28 (Sun, 28 Feb 2010 16:28:24 -0800) |
| From: fargo rpgportland.com |
|
> Why doesn't "continue while" work? I have code something like this:
> >> While Not rs.eof >> If sometest Then >> Beep >> Continue While >> End If >> rs.movenext >> Wend > > Every execution gives a beep and it seems to be stuck. This will do this > all day without doing anything. The recordset is about 634 records long > and I get much more than 634 beeps. Ugh! > Wouldn't your continue there just skip over rs.movenext, and thus totally defeat check for rs.eof? _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives: <http://support.realsoftware.com/listarchives/lists.html> |
Links
MBS Realbasic tutorial videos - Förderverein St. Arnulf Nickenich