FORTRAN Reference Manual
Statements
FORTRAN Reference Manual—528615-001
7-7
Assignment Statement
Example
The following example defines and references the statement function NETPAY to
calculate the net pay of each employee:
REAL netpay, salary, tax, insure
netpay(salary,tax,insure) = salary-(tax*salary)-insure
DO 5 j = 1,n
READ (*,*) employee, s, t, x
salary = netpay(s,t,x)
WRITE (*,*) employee, salary
5 CONTINUE
Assignment Statement
An assignment statement defines the value of an arithmetic, character, or logical entity.
name
is the name of a variable, array element, substring, RECORD, RECORD field,
RECORD array element, or RECORD substring.
arithmetic-expression
is an arithmetic expression.
character-expression
is a character expression.
logical-expression
is a logical expression.
Considerations
•
Arithmetic assignment statement
When your program executes an assignment statement, FORTRAN evaluates
arithmetic-expression according to the rules described in Section 3,
Expressions. It then converts arithmetic-expression to the type of name, and
stores the value of arithmetic-expression in name. If name is too small to
name =
arithmetic ressionexp–
character ressionexp–
logical-expression
°°°°










