Re: New "base document" available




"Rick Smith" <ricksmith@xxxxxxx> wrote in message
news:130qevi9f1ebsd8@xxxxxxxxxxxxxxxxxxxxx

"Roger While" <simrw@xxxxxxxxxxxx> wrote in message
news:euj78t$5g8$03$1@xxxxxxxxxxxxxxxxxxxx
Maybe I formulated this incorrectly.
How to go about retrieving command line parameters?

Format 1 ACCEPT and DISPLAY statements using
mneumonic-name. The implementor defines the
mnuemonic-names and their behavior with the ACCEPT
and DISPLAY statements. For X/Open, the names are:

ARGUMENT-NUMBER
ARGUMENT-VALUE

The following works for me
(using Micro Focus COBOL 3.2.24).
-----
identification division.
program-id. cmd-line.
data division.
working-storage section.
01 argc pic 99 value 0.
01 this-program-name pic x(80).
01 filler.
02 argv occurs 0 to 99 times
depending on argc pic x(80).
01 x binary pic 9(4) value 0.
procedure division.
begin.
accept argc from argument-number
display 0 upon argument-number
accept this-program-name from argument-value
display this-program-name
perform varying x from 1 by 1
until x > argc
display x upon argument-number
accept argv (x) from argument-value
display argv (x)
end-perform
stop run.
-----

This is something that has been around for a long time.
No one from the standards committee has seen fit to address
this (Yes, I know from previous posts what was said)

Not true! The "Candidate features for a future revision" list
has the following entry:

"22. 02-0160 - Command line & environment variables
(scan of 93-1045) (Schepman/Woerner): J4 - 43,
WG4 - investigate; see also 05-0029 - Environment
variables (Klink)"

The problem may be that there are not enough people
on J4 to investigate the changes required and to write
those changes for the standard.

I wonder why people aren't flocking to be on J4... and how many people does
it take to document a simple function that returns a collection?

If the current round of J4 endeavour is simply going to repeat the mistakes
of past J4 endeavours, what's the point? If the excellent people who ARE on
J4 (and I include you and Bill here) are simply going to run into the same
old management and protocol issues, wading through molasses to get a date
changed on a document when a typist could do it in 5 minutes, as if nothing
was learned in the past, then why bother?

Hardly surprising that many of the brightest and best aren't queuing up for
seats on the committee...

Still, a FUNCTION COMMAND-LINE would resolve these

Because other means are already in use, it seems more
likely that using a function would confuse; not resolve.


Not that I really care, but I STRONGLY disagree with that position. Roger is
right; a simple function would make the whole thing a lot simpler across all
platforms. The "other means" are clumsy, ugly and need a lot more time and
thought. The function could return the arguments and the number of them in a
single collection. (In fact, the collection automatically holds the number
of them as one of its attributes.) How hard is it to devise the syntax for a
simple function that returns a collection? Why should it be such an onerous
thing to do? It could be easily implemented on any platform, mainframe or
Client/Server, so there is unlikely to be resistance from vendors.

It's like when SEARCH was added to the language... there were "other means"
already in place and it took quite some time for people to start using
SEARCH (or STRING, EVALUATE etc.) - some people still never use these "new
fangled" constructs, but they are a minority... Anyone who came to COBOL in
the 1990s takes these things as read, and the Language is richer for them.

The moribundity and lollygagging that characterised previous J4 committees
seems to be alive and well...

OK, I don't want to restart the flame wars that happened last time (or throw
the baby out with the bath water; there are some dedicated people wasting
their time on J4), so that will be my final statement on this, and I'll keep
my opinions to myself in future. (Unless, of course, I'm asked, or the
nonsense gets to a level that is more than flesh and blood can stand...:-))

Pete.


.



Relevant Pages

  • Re: New "base document" available
    ... Format 1 ACCEPT and DISPLAY statements using ... 01 this-program-name pic x. ... accept argv from argument-value ...
    (comp.lang.cobol)
  • Re: New "base document" available
    ... Format 1 ACCEPT and DISPLAY statements using ... 01 this-program-name pic x. ... accept argv from argument-value ...
    (comp.lang.cobol)
  • questions about $display
    ... We are simulate a LCD by LCD module programmed in verilog. ... 1.When we use two display statements in a code the ... printed in the Console. ...
    (comp.lang.verilog)
  • I cant display the surface
    ... I'm tring to display a 3D surface obtained by rotating a profile curve ... int u, v,i,j,k; ... main(int argc, char **argv) ...
    (comp.graphics.api.opengl)