Command-line arguments: Difference between revisions

(Add Genie)
Line 483:
GOBACK
.</lang>
 
Getting the arguments checking if null, and separating into individual variables.
{{works with|OpenCOBOL}}
{{works with|gnuCOBOL}}
<lang cobol>
*>Created By Zwiegnet 8/19/2004
 
IDENTIFICATION DIVISION.
PROGRAM-ID. arguments.
 
ENVIRONMENT DIVISION.
 
DATA DIVISION.
 
 
WORKING-STORAGE SECTION.
 
01 command1 PICTURE X(132).
01 command2 PICTURE X(132).
 
 
PROCEDURE DIVISION.
PERFORM GET-ARGS.
 
*> Display Usage for Failed Checks
ARGUSAGE.
display "Usage: <command1> <command2>"
STOP RUN.
 
*> Evaluate Arguments
GET-ARGS.
ACCEPT command1 FROM ARGUMENT-VALUE
IF command1 = SPACE OR LOW-VALUES THEN
PERFORM ARGUSAGE
ELSE
DISPLAY "Command1 : " function trim(command1)
 
ACCEPT command2 from ARGUMENT-VALUE
IF command2 = SPACE OR LOW-VALUES THEN
PERFORM ARGUSAGE
ELSE
DISPLAY "Command2 : " function trim(command2)
 
 
STOP RUN.
.</lang>
 
=={{header|CoffeeScript}}==