home *** CD-ROM | disk | FTP | other *** search
/ World of A1200 / World_Of_A1200.iso / programs / disk / backup_utils / fill / pmodules / skipwhite.e < prev    next >
Text File  |  1995-02-27  |  818b  |  23 lines

  1. PROC skipWhite (theString,  /* PTR TO STRING */
  2.                 startPos)   /* Char index into theString, passed by value */
  3.   DEF endPos, length
  4.  
  5.   /* Skips 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] = " ") OR
  16.          (theString [endPos] = 9) OR   /* TAB */
  17.          (theString [endPos] = 10) OR  /* LF */
  18.          (theString [endPos] = 13))    /* CR */ DO INC endPos
  19.  
  20. ENDPROC  endPos
  21.   /* skipWhite */
  22.  
  23.