Re: New "base document" available




"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.

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.



.



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)