Information Technology Reference
In-Depth Information
character
will fill the trailing positions with spaces if needed.
This same consideration will apply with assignment statements. Using
soc-sec-no
and
x
as defined above, the statement
x = 3
will result in
x
being 00003 inside the computer, while
soc-sec-no = “111111”
will result in
soc-sec-no
being 111111 , that is, six 1's followed by three spaces. Note that assignment
statements involving
character
fields need the quote marks while those dealing with numeric fields will not use them.
We could eliminate the
value
keyword and accomplish the same result by using a single assign statement. All we have
to do is utilize a group of assign lines just after the last
define
keyword, one for each
value
occurrence. Since we do have the
value
keyword, we have the option of giving a field a value in one of two ways. One is
initialization and the other an assignment statement, which often changes the value.
Since this concept is so important in programming, let us consider a few more
examples. Assume the following
define x character (6) value “Handel”
define y character (4)
If the following line is executed,
y = x
x
will still have the value
Handel
but
y
will have the value
Hand ,
Search WWH ::




Custom Search