I am writing something at the moment that has to process COBOL source.There are always a few pedants around who will go to the extreme,
It parses statements across lines into words and then looks at the
relative positions of Keywords, quotes, and noise to determine whether something is of interest to the process going on.
There's too much to go into here but the above is the gist of it.
One of the critical factors is the the detection and placement of the
word "TO" in a given COBOL statement.
I thought I had this covered but I realized that people can use "EQUAL
TO" as well as MOVE...TO, SET...TO, CONNECT... TO and GO TO...
This got me to reminiscing and I could not recall a single instance, in
50 years of looking at COBOL, where somebody wrote:
"A EQUAL TO B" or even, "A EQUALS B"
Everybody seems to use " = ".
Most people would rather write less than more...
I'm trying to persuade myself that I don't need to trap it because it
isn't worth the effort... (the old: "Where do I draw the line at error trapping?" conundrum...) I would need to make this a special exception
and treat it as a special case. That means adding code (complexity) to something that is already complex... (Although it ISN'T an error as far
as COBOL is concerned, I am using the TO for a specific purpose and this would be an exception for my code.)
I just wondered if anybody here HABITUALLY uses EQUAL TO in preference
to = ?
Pete.
pete dashwood wrote:
I am writing something at the moment that has to process COBOL source.There are always a few pedants around who will go to the extreme, e.g. writing
It parses statements across lines into words and then looks at the
relative positions of Keywords, quotes, and noise to determine whether
something is of interest to the process going on.
There's too much to go into here but the above is the gist of it.
One of the critical factors is the the detection and placement of the
word "TO" in a given COBOL statement.
I thought I had this covered but I realized that people can use "EQUAL
TO" as well as MOVE...TO, SET...TO, CONNECT... TO and GO TO...
This got me to reminiscing and I could not recall a single instance, in
50 years of looking at COBOL, where somebody wrote:
"A EQUAL TO B" or even, "A EQUALS B"
Everybody seems to use " = ".
Most people would rather write less than more...
I'm trying to persuade myself that I don't need to trap it because it
isn't worth the effort... (the old: "Where do I draw the line at error
trapping?" conundrum...) I would need to make this a special exception
and treat it as a special case. That means adding code (complexity) to
something that is already complex... (Although it ISN'T an error as far
as COBOL is concerned, I am using the TO for a specific purpose and this
would be an exception for my code.)
I just wondered if anybody here HABITUALLY uses EQUAL TO in preference
to = ?
Pete.
IF A IS EQUAL TO B THEN ...
:-D
pete dashwood wrote:
I just wondered if anybody here HABITUALLY uses EQUAL TO in preferenceThere are always a few pedants around who will go to the extreme,
to = ?
Pete.
e.g. writing
IF A IS EQUAL TO B THEN ...
On 09/25/2018 01:50 AM, J Leslie Turriff wrote:
pete dashwood wrote:
I just wondered if anybody here HABITUALLY uses EQUAL TO in preferenceThere are always a few pedants around who will go to the extreme, >> e.g. writing
to = ?
Pete.
IF A IS EQUAL TO B THEN ...
:-D
Some people continue to do that because it represents the
paradigm that COBOL was designed with, that is, code that
can be more easily read by humans as well as computers.
Some people continue to do that because it represents the
paradigm that COBOL was designed with, that is, code that
can be more easily read by humans as well as computers.
As compared to the other popular language of the time which
would have written: IF (A.EQ.B)
Sysop: | DaiTengu |
---|---|
Location: | Appleton, WI |
Users: | 991 |
Nodes: | 10 (0 / 10) |
Uptime: | 144:08:05 |
Calls: | 12,962 |
Files: | 186,574 |
Messages: | 3,266,454 |