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

Marco van de Voort marcov at stack.nl
Mon Dec 30 13:55:19 CET 2013


In our previous episode, Michael Van Canneyt said:
> 
> procedure t(S : String);
> 
> begin
>    if typeinfo(s)=typeinfo(shortstring) then
>      Writeln('ShortString')
>    else
>      Writeln('Ansistring'); 
> end;
> 
> begin
>    t('');
> end.

Thank you, I saved it to my obfuscated Pascal mailfolder :-)



More information about the fpc-pascal mailing list