Watch Out for Set of Char

I've already mentioned that you cannot declare a set of Char any more, at least not with the meaning this had in past versions of Delphi, that is having a set including all of the possible characters. As covered in the previous chapter, the compiler will assume you are porting existing code to Delphi 2009 and decide to consider your set of Char declaration as though it was a set of AnsiChar, issuing a warning. Some of your existing code dealing with this construct will fail though.

You can see an example of this warning (and the explicit cast used to remove it) in the CharTest example of Chapter 2. The real issue in this case is that there is no way to define a set of all characters any more, or to express the inclusion of a character in a set with this way of coding. You really have to change the code completely! Consider for example the simple code of the CharTest demo I've just mentioned:

Was this article helpful?

0 0
Project Management Made Easy

Project Management Made Easy

What you need to know about… Project Management Made Easy! Project management consists of more than just a large building project and can encompass small projects as well. No matter what the size of your project, you need to have some sort of project management. How you manage your project has everything to do with its outcome.

Get My Free Ebook

Post a comment