Just a quick look, it appears the code is adding to the
city and state
totals before checking if the city or state values have
changed.
Allen, have you had this vision problem for long - quick
look, my apple!
*test if city has changed?
IF (CITY NE LAST.CITY) THEN GOSUB
This code example is also flawed in that a break-on state
should
automatically
break-on city first regardless if the city has changed. As
it is, it
assumes that
there could never be this situation:
Agreed... knew there was summat I was missin' :0)
---
u2-users mailing list
[EMAIL
(A) Also, what do the CRT SPACE(40) lines do besides CRT?
(B) And shouldn't this have been written using PRINT in
case
the output wishes to go to the printer and you can use
PRINTER ON instead of changing the CRT lines.
(A) The crt space(40) lines line up the totals under
the relevant
: Dennis Bartlett [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, June 22, 2004 2:26 AM
Subject: RE: [U2] [UV] WHILE READNEXT id DO {{not a holy war,just a code
example)
(A) Also, what do the CRT SPACE(40) lines do besides CRT?
(B) And shouldn't this have been written using PRINT
I like the syntax a lot, and even put the LOOP on the same line as the
UNTIL. So Ray Wurlod's example I would have written as
LOOP WHILE READSEQ line FROM f
GOSUB processline
REPEAT
I was surprised to see an assertion that this didn't work in Pick, as I
remember Henry Eggers was a
PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, June 21, 2004 5:07 AM
Subject: RE: [U2] [UV] WHILE READNEXT id DO {{not a holy war,just a code
example)
SORT CUSTOMER
BY STATE
BY CITY
{showing} NAME
BREAK-ONCITY
BREAK-ONSTATE
TOTAL YTD-SALES
ORDERS File
:[EMAIL PROTECTED] Behalf Of Dennis Bartlett
Sent: Monday, June 21, 2004 2:07 AM
To: [EMAIL PROTECTED]
Subject: RE: [U2] [UV] WHILE READNEXT id DO {{not a holy war,just a code
example)
SORT CUSTOMER
BY STATE
BY CITY
{showing} NAME
BREAK-ONCITY
BREAK-ONSTATE
TOTAL
Another note on the differences between READNEXTS.
As I support UD/UV/D3/MCD and Native clients, I like to be consistent in my
application programs. Thus, when appropriate, I have a subroutine that I can
use blindly in my application thinking and not have to remember which format
works for which
PROTECTED]
Sent: Monday, June 21, 2004 12:22 PM
Subject: RE: [U2] [UV] WHILE READNEXT id DO {{not a holy war,just a code
example)
Just a quick look, it appears the code is adding to the city and state
totals before checking if the city or state values have changed. This
means
if the city or state has
Perhaps Cities and States won't have this real problem. But Salesman,
Customers and Products certainly could.
my 1 cent
- Original Message -
From: Allen E. Elwood (CA) [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, June 21, 2004 12:22 PM
Subject: RE: [U2] [UV] WHILE READNEXT id DO
That's painful to look at.
Isn't it more efficient to do the select and then read the id's while they are in
memory ?
What if your selection contains 500,000 items, won't that IDS array be huge ?
Mark Johnson [EMAIL PROTECTED] wrote:
Another note on the differences between READNEXTS.
As I
In message [EMAIL PROTECTED], [EMAIL PROTECTED] writes
At any rate Mark, I have never seen a problem using GOTOs that I couldn't
re-create without using GOTOs. But I think what you're really after is someone
to do this work FOR you. So show me the purchase order first ...
I have. But that was
I presume you have never had to maintain programs written in
a language totally lacking structured code elements like assembler
or to a lesser degree fortranIV.
I have.
Believe me:
GOTO's ( or conditional and unconditional branches, jumps or transfers
) ARE EVIL !
It's som much easier to
leaving the
next generation - is that what you want to be remembered
for?
dennis
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Mats Carlid
Sent: 18 June 2004 09:43
To: [EMAIL PROTECTED]
Subject: Re: [U2] [UV] WHILE READNEXT id DO
I presume you have never
PROTECTED]
06/17/2004 08:02 PM
Please respond to u2-users
To: [EMAIL PROTECTED]
cc:
Subject:Re: [U2] [UV] WHILE READNEXT id DO
Don't forget that the second set has the benefit of the first set leaving
some of the data in virtual memory, hence the second set
END.CPU-START.CPU: :CTR: GOTO
-Original Message-
From: Mark Johnson [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 17, 2004 6:03 PM
To: [EMAIL PROTECTED]
Subject: Re: [U2] [UV] WHILE READNEXT id DO
Don't forget that the second set has the benefit of the first
set leaving
some
, June 17, 2004 9:32 PM
Subject: RE: [U2] [UV] WHILE READNEXT id DO
Mark Johnson wrote:
This appears to be the semi-annual GOTO holy war.
But only one side is fighting.
Leave it alone Mark. Nothing good came of it last time, and nothing good
will come of it this time. Those who believe GOTOs
At 01:07 PM 6/18/2004, you wrote:
I've always thought it would be cool if some Pick vendor would create a verb
like MAKE.BASIC
And you could say
MAKE.BASIC SELECT CUSTOMER WITH LAST.NAME = JOHNSON BY STATE BREAK-ON STATE
TOTAL COUNTER
And it would take the statement and turn it into a BASIC
And ol' Arev has this feature as a query option:
LIST FILE BY THIS BY THAT BREAK-ON THIS TOTAL SOMETHING (X)
With the option X, you are prompted for a file name and record id, and the source
code is written there. Sort of funky-looking, though... Don't know if they carried
it over into
Personally, I love this syntax. When training others, I usually explain it in this
form; READNEXT has to generate a true/untrue value of some kind to determine whether
to go down its THEN or ELSE path. We take advantage of that Boolean context to
trigger the behaviour of WHERE or UNTIL in a
Personally I use it all the time (except I'm even sloppier and I drop the
DO )
It's been around for as long as I can remember so I think it just isn't
documented
I find it pretty readable but I take your point on using undocumented
features - boy, will I be in trouble if IBM ever change it.
Piers
The format -
LOOP WHILE READNEXT ID
code
REPEAT
was the suggested standard where I used to work.
Louis
- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, June 17, 2004 4:57 PM
Subject: [U2] [UV] WHILE READNEXT id DO
: LOOP
: code
: WHILE
Hi Adrian,
I personally use:
EOF=0
LOOP
READNEXT id ELSE EOF=1
code
UNTIL EOF DO
code
REPEAT
It is much clearer(i hope) to the next guy looking at the code.
Louie.
Adrian wrote:
LOOP
code
WHILE READNEXT id DO
For any of the newbies on this forum, there are a few things to mention
about READNEXT.
First, it is not married to or dependent upon LOOP...REPEAT. That's just one
of the popular ways it's used. I've seen and used it in different
structures.
Second, the dynamics of WHILE/UNTIL behave
the application.
my 1 cent
- Original Message -
From: Louie Gouws [EMAIL PROTECTED]
To: u2 List (E-mail) [EMAIL PROTECTED]
Sent: Thursday, June 17, 2004 6:50 AM
Subject: Re: [U2] [UV] WHILE READNEXT id DO
Hi Adrian,
I personally use:
EOF=0
LOOP
READNEXT id ELSE EOF=1
code
I like to use :
LOOP WHILE 1 DO
READNEXT ID ELSE EXIT
REPEAT
Louis Windsor [EMAIL PROTECTED] wrote:
The format -
LOOP WHILE READNEXT ID
code
REPEAT
was the suggested standard where I used to work.
Louis
- Original Message -
From:
To:
Sent: Thursday, June 17, 2004 4:57 PM
To: [EMAIL PROTECTED]
Subject: Re: [U2] [UV] WHILE READNEXT id DO
I like to use :
LOOP WHILE 1 DO
READNEXT ID ELSE EXIT
REPEAT
Louis Windsor wrote:
The format -
LOOP WHILE READNEXT ID
code
REPEAT
was the suggested standard where I used to work.
Louis
- Original Message -
From
That is what I have used for years. It's simple to understand what the
program is doing.
At 03:03 PM 6/17/2004 +0100, you wrote:
Why do you need the WHILE 1 DO?
You could use
LOOP
READNEXT ID ELSE EXIT
code
REPEAT
Peter Gonzalez
Senior Programmer Analyst
M M Aerospace
To: [EMAIL PROTECTED]
cc:
Subject:Re: [U2] [UV] WHILE READNEXT id DO
I like to use :
LOOP WHILE 1 DO
READNEXT ID ELSE EXIT
REPEAT
---
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/
You could even try
LOOP
READNEXT ID ELSE EXIT
[Code goes here]
REPEAT
This works just fine.
-Original Message-
From: Dave S [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 17, 2004 9:57 AM
To: [EMAIL PROTECTED]
Subject: Re: [U2] [UV] WHILE READNEXT id DO
I like to use
Health Care Management Group
Dave S
Sent by: [EMAIL PROTECTED]
06/17/2004 09:56 AM
Please respond to u2-users
To: [EMAIL PROTECTED]
cc:
Subject: Re: [U2] [UV] WHILE READNEXT id DO
I like to use :
LOOP WHILE 1 DO
READNEXT ID ELSE EXIT
REPEAT
---
u2-users mailing list
[EMAIL PROTECTED
[EMAIL PROTECTED] ...
LOOP
code
WHILE READNEXT id DO
more code
REPEAT
I prefer:
100
[code]
GOTO 300
200
[more code]
GOTO 100
300
READNEXT ID THEN GOTO 200
---
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/
PM
Please respond to u2-users
To: [EMAIL PROTECTED]
cc:
Subject:Re: [U2] [UV] WHILE READNEXT id DO
If you are running on some old school system, it may cost you.
But don't these programs on Unidata all get compiled into C ?
[EMAIL PROTECTED] wrote:
Why use
Of Simon Lewington
Sent: Thursday, June 17, 2004 11:02 AM
To: [EMAIL PROTECTED]
Subject: Re: [U2] [UV] WHILE READNEXT id DO
[EMAIL PROTECTED] ...
LOOP
code
WHILE READNEXT id DO
more code
REPEAT
I prefer:
100
[code]
GOTO 300
200
[more code]
GOTO 100
300
READNEXT ID THEN GOTO 200
---
u2-users
Now we all know that you are kidding, right?
Rule number 1 when we traine new programmers. NO GOTOs!
At 07:02 PM 6/17/2004 +0100, you wrote:
[EMAIL PROTECTED] ...
LOOP
code
WHILE READNEXT id DO
more code
REPEAT
I prefer:
100
[code]
GOTO 300
200
[more code]
GOTO 100
300
READNEXT ID
: Thursday, June 17, 2004 11:02 AM
To: [EMAIL PROTECTED]
Subject: Re: [U2] [UV] WHILE READNEXT id DO
[EMAIL PROTECTED] ...
LOOP
code
WHILE READNEXT id DO
more code
REPEAT
I prefer:
100
[code]
GOTO 300
200
[more code]
GOTO 100
300
READNEXT ID THEN GOTO 200
---
u2-users mailing list
[EMAIL
REPEAT
END.CPU = SYSTEM(9)
CRT END.CPU-START.CPU
I get
290
320
Bruce M Neylon
Health Care Management Group
Dave S
Sent by: [EMAIL PROTECTED]
06/17/2004 01:09 PM
Please respond to u2-users
To: [EMAIL PROTECTED]
cc:
Subject: Re: [U2] [UV] WHILE READNEXT id DO
If you are running on some old
:
Subject:Re: [U2] [UV] WHILE READNEXT id DO
No thanks. I don't have any time for that today or tomorrow either.
We are running SB+ here and don't write this little loopy d loop routines
here anyway.
---
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http
:[EMAIL PROTECTED] Behalf Of Glenn Herbert
Sent: Thursday, June 17, 2004 12:01 PM
To: [EMAIL PROTECTED]
Subject: RE: [U2] [UV] WHILE READNEXT id DO
Is BASIC structured? :-p
If your answer is yes, then the GOTO should probably not be allowed (except
in rare cases).
If your answer is no, then GOTO
the way we've always done it
:-)
Have a good one.
Bruce M Neylon
Health Care Management Group
Dave S
Sent by: [EMAIL PROTECTED]
06/17/2004 03:21 PM
Please respond to u2-users
To: [EMAIL PROTECTED]
cc:
Subject: Re: [U2] [UV] WHILE READNEXT id DO
No thanks. I don't have any time for that today
, 2004 5:49 PM
Subject: Re: [U2] [UV] WHILE READNEXT id DO
I worked for one company that required us to take a programming test.
We had to code a program without any goto's to pass the test.
Once employed, all programmers were required to follow the programming
standards
there.
[EMAIL
ELSE GOTO 15
GOTO 10
15 END=SYS9
PRINT END-START
- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, June 17, 2004 2:25 PM
Subject: Re: [U2] [UV] WHILE READNEXT id DO
If you are running on any system it will cost you. The only question is,
do you mind
like to see how the other side programs this.
thanks in advance.
- Original Message -
From: Glenn Herbert [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, June 17, 2004 3:00 PM
Subject: RE: [U2] [UV] WHILE READNEXT id DO
Is BASIC structured? :-p
If your answer is yes
-
[EMAIL PROTECTED] On Behalf Of Dave S
Sent: Friday, 18 June 2004 3:10 AM
To: [EMAIL PROTECTED]
Subject: Re: [U2] [UV] WHILE READNEXT id DO
If you are running on some old school system, it may cost you.
But don't these programs on Unidata all get compiled into C ?
---
Outgoing mail is certified
Mark Johnson wrote:
This appears to be the semi-annual GOTO holy war.
But only one side is fighting.
Leave it alone Mark. Nothing good came of it last time, and nothing good
will come of it this time. Those who believe GOTOs have their uses will not
be convinced otherwise by a thread on a
a good programmer. IMHO!
Allen
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Mark Johnson
Sent: Thursday, June 17, 2004 5:12 PM
To: [EMAIL PROTECTED]
Subject: Re: [U2] [UV] WHILE READNEXT id DO
Very good question. Is BASIC Structured. And who defines
46 matches
Mail list logo