It sounds like you are trying to parse a command line. Perhaps the attached code's split function will help. You pass in a string, a delimiter, and an array to fill. It chops up the string wherever it finds the delimiter putting the vales in the array. [warning, it emptys the array first].