SUBROUTINE ST_NULL ( string, outstr, lens, iret ) C************************************************************************ C* ST_NULL * C* * C* This subroutine appends a NULL character to the end of a string. * C* The input and output strings may be the same variable. * C* If the string's length is equal to its dimensioned length, the last * C* character will be replaced by the NULL character. * C* The output length of the string does not include trailing blanks, * C* tabs, or nulls. * C* * C* ST_NULL ( STRING, OUTSTR, LENS, IRET ) * C* * C* Input parameters: * C* STRING CHAR* String * C* * C* Output parameters: * C* OUTSTR CHAR* String without blanks * C* LENS INTEGER Length of output string * C* IRET INTEGER Return code * C* 0 = normal return * C** * C* Log: * C* K. Tyle/GSC 12/96 Based on ST_LSTR * C* K. Brill/EMC 11/98 Rewrote; use ST_LSTR * C************************************************************************ C* CHARACTER*(*) string, outstr C* CHARACTER ttt*256 C----------------------------------------------------------------------- iret = 0 ttt = string C C* Get the actual length of the output string. C lenout = LEN ( outstr ) IF ( lenout .eq. 0 ) THEN outstr = ttt lens = lenout RETURN END IF CALL ST_LSTR ( ttt, lng, ier ) IF ( lng .eq. lenout ) THEN outstr = ttt lens = lng RETURN END IF lens = lng + 1 outstr = ttt outstr (lens:lens) = CHAR (0) C* RETURN END