The following code fragment will cause a "constant and case type do not match" error as indicated (it's been extracted from a utf8keypress event):
var UTF8Key: TUTF8Char;
begin
case UTF8Key of
'1': (*do something*);
'2': (*do something else*);
(*and so on until the next line*)
DefaultFormatSettings.DecimalSeparator: (*do something crazy*); //ERROR
end;
I've tried type casting as both TUTF8Char and string but it still cause problems.
The only option I've found is to add an else clause to handle the DecimalSeparator in a comparison:
if UTF8Key = DefaultFormatSettings.DecimalSeparator
then (*do something crazy*)
which works fine. I'm really just trying to make my program a bit more versatile without having to go into learning all the details of codepages etc (for now). I'd like to use ThousandSeparator too and maybe others so really would like to just use the case statement without extra conditionals for this (especially in something called every key press).