[fpc-pascal] Unicodestrings and Assign(File)

Jonas Maebe jonas.maebe at elis.ugent.be
Tue May 22 10:22:50 CEST 2012


Jürgen Hestermann wrote on Tue, 22 May 2012:

> Sven Barth schrieb:
>>
>> Estimated guess: the code is from a time where "String =  
>> AnsiString" wasn't possible.

That's indeed probably true.

> That would be explanation.
> But then it must be *very* old code which shows that a revise is overdue.

That's a non sequitur:
a) even though the original code was written a long time ago, it has  
been changed many times since then
b) if it isn't broken, don't fix it. Example: changing all occurrences  
of "string" into "shortstring" will break the system unit. The reason  
is that a "var a: string" is an "openstring" parameter (with a hidden  
"high" parameter that tells you the size of the variable that was  
passed in), while "var a: shortstring" is not. So at the very least,  
you'd have to change var/out parameters into openstring rather than  
into shortstring.

Adding support for new functionality (such as unicode file names)  
would obviously require revising all of that code, but that's because  
the context changes rather than because it's old.


Jonas



More information about the fpc-pascal mailing list