Re: [fpc-pascal] Name of a var

2011-11-22 Thread Sven Barth
On 22.11.2011 12:42, Marco van de Voort wrote: 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

Re: [fpc-pascal] Name of a var

2011-11-22 Thread Sven Barth
On 22.11.2011 14:42, Martin wrote: But remember each feature has a cost. Not only what it adds to your app (which it may well be worth), but also what it adds to the compiler: Now and in future maintenance. A reason why it's a low priority feature of mine. Before I implement that I have other

Re: [fpc-pascal] Name of a var

2011-11-22 Thread John Lee
> > >> Yes, there are many features not everybody needs. Yet they have to be > chosen by some means (language design) and yet there will always be > disagreement. > > No, do the minimum > But remember each feature has a cost. Not only what it adds to your app > (which it may well be worth), but a

Re: [fpc-pascal] Name of a var

2011-11-22 Thread Marco van de Voort
In our previous episode, Martin said: > And as I already wrote, why re-invent the wheel? Use published > properties of an object, instead of variables. They have RTTI, so they > can already do all of this. D2010 has RTTI on much more. ___ fpc-pascal ma

Re: [fpc-pascal] Name of a var

2011-11-22 Thread Martin
On 22/11/2011 13:23, Rainer Stratmann wrote: Am Tuesday 22 November 2011 13:50:06 schrieb John Lee: Call me old fashioned, but to ask for this capability to save typing seems bizarre. There are many functions I don't need. For example am I not a friend of dynamic allocated memory. I have reason

Re: [fpc-pascal] Name of a var

2011-11-22 Thread Martin
On 22/11/2011 13:09, michael.vancann...@wisa.be wrote: On Tue, 22 Nov 2011, Rainer Stratmann wrote: Once more: the name in the debug message is totally irrelevant. afaik debugging was not the initially mentioned purpose. Streaming to a file was. That already exists, see last line. I woul

Re: [fpc-pascal] Name of a var

2011-11-22 Thread Rainer Stratmann
Am Tuesday 22 November 2011 13:50:06 schrieb John Lee: > Call me old fashioned, but to ask for this capability to save typing seems > bizarre. There are many functions I don't need. For example am I not a friend of dynamic allocated memory. I have reasons for not using it. You may have reasons for

Re: [fpc-pascal] Name of a var

2011-11-22 Thread Rainer Stratmann
Am Tuesday 22 November 2011 14:09:42 schrieb michael.vancann...@wisa.be: > On Tue, 22 Nov 2011, Rainer Stratmann wrote: > The name of a variable is only used for debugging, and then you can > just as well use the debug info. And the change of a name is usually > done with search&repl

Re: [fpc-pascal] Name of a var

2011-11-22 Thread michael . vancanneyt
On Tue, 22 Nov 2011, Rainer Stratmann wrote: The name of a variable is only used for debugging, and then you can just as well use the debug info. And the change of a name is usually done with search&replace, option whole word, so the text 'counter' should get changed as well. The name of a va

Re: [fpc-pascal] Name of a var

2011-11-22 Thread John Lee
Call me old fashioned, but to ask for this capability to save typing seems bizarre. I'l like it, if as has been suggested it is easy to do, so that it is easier & more error free to implement a variable save and restore capability. I have a program in which some variables values need to be stored

Re: [fpc-pascal] Name of a var

2011-11-22 Thread Marco van de Voort
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

Re: [fpc-pascal] Name of a var

2011-11-22 Thread Graeme Geldenhuys
On 2011-11-22 13:02, michael.vancann...@wisa.be wrote: > > No, if I was to program it using varname, I would get the name of the > parameter in the function SendInteger. That's what I thought - and mentioned that fact. > You need the address of the variable that was passed to SendInteger. > Obv

Re: [fpc-pascal] Name of a var

2011-11-22 Thread Rainer Stratmann
Am Tuesday 22 November 2011 12:14:54 schrieb michael.vancann...@wisa.be: > On Tue, 22 Nov 2011, Rainer Stratmann wrote: > > Am Tuesday 22 November 2011 12:05:07 schrieb michael.vancann...@wisa.be: > >> On Tue, 22 Nov 2011, Sven Barth wrote: > >>> Am 22.11.2011 10:13, schrieb michael.vancann...@wisa

Re: [fpc-pascal] Name of a var

2011-11-22 Thread michael . vancanneyt
On Tue, 22 Nov 2011, Rainer Stratmann wrote: Am Tuesday 22 November 2011 12:05:07 schrieb michael.vancann...@wisa.be: On Tue, 22 Nov 2011, Sven Barth wrote: Am 22.11.2011 10:13, schrieb michael.vancann...@wisa.be: If we choose to implement such a function, yes. My response was based on the

Re: [fpc-pascal] Name of a var

2011-11-22 Thread michael . vancanneyt
On Tue, 22 Nov 2011, Rainer Stratmann wrote: Am Tuesday 22 November 2011 10:13:20 schrieb michael.vancann...@wisa.be: On Tue, 22 Nov 2011, Sven Barth wrote: Am 21.11.2011 14:22, schrieb michael.vancann...@wisa.be: On Mon, 21 Nov 2011, Rainer Stratmann wrote: Am Monday 21 November 2011 14:0

Re: [fpc-pascal] Name of a var

2011-11-22 Thread Rainer Stratmann
Am Tuesday 22 November 2011 12:05:07 schrieb michael.vancann...@wisa.be: > On Tue, 22 Nov 2011, Sven Barth wrote: > > Am 22.11.2011 10:13, schrieb michael.vancann...@wisa.be: > If we choose to implement such a function, yes. My response was based > on the compiler as it is. > >>> > >>> Se

Re: [fpc-pascal] Name of a var

2011-11-22 Thread michael . vancanneyt
On Tue, 22 Nov 2011, Sven Barth wrote: Am 22.11.2011 10:13, schrieb michael.vancann...@wisa.be: If we choose to implement such a function, yes. My response was based on the compiler as it is. Seems like I'm not the only one that likes to have such a function. Though I would extend it to con

Re: [fpc-pascal] Name of a var

2011-11-22 Thread michael . vancanneyt
On Tue, 22 Nov 2011, Graeme Geldenhuys wrote: On 2011-11-22 11:13, michael.vancann...@wisa.be wrote: Typing VarName:=nameofvar( counter ); is more work than VarName:='counter'; So what's the point ? Maybe there is a use for it in the dbugintf unit? eg: SendInteger(counter) No, if

Re: [fpc-pascal] Name of a var

2011-11-22 Thread Rainer Stratmann
Am Tuesday 22 November 2011 10:13:20 schrieb michael.vancann...@wisa.be: > On Tue, 22 Nov 2011, Sven Barth wrote: > > Am 21.11.2011 14:22, schrieb michael.vancann...@wisa.be: > >> On Mon, 21 Nov 2011, Rainer Stratmann wrote: > >>> Am Monday 21 November 2011 14:08:43 schrieb michael.vancann...@wisa.

Re: [fpc-pascal] Name of a var

2011-11-22 Thread Sven Barth
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

Re: [fpc-pascal] Name of a var

2011-11-22 Thread Graeme Geldenhuys
On 2011-11-22 11:13, michael.vancann...@wisa.be wrote: > > Typing > > VarName:=nameofvar( counter ); > > is more work than > > VarName:='counter'; > > 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 po

Re: [fpc-pascal] Name of a var

2011-11-22 Thread Sven Barth
Am 22.11.2011 10:13, schrieb michael.vancann...@wisa.be: If we choose to implement such a function, yes. My response was based on the compiler as it is. Seems like I'm not the only one that likes to have such a function. Though I would extend it to convert identifiers in scope to strings (such

Re: [fpc-pascal] Name of a var

2011-11-22 Thread michael . vancanneyt
On Tue, 22 Nov 2011, Sven Barth wrote: Am 21.11.2011 14:22, schrieb michael.vancann...@wisa.be: On Mon, 21 Nov 2011, Rainer Stratmann wrote: Am Monday 21 November 2011 14:08:43 schrieb michael.vancann...@wisa.be: On Mon, 21 Nov 2011, Rainer Stratmann wrote: Is it possible to get informa

Re: [fpc-pascal] Name of a var

2011-11-22 Thread Sven Barth
Am 21.11.2011 14:22, schrieb michael.vancann...@wisa.be: On Mon, 21 Nov 2011, Rainer Stratmann wrote: Am Monday 21 November 2011 14:08:43 schrieb michael.vancann...@wisa.be: On Mon, 21 Nov 2011, Rainer Stratmann wrote: Is it possible to get information of the name of a var? For Example. v

Re: [fpc-pascal] Name of a var

2011-11-21 Thread Martin
On 21/11/2011 23:04, Rainer Stratmann wrote: Am Monday 21 November 2011 20:06:10 schrieb Jeppe Græsdal Johansen: It would most likely be very easy to implement, but what is the need? I am storing vars in a textfile like: mintemp: 300 maxtemp: 350 And so on ... I put the pointer to the var an

Re: [fpc-pascal] Name of a var

2011-11-21 Thread Rainer Stratmann
Am Monday 21 November 2011 20:06:10 schrieb Jeppe Græsdal Johansen: > Den 21-11-2011 13:56, Rainer Stratmann skrev: > > Is it possible to get information of the name of a var? > > > > For Example. > > > > var > > counter : longint; > > varname : shortstring; > > > > varname := nameofvar( counte

Re: [fpc-pascal] Name of a var

2011-11-21 Thread Jeppe Græsdal Johansen
Den 21-11-2011 13:56, Rainer Stratmann skrev: Is it possible to get information of the name of a var? For Example. var counter : longint; varname : shortstring; varname := nameofvar( counter ); The content of varname then is 'counter'. It would most likely be very easy to implement, but

Re: [fpc-pascal] Name of a var

2011-11-21 Thread michael . vancanneyt
On Mon, 21 Nov 2011, Rainer Stratmann wrote: Am Monday 21 November 2011 14:08:43 schrieb michael.vancann...@wisa.be: On Mon, 21 Nov 2011, Rainer Stratmann wrote: Is it possible to get information of the name of a var? For Example. var counter : longint; varname : shortstring; varname := n

Re: [fpc-pascal] Name of a var

2011-11-21 Thread Rainer Stratmann
Am Monday 21 November 2011 14:08:43 schrieb michael.vancann...@wisa.be: > On Mon, 21 Nov 2011, Rainer Stratmann wrote: > > Is it possible to get information of the name of a var? > > > > For Example. > > > > var > > counter : longint; > > varname : shortstring; > > > > varname := nameofvar( counter

Re: [fpc-pascal] Name of a var

2011-11-21 Thread michael . vancanneyt
On Mon, 21 Nov 2011, Rainer Stratmann wrote: Is it possible to get information of the name of a var? For Example. var counter : longint; varname : shortstring; varname := nameofvar( counter ); The content of varname then is 'counter'. There is no way in Pascal. Conceivably, you can make

[fpc-pascal] Name of a var

2011-11-21 Thread Rainer Stratmann
Is it possible to get information of the name of a var? For Example. var counter : longint; varname : shortstring; varname := nameofvar( counter ); The content of varname then is 'counter'. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org