[fpc-pascal] Re: Get all caller adresses of a given function/procedure before executing
Rainer Stratmann
RainerStratmann at t-online.de
Tue Aug 14 14:19:40 CEST 2012
Am Tuesday 14 August 2012 10:17:52 schrieb Sven Barth:
> Am 14.08.2012 09:11, schrieb Rainer Stratmann:
> > No need for tons od additional identyfiers and additional lines like:
> >
> > var
> > p_snippet1 : pchar;
> > p_snippet2 : pchar;
> > p_snippet3 : pchar;
> >
> > const
> > id_snippet1 = 'ids_snippet1';
> > id_snippet2 = 'ids_snippet2';
> > id_snippet3 = 'ids_snippet3';
> >
> > p_snippet1 := trlt( id_snippet1 );
> > p_snippet2 := trlt( id_snippet2 );
> > p_snippet3 := trlt( id_snippet3 );
> >
> > writeln( p_snippet1 );
> > writeln( p_snippet2 );
> > writeln( p_snippet3 );
> >
> > My solution:
> >
> > writeln( ls( 'snippet1' ) );
> > writeln( ls( 'snippet2' ) );
> > writeln( ls( 'snippet3' ) );
>
> You are exaggerating the standard solution a bit... which would be:
It was more or less exactly the way I did it before with little exaggerating
as you notice :-)
Even now I save 50% codesize in comparison to resourcestring.
> resourcestring
> snippet1 = 'snippet1';
> snippet2 = 'snippet2';
> snippet3 = 'snippet3';
>
> Writeln(snippet1);
> Writeln(snippet2);
> Writeln(snippet3);
More information about the fpc-pascal
mailing list