Continue in a while-loop

forum.td.development (2005-2010)
MarWestermann
Germany
Posts: 74
Joined: 06 Mar 2020, 15:35
Location: Oldenburg Germany

Continue in a while-loop

Post by MarWestermann » 31 Jul 2008, 18:03

 Posted by:  Marco Westermann 

Hi,

I have an easy question but I didn't find an answer. Is there anything
similar to the continue-command in Gupta? While break steps out of the
loop, continue normally steps back to the While-line. In VB the command
is Next

Example:

Code: Select all

Set i = 0
While i<=10
	if i = 5
		Continue
	print(i)
	Set i = i+1
would print every number from 0 to 10 without 5.

Thanks Marco

MajorWoody
Germany
Posts: 41
Joined: 17 Jan 2019, 12:02
Location: Berlin, Germany

Re: Continue in a while-loop

Post by MajorWoody » 31 Jul 2008, 19:27

 Posted by:  Andreas Wagner 

Hi,

There is no such command, but the easiest way is to code something like
this:

Code: Select all

Set i = 0
While i<=10
     if i != 5
         print(i)
     Set i = i+1
Andreas

MarWestermann
Germany
Posts: 74
Joined: 06 Mar 2020, 15:35
Location: Oldenburg Germany

Re: Continue in a while-loop

Post by MarWestermann » 04 Aug 2008, 14:16

 Posted by:  Marco Westermann 

Ok, thanks

Marco

wkrause
Germany
Posts: 2
Joined: 22 Aug 2021, 14:47
Location: Berlin, Germany

Re: Continue in a while-loop

Post by wkrause » 25 Jan 2022, 12:38

Just thought I mention that "Continue" now does do the trick (tested in 7.4) to jump to the top of the loop to re-evaluate the While. Not documented as far as I could see

User avatar
Steve Leighton
Site Admin
Site Admin
New Zealand
Posts: 450
Joined: 05 Mar 2017, 20:57
Location: Stroud, England <--> Tauranga, New Zealand

Re: Continue in a while-loop

Post by Steve Leighton » 28 Jan 2022, 09:50

.
direct from the 7.4 manual..
Continue Loop TD7.4.JPG
You do not have the required permissions to view the files attached to this post.
Greetings from New Zealand
Steve Leighton

Bankside Systems Ltd.
UK ♦ Australia ♦ New Zealand

www.banksidesystems.co.uk

Image

Return to “td.development”

Who is online

Users browsing this forum: [Ccbot] and 0 guests