optest = getRecordHead("u_OperatorName") repeat // Start assuming we're good, in each repeat of this loop. checkStr = true // Loop through the character array (string) character by character // - logical AND between true and the result of isAlphaNumeric on the current character // - if it's ever false, there's an invalid character, ask for input for chr_index = 1 to len(optest) checkStr = checkStr and getParameterNamed("optest", chr_index).isAlphaNumeric next chr_index if len(optest) == 0 then checkStr = false endif // If an invalid character was found, prompt for input. Could also be: checkStr == false if not checkStr then message("Operator Name Invalid.") optest = inquireText("Please enter your Stamp ID. Ex: M000") setRecordHead("u_OperatorName", optest) // If no input was given, cancel run completely. (Also break out of possibly infinite loop.) if (len(optest) == 0) or (optest == "") then message("Input not entered. Cancelling run.") cncBreak() endif endif until checkStr