DelphiFAQ Home Search:

resourcestring replaces LoadStr()


commentsThis article has not been rated yet. After reading, feel free to leave comments and rate it.

Delphi 3 introduced the possiblity to easily place constant strings as
a resource with the new keyword 'resourcestring'.

If you want to write code that compiles both with Delphi 2 and 3 because you
are publishing a component, take a look at this sample code:

// this is code for Delphi 1/ 2.
// It uses LoadStr to access resource strings
  raise SomeException.Create(LoadStr(SInsertLineError));

// this uses VER100 to detect if Delphi 3.x is used.
   raise SomeException.Create(
         {$IFNDEF VER100}LoadStr{$ENDIF}
// from Stefan Hoffmeister


2008-02-04, 14:11:25
anonymous from Slovak Republic  
fuck your google ads



NEW: Optional: Register   Login
Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option, or post under a registered account.

Show city and country
Show country only
Hide my location
You can mark text as 'quoted' by putting [quote] .. [/quote] around it.
Please type in the code:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity.
The owner of this web site reserves the right to delete such material.

photo Add a picture: