next up previous contents
Next: COMMON statements Up: Subprograms Previous: PROGRAM statements

CHARACTER Constants as Arguments

We have already seen that arguments may be arrays, variables or constants and that the called and calling routines must be consistant in type of data. One complication with FORTRAN 77 is that characters may be held in reals and integer variables as well as character variables, so what type of data is a character constant in a calling argument list? e.g.

X=CALC(3.0,'+',7.2)
FORTRAN assumes that the calling routine will treat it as character data but when the routines are combined in the LINK program this assumption is checked. If incorrect LINK adjusts the call to pass the data as a real or integer instead.



n west (APC)
2000-03-08