On Mon, Sep 6, 2010 at 4:53 AM, Angus Robertson - Magenta Systems Ltd <an...@magsys.co.uk> wrote: >> But my suggestion has absolutely *nothing* to do with enabling ICS >> users to magically be able able to use ICS with future versions of >> Delphi. > > Wrong, that is exactly what you said in the root message, that version > checks should be ignored for unknown new compilers.
I never said that version checks *should* be ignored for new compilers. I was complaining about the incorrect version detection, because compiling my D2010 copy of ICS in Delphi XE stopped on the line: Bomb('This component requires Delphi 7 or later'); Since Delphi XE *is* later than Delphi 7, this bugs me. If the code wants to stop on a line that says my version of Delphi is not supported by ICS, that would be an accurate message. I went on to describe alternative techniques for version detection, including the technique used in Raize Components. That technique does assume an "unknown" version of Delphi was compatible with the last version "known" by the component's code. That technique was shot down pretty quickly, and I was even insulted in the process. However, my next suggestion was to add a "highest version" check, like the current "lowest version" check, that would still prevent the ICS code from compiling on unsupported versions of Delphi while providing an accurate error message to the user. My apologies for implying that I felt _ICS_ should "just compile" in future versions of Delphi. That was not my intent, but I can see now how my initial discussion implied that it was. My pet peeve, and the reason for the post (re: subject line), was that the Delphi version detection is inaccurate (refer to the error above) and requires adding an excessive number of new lines to the include file to add new Delphi versions to the detection mechanism. > Your suggestion to shorten the include file with CompilerVersion >= 22.0 > has exactly the same problem. My suggestion to use CompilerVersion >= 22.0 was to suggest a better "highest version detected" method than an error that says "requires Delphi 7 or later". What "exactly the same problem" are you referring to? > I believe you will also find that expressions were not allowed in > conditionals for many early Delphi releases, so your code is not backward > compatible. Conditional Expressions were added in Delphi 6. ICS v7 only supports Delphi 7 and above. Why can't ICS use CompilerVersion? I believe the checks below would provide better, more accurate version detection. {$IFNDEF CONDITIONALEXPRESSIONS} Bomb('This component requires Delphi 7 or later'); {$ENDIF} {$IF CompilerVersion < 15.0} Bomb('This component requires Delphi 7 or later'); {$IFEND} {$IF CompilerVersion >= 22.0} {$Message Fatal 'Your version of Delphi is not yet supported by ICS.'} {$IFEND} In addition, COMPILER7_UP would always be defined for newer versions of the compiler, without adding additional code to the include file. The last version check above would stop the compile if the user's version was not supported. But why do the COMPILER??_UP, DELPHI??_UP, and BCB??_UP constants have to be $DEFINED so many times in the include file? It really shouldn't take 53 lines of new code to detect a new version of the compiler. Jon -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be