DECLARE_CHARACTER_DYN

Declare a CHARACTER variable

Description:

Declare a CHARACTER variable that will be passed to a FORTRAN routine using the CHARACTER_ARG macro. Use this macro, in combination with the F77_CREATE_CHARACTER and F77_FREE_CHARACTER macros, where the length of the CHARACTER string is not known until run time.

Invocation

DECLARE_CHARACTER_DYN(arg)

Arguments

arg
The variable being declared.

Examples:

DECLARE_CHARACTER_DYN(fstring)
will expand as follows:
All Unix: char *fstring; int fstring_length
VAX/VMS: char *fstring; int fstring_length
struct dsc$descriptor_s *fstring_arg

Notes:

On VMS, the expansion of the macro is quite complex. A pointer to a descriptor structure is declared in addition to a pointer to char (used to point to the actual string of characters) and an int variable to store the length of the array. The address of the descriptor is what is actually passed to the called FORTRAN routine.