At 12:41 +0200 1/8/05, Frank Heckenbach wrote:
Peter N Lewis wrote:
On Tue, Jul 26, 2005 at 05:26:58PM +0800, Peter N Lewis wrote:
It seems that const parameters of string types are passed by
value, eg:
So is this considered a bug likely to be fixed in the near future, or is this considered a feature likely to be permanent?
The former. I notice that this case currently is "broken" with `const var' as well, so thanks for pointing me to this issue. I'll try to fix both cases before the next release.
Excellent.
BTW, unless you require the parameter to be limited to 1000 chars, you could simply declare it as `String'. This case works in GPC and it's usually more general (that's why I use it almost always, and therefore hadn't noticed the bug before).
I understand - I'm in the process of migrating, so I've first converted LongString from a record to String(2502). I now have lots of procedures in pairs like:
function IsExtension( const s: String ): Boolean; function LSIsExtension( const s: LongString ): Boolean;
It will take some time to migrate all of the code to just use String, but I'llg get there. In many cases, I've already changed LSIsExtension to just "return IsExtension( s )". I want to integrate some more changes from my team before I remove the procedures (it is already going to be a nightmare to integrate the changes, given the breadth of the change in making the switch from MW to GPC).
Thanks for the advice, Peter.