REBOL for COBOL programmers

Go to table of contents Go to feedback page

ACCEPT

Date written: November 6, 2012
Date revised: March 18, 2013
Date reviewed: March 18, 2013

This page explains some REBOL equivalents of ACCEPT.


COBOL ACCEPT

COBOL comes from the days of the text interface, so the main way of entering operator input is the ACCEPT statement.

ACCEPT identifier-1 
There also are variants to ACCEPT identifier-1FROM something. What you get is the text entered by the operator.

The REBOL equivalent

The closest REBOL command to ACCEPT is "ask." For example:

OPERATOR-INPUT: ask "Enter operator input"

However, there are a number of other ways of getting such data. There also are ways of getting yes-or-no style answers other than asking for "yes" or "no." Rather than listing them here, we have a link below to a sample program that demonstrates all of them. The samples are not exhaustive because some of the options are not clearly documented. All the samples do work, however. You can view the sample program to see how to code the various functions.

Code samples

Left-clicking a link below will give a result that will depend on your computer, your browser, and maybe in whether or not you have REBOL installed. You should get either a new window with the code displayed, or a dialog box for saving the file on your own computer, or "opening" the file which makes no sense in this situation. Right-clicking should give you a menu from which you can save it to your own computer.

Operator entry samples

This sample program demonstrates basic forms of most of the ways of getting operator input into a program. It does not show the use of windows; that is another topic.