GetNext checks the first character of the string (and only the first character), and uses that to determine which code path to take. The "validation" is just a
default: case which throws an exception. The "valid" cases are
'\0' or
'F' (for "" or omitted, F, Focus, Focused) and
'C' (for C, Check, Checked), but anything starting with 'F' or 'C' is also accepted.
It looks like the parameter number in the error message was fixed by commit ea70dd783 (v2.0-a124).
Currently, built-in functions and methods must manually convert parameters from a generic "variant" type to whatever is needed, performing validation explicitly because the conversion functions aren't equipped to throw script errors. If no explicit validation is performed for an integer parameter, a value like "invalid" is treated as 0, and "1invalid" as 1.
I have not proactively added validation to all numeric parameters because 1) in theory, it's tedious work which increases code size, and 2) I intend to eventually change the implementation so that built-in functions are more like C functions plus meta-data, with parameter conversion and validation performed by some common code based on the meta-data. However, I would likely accept a pull request which cleanly adds basic validation to all numeric parameters currently lacking it. (One can compare various functions, looking out for macros like ParamIndexToInt, ParamIndexIsNumber, Throw_if_Param_NaN, _o_throw_param, etc.)
As I was already looking at the code, I've
added validation to GetNext.