[fpc-pascal] Name of a var

Marco van de Voort marcov at stack.nl
Tue Nov 22 12:42:14 CET 2011


In our previous episode, Sven Barth said:
> > is more work than
> >
> > VarName:='counter';
> >
> > So what's the point ?
> 
> The best argument for such a feature is that the name is checked by the 
> compiler.
> If I change the declaration of the variable the compiler will complain in
> the first case, but not in the second (let's assume that we don't need to
> care about some kind of backwards compatibilty, just because we wrote the
> identifiers to a file in different versions of the application were the
> variable had different names).

The first or the second invocation of sendinteger ? :-)

sendinteger(nameofvar(var1),var2);

is an easily made mistake (copy and paste like).

So I have some doubts about this argument.





More information about the fpc-pascal mailing list