Mat Assignment (Scalar Value) - IBM 5100 Basic Reference Manual

Hide thumbs Also See for 5100:
Table of Contents

Advertisement

114
MAT array-name [(rows [,columns) )) = (scalar-exp)
MAT ASSIGNMENT (SCALAR VALUE)
This statement allows you to assign a specified scalar value to each element of an
array. The syntax of this statement is as shown:
MAT array-name [(rows [,columns) ))
=
(scalar-exp)
where:
array-name
is the name of the arr,ay that receives the values.
rows, columns
are the redimension specifications of the array (see
Redimensioning
Arrays).
scalar-exp
is the value to be assigned.
When this statement is executed, the parenthesized scalar expression is evaluated
and each element in the named array is set to that value.
If redimension specifications are included, the truncated integer portion of each
expression in rows, columns is used to redimension the array before the scalar value
is evaluated and assigned to each of the array elements.
For character arrays, if the expression is less than 18 characters, it is padded on the
right with blanks to a length of 18 before being assigned. If there are more than 18
characters in the expression, only the leftmost 18 characters are assigned to the
array elements.
Notes About MAT (Scalar)
• The scalar expression to the right of the equal sign must be of the same type
(arithmetic or character) as the array to which it is assigned.
• If redimension specifications follow the array name, the rules as stated under
Redimensioning Arrays
in Chapter 3 must be followed.
/
/

Advertisement

Table of Contents
loading

Table of Contents