Board index » delphi » Re: IDE Suggestion

Re: IDE Suggestion


2003-11-19 07:37:53 AM
delphi0
Richard Grossman writes:
Quote
with dmMyDataModule do begin
// right here:
.
I say remove the with statement completely and if not, definately don't
waste any time on this keyword.
JED
 
 

Re: IDE Suggestion

Wouldn't it be nice if you could do this (for example) in a unit outside
of the one containing dmMyDataModule:
with dmMyDataModule do begin
// right here:
.
Within the "with", you could type a "." and then get the same popup
choices as when you type:
dmMyDataModule.
?
 

Re: IDE Suggestion

hi,
Quote
Wouldn't it be nice if you could do this (for example) in a unit outside
of the one containing dmMyDataModule:

with dmMyDataModule do begin
// right here:
.
I even would vote for a basic like language feature to always use the point
before properties in the with statement.
It's muc more logical in my eyes as I can divide properties and other
objects by that.
Alex
 

Re: IDE Suggestion

Quote
with dmMyDataModule do begin
// right here:
.

Within the "with", you could type a "." and then get the same popup
choices as when you type:

dmMyDataModule.
Try Ctrl+Space
 

Re: IDE Suggestion

Richard Grossman writes:
Quote
Within the "with", you could type a "." and then get the same popup
choices as when you type:
There can be many "with"'s and as you can note, even "tooltip expression
evaluation" feature doesn't work with "with" statements. I believe this
is because the language parser doesnt't report this information for some
reason.
--
Eugene Mayevski
EldoS Corp., CTO
Security and networking solutions
www.eldos.com
 

Re: IDE Suggestion

In article <3fbab84c$XXXX@XXXXX.COM>, XXXX@XXXXX.COM
says...
Quote
hi,

>Wouldn't it be nice if you could do this (for example) in a unit outside
>of the one containing dmMyDataModule:
>
>with dmMyDataModule do begin
>// right here:
>.

I even would vote for a basic like language feature to always use the point
before properties in the with statement.
It's muc more logical in my eyes as I can divide properties and other
objects by that.
EEEEKKKK, too much like VB, then...
 

Re: IDE Suggestion

"Eugene Mayevski [SecureBlackbox]" <XXXX@XXXXX.COM>writes
Quote
Richard Grossman writes:

>Within the "with", you could type a "." and then get the same popup
>choices as when you type:

There can be many "with"'s and as you can note, even "tooltip expression
evaluation" feature doesn't work with "with" statements. I believe this
is because the language parser doesnt't report this information for some
reason.

But if the IDE can figure out enough to present the list of members within a
"with ..." block, why can not the tool tip software figure it out enough to
show the current value (at runtime)? That would be a great timesaver,
especially if you inherit code which uses several nested variable names in a
single "with ..".
Kirk Halgren
"If I were two-faced, do you think I would be wearing this one?"
- Abraham Lincoln
 

Re: IDE Suggestion

Peter Zolja writes:
Quote
>with dmMyDataModule do begin
>// right here:
>.
>
>Within the "with", you could type a "." and then get the same popup
>choices as when you type:
>
>dmMyDataModule.


Try Ctrl+Space
Didn't think of trying that... thanks.
 

Re: IDE Suggestion

One of the problems with "with" block is that it is not possible to get
a reference to the object in question. For example, if you have a
TList that keeps pointers to instances of TMyObject you have to do
this:
mo: TMyObject;
mo := TMyObject.Create;
MyList.Add( mo );
Doing the same in with block only is not possible:
with TMyObject.Create do
MyList.Add( ????? );
A solution might be to add a method to TObject (TObject.Instance for
example) that allways returns "self". This way, one can do
with TMyObject.Create do
MyList.Add( Instance );
I suggested this long time ago (don't recall if it made it into QC),
but I see no reaction to it. I know I needed it so many times. Anyone
else?
lc
 

Re: IDE Suggestion

On Wed, 19 Nov 2003 20:08:38 -0500, lc <XXXX@XXXXX.COM>writes:
Quote

One of the problems with "with" block is that it is not possible to get
a reference to the object in question. For example, if you have a
TList that keeps pointers to instances of TMyObject you have to do
this:

mo: TMyObject;

mo := TMyObject.Create;
MyList.Add( mo );

Doing the same in with block only is not possible:

with TMyObject.Create do
MyList.Add( ????? );
What's wrong with
MyList.Add( TMyObject.Create );
No reference required at all.
John Leavey
 

Re: IDE Suggestion

Why not:
with TMyObject(MyList.Add(TMyObject.Create)) do
...
Sure, it looks a bit uggly. <G>
DL