For Programmers: Free Programming Magazines  


Home > Archive > Clipper > February 2006 > Go from inner loop to outer loop









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 Go from inner loop to outer loop
ehabaziz2001@gmail.com

2006-02-23, 6:55 pm

I need to go in certain condition from inner loop to execute outer loop
..
as following :


do while outer_loop
statement 1_o
statement 2_o
do while inner_loop
statement 1_i
statement 2_i
if (certain condition )
loop and go to outer loop ^^^^^^^ HERE IT IS MY QUESTION
?
enddo
enddo

Dave P

2006-02-23, 6:55 pm


<ehabaziz2001@gmail.com> wrote in message
news:1140706448.415266.263100@e56g2000cwe.googlegroups.com...
> I need to go in certain condition from inner loop to execute outer loop
> .
> as following :
>
>
> do while outer_loop
> statement 1_o
> statement 2_o
> do while inner_loop
> statement 1_i
> statement 2_i
> if (certain condition )
> loop and go to outer loop ^^^^^^^ HERE IT IS MY QUESTION
> ?
> enddo
> enddo
>

louterloop:=true
linnerloop:=true
do while louterloop
statment 1
statment 2
do while linnerloop
if condition
exit
endif
//do other statments
enddo
//somtimes inner loop can set outerloop too false (finished)
if ! louterloop
exit
endif
enddo

DAve


Fred Zuckerman

2006-02-23, 6:55 pm

check out the EXIT command
Fred Zuckerman

<ehabaziz2001@gmail.com> wrote in message
news:1140706448.415266.263100@e56g2000cwe.googlegroups.com...
> I need to go in certain condition from inner loop to execute outer loop
> .
> as following :
>
>
> do while outer_loop
> statement 1_o
> statement 2_o
> do while inner_loop
> statement 1_i
> statement 2_i
> if (certain condition )
> loop and go to outer loop ^^^^^^^ HERE IT IS MY QUESTION
> ?
> enddo
> enddo
>



pete@nospam.demon.co.uk

2006-02-23, 6:55 pm

In article <O5mLf.11979$rL5.10332@newssvr27.news.prodigy.net>
ZuckermanF@sbcglobal.net "Fred Zuckerman" writes:

> check out the EXIT command
> Fred Zuckerman
>
> <ehabaziz2001@gmail.com> wrote in message


And also the "RTFM" command...

> news:1140706448.415266.263100@e56g2000cwe.googlegroups.com...
>
>
>


--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?
Norman Perelson

2006-02-23, 6:55 pm


<pete@nospam.demon.co.uk> wrote in message
news:1140721099snz@nospam.demon.co.uk...
> In article <O5mLf.11979$rL5.10332@newssvr27.news.prodigy.net>
> ZuckermanF@sbcglobal.net "Fred Zuckerman" writes:
>
>
> And also the "RTFM" command...
>

No need to get impatient. I believe these questions are coming from
programming students. Definitely not professional programmers.

>

I personally don't like to use the EXIT command because it spoils the tidy
logical structure of the program. I use, instead:

do while outer_loop
statement 1_o
statement 2_o
do while inner_loop .AND. (certain condition)
statement 1_i
statement 2_i
enddo
enddo

--
Norman Perelson
http://www.shopkeeper.co.za


Fred Zuckerman

2006-02-23, 6:55 pm

Then I guess I shouldn't have answered at all...
Fred Zuckerman

"Norman Perelson" <norman@shoso.co.za> wrote in message
news:dtlaup$18v$1@ctb-nnrp2.saix.net...
>
> <pete@nospam.demon.co.uk> wrote in message
> news:1140721099snz@nospam.demon.co.uk...
> No need to get impatient. I believe these questions are coming from
> programming students. Definitely not professional programmers.
>
loop[color=darkred]
QUESTION[color=darkred]
> I personally don't like to use the EXIT command because it spoils the tidy
> logical structure of the program. I use, instead:
>
> do while outer_loop
> statement 1_o
> statement 2_o
> do while inner_loop .AND. (certain condition)
> statement 1_i
> statement 2_i
> enddo
> enddo
>
> --
> Norman Perelson
> http://www.shopkeeper.co.za
>
>



Ross McKenzie

2006-02-23, 6:55 pm

On Thu, 23 Feb 2006 23:53:32 +0200, "Norman Perelson"
<norman@shoso.co.za> wrote:

>
><pete@nospam.demon.co.uk> wrote in message
>news:1140721099snz@nospam.demon.co.uk...
>No need to get impatient. I believe these questions are coming from
>programming students. Definitely not professional programmers.
>
>I personally don't like to use the EXIT command because it spoils the tidy
>logical structure of the program. I use, instead:
>
>do while outer_loop
> statement 1_o
> statement 2_o
> do while inner_loop .AND. (certain condition)
> statement 1_i
> statement 2_i
> enddo
>enddo
>
>--
>Norman Perelson
>http://www.shopkeeper.co.za
>


Good morning Gentlemen.

Personally, I prefer a generic approach that allows many do while/for
next nested loops and avoids the cascading of condition tests that can
challenge my sanity.

The approach I use is begin sequence/break/end sequence.

Regards,

Ross McKenzie
ValuSoft
Melbourne Australia

valusoft AT optusnet DOT com DOT au
Sponsored Links







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

Copyright 2008 codecomments.com