[lazarus] Two FPC questions

Michael Van Canneyt michael.vancanneyt at wisa.be
Wed Sep 11 04:39:22 EDT 2002




On Wed, 11 Sep 2002, Michal Bukovjan wrote:

[cut]
> >Nothing a run-time function cannot solve, I would think ?
> >I just don't think that it should be a _language_ feature.
> >
> >Michael.
> >
> >
> >
> Runtime function would be quite slow, I can imagine. But a different
> idea came to my mind: How about implementing it just for resourcestrings?
>
> - these are constants, so should not be hard to implement (just few
> regexps, I think)
> - this would not break existing string/shortstring/ansistring semantics

It would. If by any chance there is a '\n' in existing code, for
instance in a constant descibing a unix shell command, then this will be
broken.

> - it would enable sane translations
> - it could drive users to use resourcestrings when possible, possibly
> cleaning up code
> - at runtime, already translated strings would be present in memory, so
> no speed penalty.
>
> What do you think?

I have mixed ideas about this. Personally, I don't think it is a good
idea, so I'll leave it up to the other core members to decide.

If it is implemented, then there should be some switch to turn it
off. Something like

{$ESCAPEC ON}       { escape \n etc.}
{$ESCAPEC OFF}      { don't escape \n etc.}
{$ESCAPEC DEFAULT}  { mode dependent. Don't do it in Delphi/TP mode, only in FPC/objfpc mode}

And of course a command-line switch. -Ssomething or so.

Core members, comments ?

Michael.






More information about the Lazarus mailing list