There are four kinds of assignment statements:
v = e
Execution of an arithmetic assignment statement causes the evaluation of the expression e by the rules in Section 6, conversion of e to the type of v , and definition and assignment of v with the resulting value, as established by the rules in Table 4.
_________________ __________ | | | | Type of v | Value | |_________________|__Assigned| | | | | Integer | INT(e) | |_________________|__________| | | | |_Real____________|__REAL(e)_| | | | | Double precision| DBLE(e) | |_________________|__________| | | | |_Complex_________|__CMPLX(e)|
The functions in the "Value Assigned" column of Table 4 are generic functions described in Table 5 ( 15.10).
v = e
Execution of a logical assignment statement causes the evaluation of the logical expression e and the assignment and definition of v with the value of e . Note that e must have a value of either true or false.
ASSIGN s TO i
Execution of an ASSIGN statement causes the statement label s to be assigned to the integer variable i . The statement label must be the label of a statement that appears in the same program unit as the ASSIGN statement. The statement label must be the label of an executable statement or a FORMAT statement.
Execution of a statement label assignment statement is the only way that a variable may be defined with a statement label value.
A variable must be defined with a statement label value when referenced in an assigned GO TO statement ( 11.3) or as a format identifier ( 12.4) in an input/output statement. While defined with a statement label value, the variable must not be referenced in any other way.
An integer variable defined with a statement label value may be redefined with the same or a different statement label value or an integer value.
v = e
Execution of a character assignment statement causes the evaluation of the expression e and the assignment and definition of v with the value of e . None of the character positions being defined in v may be referenced in e . v and e may have different lengths. If the length of v is greater than the length of e , the effect is as though e were extended to the right with blank characters until it is the same length as v and then assigned. If the length of v is less than the length of e , the effect is as though e were truncated from the right until it is the same length as v and then assigned.
Only as much of the value of e must be defined as is needed to define v . In the example:
the assignment A=B requires that the substring B(1:2) be defined. It does not require that the substring B(3:4) be defined.
If v is a substring, e is assigned only to the substring. The definition status of substrings not specified by v is unchanged.
NDP77
http://www.ndp77.net
webmaster MFA (main)
webmaster@ndp77.net