function lnblk(string,nchar) c c======================================================================= c === c This function returns the character position of the last non- === c blank character in STRING. The value NCHAR tells LNBLK where === c to start the search for the last non-blank character. === c === c======================================================================= c c----------------------------------------------------------------------- c Define local data. c----------------------------------------------------------------------- c integer i,ic,istart,nchar integer lnblk character*(*) string c c----------------------------------------------------------------------- c Begin executable code. c----------------------------------------------------------------------- c c Strip leading blank characters. c ic=0 do 10 i=1,nchar if(string(i:i).eq.' ') then ic=ic+1 else goto 20 endif 10 continue 20 istart=ic+1 if(istart.lt.nchar) string=string(istart:nchar) c c Strip trailing blank character and determine the its length. c do 30 i=nchar,1,-1 if(string(i:i).ne.' ') goto 40 30 continue lnblk=0 return 40 lnblk=i return end