REBOL for COBOL programmers

Go to table of contents Go to feedback page
Table of contents

Generalities
Introduction
Reserved words
What you may/must say
Right-to-left evaluation
Programming by side effects
Code is data
The Global Context
Coding REBOL like COBOL
IDENTIFICATION DIVISION
ENVIRONMENT DIVISION
FILE SECTION
WORKING-STORAGE SECTION
SCREEN SECTION
PROCEDURE DIVISION
COPY statement
Printing
Your own mezzanine
Module testers
Module documentation idea
Program structure suggestion
List of all code samples

Some useful equivalencies
ACCEPT
ADD
COMPUTE
DISPLAY
DIVIDE
EXIT
INSPECT
MOVE
MULTIPLY
IF
OCCURS
PERFORM
READ
REMAINDER
ROUNDED
SEARCH
SET
TODAYS-DATE
TIME
VALUE

What's in your head, Boy?
Introduction
Similar but not the same
Colon is not assignment
Be careful defining
A shorter letter
On punctuation
Why so dense?

Doing COBOLish things
Fixed-format file

Sample applications
Introduction
Source code as corporate asset
NACHA list
Introduction
Global services modules
Start writing

DISPLAY

Date written: March 20, 2013
Date revised:
Date reviewed:

This page explains some REBOL equivalents of DISPLAY.


COBOL DISPLAY

The DISPLAY verb is for low-volume output to some sort of operator display terminal. When COBOL was invented, this probably would have been a typewrite-like device in a sealed computer room.

ACCEPT { identifier-1 }
       { literal-1    } ...
Notice the three dots. That means that you can display several items and they will be strung together. For example,
77  TEST-VAL PIC X(10) VALUE "OFF-LINE"
...
DISPLAY "THE VALUE OF TEST-VAL IS " TEST-VAL

The REBOL equivalent

The closest REBOL command to DISPLAY is "print." For example:

print { identifier-1 }
      { literal-1    }
The identifier-1 can be any word in your program. The literal-1 can be a literal just like COBOL. If you want to print several things strung together, the identified-1 can refer to a block. For example:
TEST-VAL: "OFF-LINE"
print ["THE VALUE OF TEST-VAL IS" TEST-VAL]

There are other ways to display stuff in REBOL. The "print" function is just the way that is closest to the DISPLAY verb. Other output methods will be shown when appropriate in other examples elsewhere.