[fpc-pascal] Generic String Functions

Sven Barth pascaldragon at googlemail.com
Thu Jan 16 12:04:01 CET 2014


Am 15.01.2014 17:19 schrieb "Michael Schnell" <mschnell at lumino.de>:
>
> DXE Strings again :-) ,
>
> What is the relation between Generic Functions and (static) DXE String
encoding schemes ?
>
> Can you (e.g.) do a (silly) Generic Function that takes two strings of
any (but identical) encoding type, concatenates them and outputs the result
in the same (static) encoding type, so that you can call the beast to
handle the encoding type specified by the caller from "outside" (e.g. in
another unit) without unnecessary conversions.

Why would you want such a function? If the two strings have the same
encoding and the destination is a string variable of the same static
encoding then there won't be any conversions anyway.

> Could a single "Generic TStringlist" be done that way to allow for
storing and retrieving Strings of any - but ubiquitous - (static) encoding
Type ?

And then? If you want to use them in e.g. a class you need to pick a
specialization and thus a code page at compile time.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20140116/bbf4cfe6/attachment.html>


More information about the fpc-pascal mailing list