home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1994 #1
/
monster.zip
/
monster
/
PROG_GEN
/
EDSV4064.ZIP
/
EPP-V1_1.ZIP
/
CSKIPNON.E
< prev
next >
Wrap
Text File
|
1993-06-26
|
1KB
|
34 lines
OPT TURBO
PROC cSkipNonWhite (pos : PTR TO CHAR)
/*----------------------------------------------------------------------*/
/* pos must point into a null-terminated string! */
/* pos must be passed by value! */
/* pos must not point beyond the end of the string when it's passed in! */
/* */
/* Skips SPACE, TAB, LF, CR. Returns end pos so that the following */
/* statement sequence can be used in the calling program: */
/* length := (cSkipNonWhite (startPos) - startPos) */
/* MidStr (someString, startPos, 0, length) */
/* */
/* If you use the string with index method in your main program, you */
/* can get the PTR TO CHAR pos by using: */
/* length := (cSkipNonWhite (string + index) - (string + index)) */
/* MidStr (someString, string, index, length) */
/*----------------------------------------------------------------------*/
DEF c
WHILE (c := pos [])
SELECT c
CASE 32; RETURN pos /* SPACE */
CASE 9; RETURN pos /* TAB */
CASE 10; RETURN pos /* LF */
CASE 13; RETURN pos /* CR */
DEFAULT; INC pos
ENDSELECT
ENDWHILE
ENDPROC pos
/* cSkipNonWhite */