Debian Codegraph @

packages/seacas/libraries/suplib/lenstr.f

raw
1 C Copyright(C) 1999-2020 National Technology & Engineering Solutions
2 C of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
3 C NTESS, the U.S. Government retains certain rights in this software.
4 C
5 C See packages/seacas/LICENSE for details
6
7 C=======================================================================
8 INTEGER FUNCTION LENSTR (STRING)
9 C=======================================================================
10
11 C --*** LENSTR *** (STRLIB) Return string length
12 C --
13 C --LENSTR returns the length of a passed string. There can be blanks
14 C --embedded within the string. To prevent problems, an empty string
15 C --is returned with a length of 1.
16 C --
17 C --Parameters:
18 C -- STRING - IN - the string to find the length of
19
20 CHARACTER*(*) STRING
21
22 LENSTR = LEN(STRING)
23 IF (STRING(LENSTR:LENSTR) .EQ. ' ') THEN
24 N = INDEX (STRING, ' ')
25 10 CONTINUE
26 IF (STRING(N:) .NE. ' ') THEN
27 N = N + INDEX (STRING(N+1:), ' ')
28 GOTO 10
29 END IF
30 LENSTR = MAX (1, N-1)
31 END IF
32
33 RETURN
34 END