I think the UNTIL should be in behind NEXT A2, rather than on the FOR line.
Hoping to lighten the day...
BAIL = 0
FOR A1 = 1 TO XYZZY
FOR A2 = 1 TO Y
little twisted logic
IF G # H THEN BAIL = 51 ;* error code
UNTIL BAIL DO
twisted little logic
Once more, VLIST answers the question:
1: FOR A1 = 1 TO X
1 0 : 0F8 move 0 = A1
1 6 : 098 forincrA1 X 1 00058:
2: FOR A2 = 1 TO Y
2 00014 : 0F8 move 0 = A2
2 0001A : 098 forincrA2 Y 1 00050:
3:
19, 2012 4:43 PM
To: U2 Users List
Subject: Re: [U2] EXIT ; EXIT inside a loop
Not from what I see. Only the first EXIT seems to apply as it executes
immediately, skipping over the second EXIT. You would have to add the
same test of G = H after the NEXT A2 statement.
-Original Message
See FIND and/or FINDSTR in the BASIC reference guide.
On Fri, Apr 20, 2012 at 8:30 AM, Dave Laansma
dlaan...@hubbardsupply.com wrote:
This example was brought up because I'm essentially 'searching' through
a 3-dimensional table and when I find a specific string in a sub-value,
I need to abort
To: U2 Users List
Subject: Re: [U2] EXIT ; EXIT inside a loop
See FIND and/or FINDSTR in the BASIC reference guide.
On Fri, Apr 20, 2012 at 8:30 AM, Dave Laansma
dlaan...@hubbardsupply.com wrote:
This example was brought up because I'm essentially 'searching'
through a 3-dimensional table and when
-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Rex Gozar
Sent: Friday, April 20, 2012 8:40 AM
To: U2 Users List
Subject: Re: [U2] EXIT ; EXIT inside a loop
See FIND and/or FINDSTR in the BASIC reference guide.
On Fri, Apr 20, 2012 at 8:30 AM, Dave
Of Rex Gozar
Sent: Friday, April 20, 2012 8:46 AM
To: U2 Users List
Subject: Re: [U2] EXIT ; EXIT inside a loop
read the documentation -- you can step thru occurences
On Fri, Apr 20, 2012 at 8:44 AM, Dave Laansma
dlaan...@hubbardsupply.com wrote:
I won't know it's the right string until I perform
...@listserver.u2ug.org] On Behalf Of Dave Laansma
Sent: Thursday, April 19, 2012 1:36 PM
To: u2-users@listserver.u2ug.org
Subject: [U2] EXIT ; EXIT inside a loop
Given:
FOR A1 = 1 TO X
FOR A2 = 1 TO Y
little twisted logic
IF G = H THEN EXIT ; EXIT
twisted little logic
NEXT A2
twisting
or use the UNTIL or WHILE clauses on the FOR-NEXT
On Thu, Apr 19, 2012 at 4:46 PM, David A. Green
dgr...@dagconsulting.com wrote:
Without testing I would say no. The EXIT is a branching statement, a GOTO
in disguise.
Using a LOOP WHILE REPEAT construct might be better.
David A. Green
You could add logic to the For Next as in:
A1.DONE = FALSE
A2.DONE = FALSE
FOR A1 = 1 TO X UNTIL A1.DONE
FOR A2 = 1 TO Y UNTIL A2.DONE
little twisted logic
IF G = H THEN A1.DONE = TRUE; A2.DONE = TRUE; EXIT
twisted little logic
NEXT A2
twisting little logic
NEXT A1
List'
Subject: Re: [U2] EXIT ; EXIT inside a loop
You could add logic to the For Next as in:
A1.DONE = FALSE
A2.DONE = FALSE
FOR A1 = 1 TO X UNTIL A1.DONE
FOR A2 = 1 TO Y UNTIL A2.DONE
little twisted logic
IF G = H THEN A1.DONE = TRUE; A2.DONE = TRUE; EXIT
twisted little logic
)
next A1
next A2
Stuart
From: Dave Laansma
Sent: 20-Apr-12 6:36
To: u2-users@listserver.u2ug.org
Subject: [U2] EXIT ; EXIT inside a loop
Given:
FOR A1 = 1 TO X
FOR A2 = 1 TO Y
little twisted logic
IF G = H THEN EXIT ; EXIT
twisted little logic
6:36
To: u2-users@listserver.u2ug.org
Subject: [U2] EXIT ; EXIT inside a loop
Given:
FOR A1 = 1 TO X
FOR A2 = 1 TO Y
little twisted logic
IF G = H THEN EXIT ; EXIT
twisted little logic
NEXT A2
twisting little logic
NEXT A1
little twisting logic
The question
BTW are you really just trying to do a FINDSTR?
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users
retwisted logic (agh)
ext A1
ext A2
Stuart
___
rom: Dave Laansma
ent: 20-Apr-12 6:36
o: u2-users@listserver.u2ug.org
ubject: [U2] EXIT ; EXIT inside a loop
Given:
FOR A1 = 1 TO X
FOR A2 = 1 TO Y
little twisted logic
IF G = H THEN EXIT ; EXIT
twisted little
'
Subject: Re: [U2] EXIT ; EXIT inside a loop
You could add logic to the For Next as in:
A1.DONE = FALSE
A2.DONE = FALSE
FOR A1 = 1 TO X UNTIL A1.DONE
FOR A2 = 1 TO Y UNTIL A2.DONE
little twisted logic
IF G = H THEN A1.DONE = TRUE; A2.DONE = TRUE; EXIT
twisted little logic
I think people are missing the original post. A WHILE or UNTIL on the
FOR...NEXT doesn't work for this scenario. That is why I suggested the
LOOP...UNTIL...DO...REPEAT construct.
David A. Green
(480) 813-1725
DAG Consulting
___
U2-Users mailing list
of if? More of a Volvo than a Ford a little bit boxy, but quite
safe).
From: David A. Green
Sent: 20-Apr-12 7:36
To: 'U2 Users List'
Subject: Re: [U2] EXIT ; EXIT inside a loop
I think people are missing the original post. A WHILE or UNTIL on the
FOR...NEXT doesn't work
Huh? you have end cases without begin cases?
I don't know what this means
-Original Message-
From: Boydell, Stuart stuart.boyd...@spotless.com.au
To: U2 Users List u2-users@listserver.u2ug.org
Sent: Thu, Apr 19, 2012 3:05 pm
Subject: Re: [U2] EXIT ; EXIT inside a loop
FOR A1 = 1 TO X
: Thursday, April 19, 2012 3:05 PM
To: U2 Users List
Subject: Re: [U2] EXIT ; EXIT inside a loop
FOR A1 = 1 TO X until G = H
FOR A2 = 1 TO Y until G = H
little twisted logic
case G # H
twisted little logic
End case
NEXT A2
case G # H
twisting little logic
End case
NEXT A1
does
You don't need a DONE.FLAG at all
just loop until the criteria is hit
-Original Message-
From: David A. Green dgr...@dagconsulting.com
To: 'U2 Users List' u2-users@listserver.u2ug.org
Sent: Thu, Apr 19, 2012 3:15 pm
Subject: Re: [U2] EXIT ; EXIT inside a loop
yes adding the case
: Thursday, April 19, 2012 3:18 PM
To: u2-users@listserver.u2ug.org
Subject: Re: [U2] EXIT ; EXIT inside a loop
You don't need a DONE.FLAG at all
just loop until the criteria is hit
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http
Subject: Re: [U2] EXIT ; EXIT inside a loop
Will,
The DONE.FLAG allows the program to gracefully exit out without having to go
hru frivolous loops.
David A. Green
480) 813-1725
AG Consulting
Original Message-
rom: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun
, Apr 19, 2012 3:21 pm
Subject: Re: [U2] EXIT ; EXIT inside a loop
Will,
The DONE.FLAG allows the program to gracefully exit out without having to go
hru frivolous loops.
David A. Green
480) 813-1725
AG Consulting
Original Message-
rom: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users
Users List' u2-users@listserver.u2ug.org
Sent: Thu, Apr 19, 2012 3:35 pm
Subject: Re: [U2] EXIT ; EXIT inside a loop
Will,
This type of logic is a common practice when you can have an Abort situation
n the middle of processing data.
You are correct in your examples they are the same
Subject: Re: [U2] EXIT ; EXIT inside a loop
I have no idea what you mean, they both abort if you want to call it
that.
They both exit the loop on the exact same condition, at the exact same
moment.
I don't see the distinction you're trying to draw
-Original Message-
From: David
...@dagconsulting.com
To: 'U2 Users List' u2-users@listserver.u2ug.org
Sent: Thu, Apr 19, 2012 4:28 pm
Subject: Re: [U2] EXIT ; EXIT inside a loop
I was referring to the outer loops.
David A. Green
480) 813-1725
AG Consulting
Original Message-
rom: u2-users-boun...@listserver.u2ug.org
mailto:u2-users-boun
) 813-1725
DAG Consulting
-Original Message-
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Wjhonson
Sent: Thursday, April 19, 2012 4:33 PM
To: u2-users@listserver.u2ug.org
Subject: Re: [U2] EXIT ; EXIT inside a loop
You don't need
From: u2-users-boun...@listserver.u2ug.org
[u2-users-boun...@listserver.u2ug.org] On Behalf Of Wjhonson [wjhon...@aol.com]
Sent: Thursday, April 19, 2012 7:32 PM
To: u2-users@listserver.u2ug.org
Subject: Re: [U2] EXIT ; EXIT inside a loop
You don't need
...@listserver.u2ug.org
[u2-users-boun...@listserver.u2ug.org] On Behalf Of David A. Green
[dgr...@dagconsulting.com]
Sent: Thursday, April 19, 2012 7:41 PM
To: 'U2 Users List'
Subject: Re: [U2] EXIT ; EXIT inside a loop
Will,
Two things.
First, good programming practice tells you to define the abort logic
30 matches
Mail list logo