/* Parse the user parameter (always first param) from a string. */ /* This will handle #'s, Single Word Names and Quoted Names!!!! */ /* Return value is result of check_user or zero if no user */ parseuser(RawStr[],UserStr[],MsgStr[]) { new i=0; new rc; // Try based on " if( '^"'==RawStr[0]) { i=1; while('^"'!=RawStr[i]) i++; strnsplit(UserStr,RawStr,1,i-1); UserStr[i-1]=0; i++; rc=check_user(UserStr); } else { // Try based on space while(RawStr[i]!=' ') i++; strncpy(UserStr,RawStr,i); UserStr[i+1]=0; rc=check_user(UserStr); } if(rc>0) { strncpy(MsgStr,RawStr[i+1],strlen(RawStr)-i-1); MsgStr[strlen(RawStr)-i-1]=0; } return rc; }