Home > Archive > Programming with dBASE > November 2005 > DO...UNTIL Loop Problem









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author DO...UNTIL Loop Problem
Jerry

2005-11-18, 8:23 pm

Hello Experts,

Just wondering if anybody has experienced a problem with the DO....UNTIL
command. According to the help file, you can use EXIT or LOOP inside the
loop just as you would with the DO WHILE....ENDDO command but every time I
use LOOP inside of the DO....UNTIL command, my program crashes or I get
unexpected results.

Thanks,

Jerry Rivenbark


Todd Kreuter

2005-11-18, 8:23 pm

Jerry wrote:
>
> Just wondering if anybody has experienced a problem with the DO....UNTIL
> command. According to the help file, you can use EXIT or LOOP inside the
> loop just as you would with the DO WHILE....ENDDO command but every time I
> use LOOP inside of the DO....UNTIL command, my program crashes or I get
> unexpected results.


I usually use do until rather than do while, have not experienced any
problems with it, but not sure how much I use exit. Can you post some
code? Perhaps someone can see something there.

--
Todd Kreuter [dBVIPS]
Ken Mayer [dBVIPS]

2005-11-18, 8:23 pm

Jerry wrote:
> Hello Experts,
>
> Just wondering if anybody has experienced a problem with the DO....UNTIL
> command. According to the help file, you can use EXIT or LOOP inside the
> loop just as you would with the DO WHILE....ENDDO command but every time I
> use LOOP inside of the DO....UNTIL command, my program crashes or I get
> unexpected results.


You're going to have to give more specifics. I use do while/enddo all
the time, and loop and exit commands ... no problems for me.

Ken

--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/

*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/dbase/dBASEBook.htm
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase
Bruce Beacham

2005-11-19, 3:23 am

Jerry wrote:

> Just wondering if anybody has experienced a problem with the DO....UNTIL
> command. According to the help file, you can use EXIT or LOOP inside the
> loop just as you would with the DO WHILE....ENDDO command but every time I
> use LOOP inside of the DO....UNTIL command, my program crashes or I get
> unexpected results.


If you use the debugger (put SET STEP ON just before the DO command) do
you find that the LOOP command throws control to a completely wrong
line, ie not back to the DO command?


Bruce Beacham
Marilyn Price

2005-11-19, 9:23 am

In article <hAy#r0I7FHA.1228@news-server>, RivenbarkJerry@aol.com
says...
> Hello Experts,
>
> Just wondering if anybody has experienced a problem with the DO....UNTIL
> command. According to the help file, you can use EXIT or LOOP inside the
> loop just as you would with the DO WHILE....ENDDO command but every time I
> use LOOP inside of the DO....UNTIL command, my program crashes or I get
> unexpected results.
>


Using dB2K 2.4, I've just about given up on using a loop command inside
a do...until loop. It just goes loopy... <sorry for the pun>

Last time I tried, I'd get error messages that made absolutely no sense
at all. It was just easier to test for the condition and set a flag,
then enclose the rest of the loop in an if...endif construct to keep
from processing in those cases where I really wanted to just loop.

Looping within a do while...enddo works just great, however. And has
for decades <g>.

--
Marilyn Price
M. P. Data
Bruce Beacham

2005-11-19, 11:23 am

Marilyn Price wrote:

> Last time I tried, I'd get error messages that made absolutely no sense
> at all. It was just easier to test for the condition and set a flag,
> then enclose the rest of the loop in an if...endif construct to keep
> from processing in those cases where I really wanted to just loop.


Years ago I reported this as a bug but I don't think it made it into the
bug database - perhaps the turnkey wasn't convincing enough! What was
happening was that the loop command was throwing control to a random
position in the code, not back to the DO command.

It seems so fundamental to me: it really ought to be fixed. Mind
you, I haven't re-run the turnkey (if I can find it) in the latest versions.


Bruce
Marilyn Price

2005-11-20, 1:23 pm

In article <h#11WtS7FHA.1228@news-server>, bbeacham@beacham.no-
spam.co.uk says...
> Marilyn Price wrote:
>
>
> Years ago I reported this as a bug but I don't think it made it into the
> bug database - perhaps the turnkey wasn't convincing enough! What was
> happening was that the loop command was throwing control to a random
> position in the code, not back to the DO command.


I'm just tickled to hear that others are finding the same weird behavior
- it's not just me <g>.

> It seems so fundamental to me: it really ought to be fixed. Mind
> you, I haven't re-run the turnkey (if I can find it) in the latest versions.


I agree. Wonder if Plus fixed this...

--
Marilyn Price
M. P. Data
Bruce Beacham

2005-11-20, 8:23 pm

Marilyn Price wrote:
> In article <h#11WtS7FHA.1228@news-server>, bbeacham@beacham.no-
> spam.co.uk says...
>
>
>
> I'm just tickled to hear that others are finding the same weird behavior
> - it's not just me <g>.
>
>
>
>
> I agree. Wonder if Plus fixed this...


Looks like it stops more gracefuly, but stop it still does.

Attached is a file, pretty well the code submitted with the bug report
in August 2001. Save and run it. It opens a form. Click OK and
the debugger opens to trace the next stages. Step through the code and
you will encounter a loop. Control is thrown (on my computer) back to
a line two before the DO loop starts. And the program ceases. Note
that the tools in the debugger are now inactive.

That is a graceful case, relatively speaking.

The code is of course filleted from an old live program, to demonstrate
the error and create an e-mailable turnkey. Cleaning it up might
neutralise the error. I wouldn't like you to think that all my
programs look like this one!


Bruce

Ken Mayer [dBVIPS]

2005-11-21, 9:23 am

Bruce Beacham wrote:
> Marilyn Price wrote:
>
>
>
> Looks like it stops more gracefuly, but stop it still does.
>
> Attached is a file, pretty well the code submitted with the bug report
> in August 2001. Save and run it. It opens a form. Click OK and
> the debugger opens to trace the next stages. Step through the code and
> you will encounter a loop. Control is thrown (on my computer) back to
> a line two before the DO loop starts. And the program ceases. Note
> that the tools in the debugger are now inactive.
>
> That is a graceful case, relatively speaking.
>
> The code is of course filleted from an old live program, to demonstrate
> the error and create an e-mailable turnkey. Cleaning it up might
> neutralise the error. I wouldn't like you to think that all my
> programs look like this one!


If you have a bug, please report it ...

Ken

--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/

*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/dbase/dBASEBook.htm
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase
Bruce Beacham

2005-11-22, 3:23 am

Marilyn Price wrote:

> I agree. Wonder if Plus fixed this...


I've Me-Too'd myself to QAID 3918, which Lawrence Bain submitted.
Might you too?


Bruce
Bruce Beacham

2005-11-22, 3:23 am

Jerry wrote:

Would you care to add a Me Too to QAID 3918 in the bug-reports NG?


Bruce
Bruce Beacham

2005-11-22, 3:23 am

Jerry wrote:

> Just wondering if anybody has experienced a problem with the DO....UNTIL
> command. According to the help file, you can use EXIT or LOOP inside the
> loop just as you would with the DO WHILE....ENDDO command but every time I
> use LOOP inside of the DO....UNTIL command, my program crashes or I get
> unexpected results.


Would you care to add a Me Too to QAID 3918 in the bug-reports NG?


Bruce
Marilyn Price

2005-11-22, 7:23 am

In article <gzVtS7z7FHA.1228@news-server>, bbeacham@beacham.no-
spam.co.uk says...
> Marilyn Price wrote:
>
>
> I've Me-Too'd myself to QAID 3918, which Lawrence Bain submitted.
> Might you too?


Done!

--
Marilyn Price
M. P. Data
Lawrence Bain

2005-11-22, 9:23 am

Hi Ken,

At Bruce's request, I'm reposting my reply here on the dbase group....


This bug is in the bug tracking system, Nov. 4/2002, Loopy Loop -II:

> I can reproduce but cannot tell what is happening. I have posted QAID:
> 3918 for this.
>
> Ken


When Bruce reported it a year earlier it didn't make it into the system, so
when I got stung by it again, we finally got it entered in 2002.

Lawrence Bain



Ken Mayer [dBVIPS] Wrote:

> Bruce Beacham wrote:
[color=darkred]
> If you have a bug, please report it ...
>
> Ken
>
> --
> /(Opinions expressed are purely my own, not those of dataBased
> Intelligence, Inc.)/
>
> *Ken Mayer* [dBVIPS]
> /Golden Stag Productions/
> dBASE at goldenstag dot net
> http://www.goldenstag.net/dbase/dBASEBook.htm
> http://www.goldenstag.net/GSP
> http://www.goldenstag.net/dbase


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com