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

Sven Barth pascaldragon at googlemail.com
Tue Aug 14 10:17:52 CEST 2012


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:

resourcestring
   snippet1 = 'snippet1';
   snippet2 = 'snippet2';
   snippet3 = 'snippet3';

Writeln(snippet1);
Writeln(snippet2);
Writeln(snippet3);

Regards,
Sven





More information about the fpc-pascal mailing list