REBOL for COBOL programmers
Date written: March 19, 2013
This page explains some REBOL equivalents of COMPUTE.
The COMPUTE statement allows for more involved calculations.
COMPUTE identifier-1 = arethmetic-expression-1.For example,
COMPUTE d = ((b ** 2) - ( 4 * a * c)) / (2 * a)
The REBOL equivalent
REBOL is very similar in this area. There is no official equivalent function for COMPUTE, but you can just put an expresseion where needed. For example:
print d: ((b ** 2) - ( 4 * a * c)) / (2 * a)This will set "d" to the indicated value, and then print it, all in one statement.