BCX Console Demonstration Program s123.bas |
' Shows how BCX can use "C" functions directly $HEADER char * Remove_All_White_Space(char *); $HEADER DIM a$ DIM b$ a$ = " this is a test " b$ = Remove_All_White_Space(a$) PRINT b$ END PROGRAM ! char* Remove_All_White_Space(char* str1) ! { ! char *obuf,*nbuf; ! if (str1) ! { ! for (obuf=str1,nbuf=str1;*obuf;++obuf) ! { ! if (!isspace(*obuf)) ! *nbuf++=*obuf; ! } ! *nbuf=0; ! } ! RETURN str1; ! }