[fpc-pascal] Re: Get all caller adresses of a given function/procedure before executing

Rainer Stratmann RainerStratmann at t-online.de
Mon Aug 13 11:09:20 CEST 2012

Am Monday 13 August 2012 10:35:55 schrieb Lukasz Sokol:
> On 12/08/2012 14:41, Rainer Stratmann wrote:
> > It depends on the approach.
> > If you have a better solution would you take another approach?
> What is wrong with known and explored ways e.g. gettext ?

It will be ok for those who are satisfied with the functionality.
I dont know gettext in detail, but I assume there is more work than only to 
put a function ls('textsnippet') around.

> or TStringList 
> descendant, if you need to change language on-the-run? Or resourcestrings
> like someone suggested ?

See above.

> You were saying, that you want to know, which string has not been
> used / which string has been used and how many times ?

I want to knof if the string was called the first time.
But since I also get the pchar information of the textsnippets from the 
programmemory I can translate (make a list or whatever in the future) all 
snippets before they were called.

> Well why not the T(Hashed)StringList descendant with custom counter
> field(s) ?
> Curiously,
> L.

If I put a ls('snippet') around all texts I now get every caller adress 
(handle) and the text information 'snippet' itself. So before they are called 
I can make a list with all handles and all translations.
When calling ls() I look in my handle list of caller adresses and find it in 
array nr x where all translations were already made.

More information about the fpc-pascal mailing list