[fpc-pascal] Name of a var

Sven Barth pascaldragon at googlemail.com
Tue Nov 22 11:26:04 CET 2011


Am 22.11.2011 11:21, schrieb Graeme Geldenhuys:
>> So what's the point ?
>
> Maybe there is a use for it in the dbugintf unit?
>
> eg:
>
>    SendInteger(counter)
>
> result on the debug server would then possibly be something like...
>
>     2011-11-22 Debug: counter = 20
>
> The SendInteger() function will do the identifier-to-string call, not
> the developer. But then, the parameter name might be used, and not the
> original identifier name - not sure.

It would use the name of the formal parameter, as this would mean that 
the compiler would need to pass the name of the variable as well 
(without knowing whether this will be needed at all).

> Anyway, currently you have to do the following in dbugintf...
>
>     SendInteger('counter', counter);

It would more be something like

SendInteger(StrOfIdent(counter), counter);

So now reduction of typing here, but a check by the compiler if you 
choose to rename "counter".

Regards,
Sven



More information about the fpc-pascal mailing list