REBOL for COBOL programmers

Go to table of contents Go to feedback page

MOVE

Date written: October 10, 2012
Date revised:
Date reviewed:

This page explains the REBOL equivalent of MOVE.


COBOL MOVE

Moving data around is a basic operation.

MOVE identifier-1 TO identifier-2.
The paradigm in your head here is that identifier-1 refers to the memory address of some string of bytes, as does identifier-2, and the contents of memory at identifier-1 is copied to the memory area pointed to by identifier-2.

The REBOL equivalent

The paradigm is different in REBOL, with words having values. When you have had some REBOL experience, you should reread some of the introductory material from the REBOL web site, about words. For now, as a beginner, it is safe to use a paradigm similar to the COBOL one, as long as you realize that there are unappreciated subtleties. So in REBOL you can say

identifier-2: identifier-1
and believe that the value of identifier-1 is the same as the value of identifier-1. Do they refer to the same memory? Does the value exist in two places? I actually don't know. You could ignore the issue for now. There is one well-known place where the subtleties of the REBOL way will catch you, but for now you can think of the above as being roughly the same as the COBOL way.