Previous: Fortran Calling Sequence Up: Fortran Calling Sequence Next: Fortran Data Types

Character Strings

Most RTL routines take characters strings as arguments. They appear in parameter names, keywords, messages, and many other places. Under the old RTL, strings could be passed in either of two ways: as Fortran CHARACTER*n variables, or as BYTE or LOGICAL*1 arrays. The array method will no longer work.

All Fortran-callable RTL routines now accept character strings only in Fortran CHARACTER*n format, which is the standard way of doing strings in Fortran. CHARACTER*n variables and constants have a length associated with them (the ``n''), which the RTL uses to find the end of the string, and to make sure that buffer overflow does not occur on output strings. Byte arrays will not work, since there is no Fortran string length information, thus no standard way for the RTL to find the end of the string. Also, arrays of CHARACTER*1 will not work - the RTL will think the string being passed in is one character long.

This change will be most apparent in the qprint and xvmessage routines, which are often passed byte arrays in the current code. This will not work. Use the new SUBLIB routines mvcl or mvlc to convert between byte arrays and CHARACTER*n variables. A better approach (and highly recommended) is to change the program to use CHARACTER*n throughout. Output formatting is actually much easier with CHARACTER*n variables. See Section , READ & WRITE to Strings, for details.