Delphi Clinic C++Builder Gate Training & Consultancy Delphi Notes Weblog Dr.Bob's Webshop
Bob Swart (aka Drs.Bob) Dr.Bob's Delphi Clinics Dr.Bob's Delphi Courseware Manuals
View Bob Swart's profile on LinkedIn Drs.Bob's Delphi Notes
These are the voyages using Delphi Enterprise (and Architect). Its mission: to explore strange, new worlds. To design and build new applications. To boldly go...

How to get rid of an annoying warning...

Author: Bob Swart
Posted: 2/22/2006 7:47:35 PM (GMT+1)

Since Delphi now supports WideString and WideChar characters by default, there's a warning which just annoys me every time I get it: the "WideChar reduced to byte char in set expression".
For example in the following code snippet:

S: String;
if S[1] in ['0'..'9'] then ...
I've looked at a number of ways to get rid of the warning (feel free to let me know, thanks in advance), but so far the only way I found was to uncheck the "WideChar reduced to byte char in set expression" warning in the Project Options | Compiler Messages dialog:

Note that I've also checked the default option, so I will never see this warning again!

If anyone knows a better way to remove the warning - preferably by fixing the code, I would welcome a hint.



JB06/02/22 21:43:33if AnsiChar(S[1]) in ['0'..'9'] then ...
Bob Swart06/02/22 22:35:10Duh! I thought I had tried that already... Thanks!
Anon06/02/24 13:05:22"Since Delphi now supports WideString and WideChar characters by default" How? I wasn't aware of this.

New Comment (max. 2048 characters, no HTML):


This webpage © 2005-2017 by Bob Swart (aka Dr.Bob - All Rights Reserved.