[1677] | 1 | FUNCTION nextch (cdstr, kistr, knstr) |
---|
| 2 | C**** |
---|
| 3 | C ****************************** |
---|
| 4 | C * OASIS FUNCTION - LEVEL T * |
---|
| 5 | C * -------------- ------- * |
---|
| 6 | C ****************************** |
---|
| 7 | C |
---|
| 8 | C**** *nextch* - Search function |
---|
| 9 | C |
---|
| 10 | C Purpose: |
---|
| 11 | C ------- |
---|
| 12 | C Find the first non-blank in a character string |
---|
| 13 | C |
---|
| 14 | C** Interface: |
---|
| 15 | C --------- |
---|
| 16 | C *ii =* *nextch (cdstr, kistr, knstr)* |
---|
| 17 | C |
---|
| 18 | C Input: |
---|
| 19 | C ----- |
---|
| 20 | C cdstr : string to be searched (char string) |
---|
| 21 | C kistr : initial search position within the string (integer) |
---|
| 22 | C knstr : final search position within the string (integer) |
---|
| 23 | C |
---|
| 24 | C Output: |
---|
| 25 | C ------ |
---|
| 26 | C None |
---|
| 27 | C |
---|
| 28 | C Workspace: |
---|
| 29 | C --------- |
---|
| 30 | C None |
---|
| 31 | C |
---|
| 32 | C Externals: |
---|
| 33 | C --------- |
---|
| 34 | C None |
---|
| 35 | C |
---|
| 36 | C Reference: |
---|
| 37 | C --------- |
---|
| 38 | C See OASIS manual (1995) |
---|
| 39 | C |
---|
| 40 | C History: |
---|
| 41 | C ------- |
---|
| 42 | C Version Programmer Date Description |
---|
| 43 | C ------- ---------- ---- ----------- |
---|
| 44 | C 2.0 L. Terray 95/09/01 created |
---|
| 45 | C |
---|
| 46 | C %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 47 | C |
---|
| 48 | C* ---------------------------- Include files --------------------------- |
---|
| 49 | C |
---|
| 50 | USE mod_unit |
---|
| 51 | C |
---|
| 52 | C* ---------------------------- Argument declarations ------------------- |
---|
| 53 | C |
---|
| 54 | CHARACTER*1 cdstr |
---|
| 55 | DIMENSION cdstr(knstr) |
---|
| 56 | C |
---|
| 57 | C* ---------------------------- Local declarations ------------------- |
---|
| 58 | C |
---|
| 59 | CHARACTER (len=1), SAVE :: clblank = ' ' |
---|
| 60 | C |
---|
| 61 | C* ---------------------------- Poema verses ---------------------------- |
---|
| 62 | C |
---|
| 63 | C %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 64 | C |
---|
| 65 | C |
---|
| 66 | C* 1. Find the first non-blank character |
---|
| 67 | C ---------------------------------- |
---|
| 68 | C |
---|
| 69 | DO 110 ji = kistr, knstr |
---|
| 70 | idum = ji |
---|
| 71 | IF (cdstr(ji) .NE. clblank) GO TO 120 |
---|
| 72 | 110 CONTINUE |
---|
| 73 | 120 CONTINUE |
---|
| 74 | nextch = idum |
---|
| 75 | IF (idum .GE. knstr) nextch = -1 |
---|
| 76 | C |
---|
| 77 | C |
---|
| 78 | C* 2. End of function |
---|
| 79 | C --------------- |
---|
| 80 | C |
---|
| 81 | RETURN |
---|
| 82 | END |
---|