原代码:
if not (Key in ['0'..'9', #8]) then
begin
MessageBeep(0);
end;
编译提示:
W1050 WideChar reduced to byte char in set expressions. Consider using 'CharInSet' function in 'SysUtils' unit.
解决方法:
if not CharInSet(Key, ['0'..'9', #8]) then
begin
MessageBeep(0);
end;
本文介绍了如何解决在编程中遇到的W1050编译错误,即宽字符被转换为字节字符,推荐使用`CharInSet`函数并给出了解决后的代码示例。
505

被折叠的 条评论
为什么被折叠?



