there are many ways to skin a cat, so here is one of them:
//loop around and check for an invalid character in a string
//valid ASCII characters are 0-9, A-Z and a-z
//decimal character codes are: 48-57, 65-90 and 97-122 respectively
//get the string length to check
nInvalidCharFound=0; //set true if we find an invalid char so we can bail asap
nIndex=0; //counter so we can loop through
nChar=0; //character at nIndex position
nChar=GetNthCharacter(sStringToCheck,nIndex); //get the character at index number
IncrementVariable(nIndex); //increment the index
//check to see if all 3 statements are valid. if the char is not within the limits specified then its invalid.
//add more as you see fit, even make the statics variables!!
nInvalidCharFound=nIndex-1; //set the invalidchar variable to the position it was found
until ((nInvalidCharFound<>0) or (nIndex==nStringLength)); //bail if we get an invalid char found or we have reached the end of the string
sStringToCheck is the string you want to check and nInvalidCharFound is the position the invalid char was found. If this variable is 0 after the code block then no invalid characters were found.
you can add other character ranges if you like or extend the ones that are there.
Hmmm, looks like some good code to enter in to the competition!!
I hope this helps