[fpc-pascal] How to know the string type of a variable?

Marcos Douglas md at delfire.net
Mon Dec 30 13:35:47 CET 2013


Hi,

Is possible to know what string type of a variable (AnsiString,
UTF8String, RawByteString, etc)?

Eg:

=== BEGIN ===
procedure foo(s: string);
begin
  // if S is AnsiString then do something;
  // if S is UTF8String then do something;
end;

var
  AStr: AnsiString;
  U8Str: UTF8String;

foo(AStr);
foo(U8Str);

=== END ===

Regards,
Marcos Douglas



More information about the fpc-pascal mailing list