*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> f90/trimlen (3)              
Title
Content
Arch
Section
 

Contents


TRIMLEN(3F)					       Last changed: 3-3-97

NAME    [Toc]    [Back]

     TRIMLEN - Returns the length of a character argument without counting
     trailing blanks

SYNOPSIS    [Toc]    [Back]

     INTEGER trimlen
     intlen = TRIMLEN(string)

IMPLEMENTATION    [Toc]    [Back]

     UNICOS, UNICOS/mk,	and IRIX systems

DESCRIPTION    [Toc]    [Back]

     TRIMLEN is	an integer function that returns the length of a character
     argument without counting the trailing blanks.  The function must be
     declared as type integer in the calling routine.  The string argument
     must be of	type character.

     This function is intended for use as part of the substring	notation.
     Examples 2	and 3 show the TRIMLEN function	used in	this manner.  The
     value of each of the parts	of the substring notation must be as
     follows:

	  1 <= leftmostpos <= rightmostpos <= stringlength

     leftmostpos is the	leftmost character position in the substring,
     rightmostpos is the rightmost character position in the substring,	and
     stringlength is the declared length of the	character entity.  TRIMLEN
     returns a value of	1 for a	string of all blanks.

EXAMPLES    [Toc]    [Back]

     Example 1:	 A program using the function TRIMLEN could do the
     following:

	    INTEGER TRIMLEN
	    CHARACTER*80 STRING
	    STRING = ' '
	    STRING(20:47) = 'TEST TRIMLEN LENGTH RETURNED'
	    INTLEN = TRIMLEN(STRING)
	    WRITE(6,1) INTLEN, STRING(1:INTLEN)
	  1 FORMAT(' LENGTH=',I5,' STRING=',A,'-DONE')
	    PRINT 2,'12345678901234567890123456789012345678901234567890'
	  2 FORMAT(21X,A)
	    END

     The output	of the program is as follows:

      LENGTH=  47 STRING=		  TEST TRIMLEN LENGTH RETURNED-DONE
		       12345678901234567890123456789012345678901234567890

     Example 2:	 This example produces a string	with the character <
     written following the last	nonblank character of STRING:

	      WRITE(6,901)STRING(1:TRIMLEN(STRING))
	  901 FORMAT(' The string is >',A,'<')

     Example 3:	 In this example, although NEW may have	trailing blanks,
     the character < is	written	after the last nonblank	character in
     STRING:

	  NEW =	STRING(1:TRIMLEN(STRING)) // '<	The end'

SEE ALSO    [Toc]    [Back]

      
      
     Application Programmer's Library Reference	Manual,	publication SR2165,
 for the printed version of this man page.
TRIMLEN(3F)					       Last changed: 3-3-97

NAME    [Toc]    [Back]

     TRIMLEN - Returns the length of a character argument without counting
     trailing blanks

SYNOPSIS    [Toc]    [Back]

     INTEGER trimlen
     intlen = TRIMLEN(string)

IMPLEMENTATION    [Toc]    [Back]

     UNICOS, UNICOS/mk,	and IRIX systems

DESCRIPTION    [Toc]    [Back]

     TRIMLEN is	an integer function that returns the length of a character
     argument without counting the trailing blanks.  The function must be
     declared as type integer in the calling routine.  The string argument
     must be of	type character.

     This function is intended for use as part of the substring	notation.
     Examples 2	and 3 show the TRIMLEN function	used in	this manner.  The
     value of each of the parts	of the substring notation must be as
     follows:

	  1 <= leftmostpos <= rightmostpos <= stringlength

     leftmostpos is the	leftmost character position in the substring,
     rightmostpos is the rightmost character position in the substring,	and
     stringlength is the declared length of the	character entity.  TRIMLEN
     returns a value of	1 for a	string of all blanks.

EXAMPLES    [Toc]    [Back]

     Example 1:	 A program using the function TRIMLEN could do the
     following:

	    INTEGER TRIMLEN
	    CHARACTER*80 STRING
	    STRING = ' '
	    STRING(20:47) = 'TEST TRIMLEN LENGTH RETURNED'
	    INTLEN = TRIMLEN(STRING)
	    WRITE(6,1) INTLEN, STRING(1:INTLEN)
	  1 FORMAT(' LENGTH=',I5,' STRING=',A,'-DONE')
	    PRINT 2,'12345678901234567890123456789012345678901234567890'
	  2 FORMAT(21X,A)
	    END

     The output	of the program is as follows:

      LENGTH=  47 STRING=		  TEST TRIMLEN LENGTH RETURNED-DONE
		       12345678901234567890123456789012345678901234567890

     Example 2:	 This example produces a string	with the character <
     written following the last	nonblank character of STRING:

	      WRITE(6,901)STRING(1:TRIMLEN(STRING))
	  901 FORMAT(' The string is >',A,'<')

     Example 3:	 In this example, although NEW may have	trailing blanks,
     the character < is	written	after the last nonblank	character in
     STRING:

	  NEW =	STRING(1:TRIMLEN(STRING)) // '<	The end'

SEE ALSO    [Toc]    [Back]

      
      
     Application Programmer's Library Reference	Manual,	publication SR2165,
 for the printed version of this man page.
[ Back ]
 Similar pages
Name OS Title
len_trim IRIX Returns the length of the character argument without counting trailing blank characters
trim IRIX Returns the character argument with trailing blank characters removed
pxfgetarg IRIX Returns a command-line argument
tiny IRIX Returns the smallest positive value for a real argument
ceiling IRIX Returns the least integer greater than or equal to its argument
XmClipboardInquireLength HP-UX A clipboard function that returns the length of the stored data
XmClipboardInquireLength IRIX A clipboard function that returns the length of the stored data
XmClipboardInquireLength Tru64 A clipboard function that returns the length of the stored data
spacing IRIX Returns the absolute spacing of real model numbers near the argument value
fraction IRIX Returns the fractional part of the numeric model representation of the argument value
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service