Skip to content

Commit

Permalink
Updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
IonicaBizau committed Aug 30, 2016
1 parent 31d7ba3 commit 3c4f70b
Showing 1 changed file with 43 additions and 47 deletions.
90 changes: 43 additions & 47 deletions README.md
Expand Up @@ -37,19 +37,17 @@ $ npm i cobol
var Cobol = require("cobol");

// Execute some COBOL snippets
Cobol(function () { /*
IDENTIFICATION DIVISION.
PROGRAM-ID. HELLO.
ENVIRONMENT DIVISION.
DATA DIVISION.
PROCEDURE DIVISION.
PROGRAM-BEGIN.
DISPLAY "Hello world".
PROGRAM-DONE.
STOP RUN.
*/ }, function (err, data) {
Cobol(function () {/*
IDENTIFICATION DIVISION.
PROGRAM-ID. HELLO.
ENVIRONMENT DIVISION.
DATA DIVISION.
PROCEDURE DIVISION.
PROGRAM-BEGIN.
DISPLAY "Hello world".
PROGRAM-DONE.
STOP RUN.
*/}, function (err, data) {
console.log(err || data);
});
// => "Hello World"
Expand All @@ -62,40 +60,38 @@ Cobol(__dirname + "/args.cbl", {
// => "Your name is: Alice"

// This will read data from stdin
Cobol(function () { /*
IDENTIFICATION DIVISION.
PROGRAM-ID. APP.
*> http://stackoverflow.com/q/938760/1420197
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT SYSIN ASSIGN TO KEYBOARD ORGANIZATION LINE SEQUENTIAL.
DATA DIVISION.
FILE SECTION.
FD SYSIN.
01 ln PIC X(64).
88 EOF VALUE HIGH-VALUES.
WORKING-STORAGE SECTION.
PROCEDURE DIVISION.
DISPLAY "Write something and then press the <Enter> key"
OPEN INPUT SYSIN
READ SYSIN
AT END SET EOF TO TRUE
END-READ
PERFORM UNTIL EOF
DISPLAY "You wrote: ", ln
DISPLAY "------------"
READ SYSIN
AT END SET EOF TO TRUE
END-READ
END-PERFORM
CLOSE SYSIN
STOP RUN.
*/ }, {
stdin: process.stdin
, stdout: process.stdout
Cobol(function () {/*
IDENTIFICATION DIVISION.
PROGRAM-ID. APP.
*> http://stackoverflow.com/q/938760/1420197
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT SYSIN ASSIGN TO KEYBOARD ORGANIZATION LINE SEQUENTIAL.
DATA DIVISION.
FILE SECTION.
FD SYSIN.
01 ln PIC X(64).
88 EOF VALUE HIGH-VALUES.
WORKING-STORAGE SECTION.
PROCEDURE DIVISION.
DISPLAY "Write something and then press the <Enter> key"
OPEN INPUT SYSIN
READ SYSIN
AT END SET EOF TO TRUE
END-READ
PERFORM UNTIL EOF
DISPLAY "You wrote: ", ln
DISPLAY "------------"
READ SYSIN
AT END SET EOF TO TRUE
END-READ
END-PERFORM
CLOSE SYSIN
STOP RUN.
*/}, {
stdin: process.stdin,
stdout: process.stdout
}, function (err) {
if (err) {
console.log(err);
Expand Down

0 comments on commit 3c4f70b

Please sign in to comment.