home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 2: PC / frozenfish_august_1995.bin / bbs / d09xx / d0904.lha / Fill / PModules / skipNonWhite.e < prev    next >
Text File  |  1993-08-26  |  835b  |  23 lines

  1. PROC skipNonWhite (theString,  /* PTR TO STRING */
  2.                    startPos)   /* Char index into theString, passed by value */
  3.   DEF endPos, length
  4.  
  5.   /* Stops at SPACE, TAB, LF, CR.  Returns endPos so that                 */
  6.   /* MidStr (someString, theString, startPos, (endPos - startPos)) can be */
  7.   /* used in the calling program.                                         */
  8.   /* Return of -1 indicates access beyond end of string.                  */
  9.  
  10.   length := StrLen (theString)
  11.   IF startPos >= length THEN RETURN startPos
  12.  
  13.   endPos := startPos
  14.   WHILE (endPos < length) AND
  15.         ((theString [endPos] <> " ") AND
  16.          (theString [endPos] <> 9) AND   /* TAB */
  17.          (theString [endPos] <> 10) AND  /* LF */
  18.          (theString [endPos] <> 13))     /* CR */ DO INC endPos
  19.  
  20. ENDPROC  endPos
  21.   /* skipNonWhite */
  22.  
  23.