Re: New "base document" available
- From: "Rick Smith" <ricksmith@xxxxxxx>
- Date: Fri, 30 Mar 2007 12:32:08 -0500
"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.
.
- Follow-Ups:
- Re: New "base document" available
- From: Pete Dashwood
- Re: New "base document" available
- From: Roger While
- Re: New "base document" available
- Prev by Date: Re: Passing values to PowerCOBOL DLL
- Next by Date: Re: Thoughts on passing values to PowerCOBOL DLL
- Previous by thread: Re: New "base document" available
- Next by thread: Re: New "base document" available
- Index(es):
Relevant Pages
|