home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #5 / Amiga Plus CD - 2000 - No. 5.iso / Tools / Dev / fpc / source / docs / refex / ex95.pp < prev    next >
Encoding:
Text File  |  2000-01-01  |  733 b   |  33 lines

  1. Program Example95;
  2.  
  3. { Program to demonstrate the SetResourceStrings function. }
  4. {$Mode objfpc}
  5.  
  6. ResourceString
  7.  
  8.   First  = 'First string';
  9.   Second = 'Second String';
  10.  
  11. Var I,J : Longint;
  12.     S : AnsiString;
  13.     
  14. Function Translate (Name,Value : AnsiString; Hash : longint): AnsiString;    
  15.  
  16. begin
  17.   Writeln ('Translate (',Name,') => ',Value);
  18.   Write   ('->');
  19.   Readln  (Result); 
  20. end; 
  21.     
  22. begin
  23.   SetResourceStrings(@Translate);  
  24.   Writeln ('Translated strings : ');    
  25.   For I:=0 to ResourceStringTableCount-1 do
  26.     For J:=0 to ResourceStringCount(i)-1 do
  27.       begin
  28.       Writeln (GetResourceStringDefaultValue(I,J));
  29.       Writeln ('Translates to : ');
  30.       Writeln (GetResourceStringCurrentValue(I,J));
  31.       end;
  32. end.
  33.