Delphi 3 Migration

D3 LoadStr constants

From: Stefan.Hoffmeister@UNI-Passau.DE (Stefan Hoffmeister) Have you been politically correct and raised exceptions with Borland supplied text from CONSTS.PAS in Delphi 1 or Delphi 2? For instance:

   raise SomeException.Create(LoadStr(SInsertLineError));
This will no longer work. My suggested change is to use
   raise SomeException.Create(
         {$IFNDEF VER100}LoadStr{$ENDIF}
                              (SInsertLineError)); 

which conditional on being compiled with Delphi 3 leaves out the "LoadStr" which seems to have become obsolete *for this purpose* now.

In general all code making use of the constants declared in CONSTS(.PAS/.DCU) will cause a compiler error: "Incompatible types: 'Integer' and 'String'"

I have not found anything in Borland's printed or online documentation to this effect.


Please email me and tell me if you liked this page.

This page has been created with HomeSite 2.5b