Which means any constructor could return NIL. Which you didn't make
clear in your explanation. I just wanted to clear that up for others
incase they weren't aware of this.
On 7/26/07, Dennis Chuah [EMAIL PROTECTED] wrote:
A constructor ALWAYS creates an instance, even if it encounters an
]
Sent: Thursday, 26 July 2007 10:37
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] basic question
I thought I might add my 10c (1/2/5 what has happened to our
currency?!)
It has become so overvalued and full of itself that it will not
acknowledge such derisory amounts.
cheers
No, a constuctor will not return Nil.
Yep, my mistake. Test case error :-)
___
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to [EMAIL
of
the economy.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of [EMAIL PROTECTED]
Sent: Thursday, 26 July 2007 10:37
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] basic question
I thought I might add my 10c (1/2/5 what has
: Thursday, July 26, 2007 9:35 AM
Subject: Re: [DUG] basic question
On 7/26/07, Dennis Chuah [EMAIL PROTECTED] wrote:
... A constructor always instantiates an instance.
Unless the constructor raises an exception.
___
NZ Borland Developers Group - Delphi
]
To: NZ Borland Developers Group - Delphi List delphi@delphi.org.nz
Sent: Thursday, July 26, 2007 7:09 PM
Subject: Re: [DUG] basic question
Which means any constructor could return NIL. Which you didn't make
clear in your explanation. I just wanted to clear that up for others
incase they weren't aware
due to the excellent state of
the economy.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of [EMAIL PROTECTED]
Sent: Thursday, 26 July 2007 10:37
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] basic question
I thought I might add my 10c
Thanks for the responses..surely the confusion I had, got cleared... :)
On 7/25/07, Jeremy North [EMAIL PROTECTED] wrote:
I'll answer for Chee Wee (not Chee - common mistake)
These articles were by Nick about changes since Delphi 7.
http://dn.codegear.com/article/34325 (VCL)
@delphi.org.nz
Sent: Wednesday, July 25, 2007 7:25 PM
Subject: Re: [DUG] basic question
J
My point is Delphi (generic) does not have Class Methods/Vars or
are you saying that 'Delphi' only applies to D2005+
As for sarcasm, its a matter of opinion I found his response smug.
N
I'll answer for Chee Wee
] [mailto:delphi-
[EMAIL PROTECTED] On Behalf Of Neven MacEwan
Sent: Wednesday, 25 July 2007 8:19 p.m.
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] basic question
Dennis
Class methods have been around since Delphi 2. Where have you been
all these years
I'll say it again: no you won't. ;-)
I'll clarify my posting for you.
If you tried what the original poster said (I'm using D2006), and
recreated it (i.e. create two forms, make the second one not
autocreated, add a method to the second form with a simple ShowMessage
in it, and call that method
: [DUG] basic question
J
My point is Delphi (generic) does not have Class Methods/Vars or
are you saying that 'Delphi' only applies to D2005+
As for sarcasm, its a matter of opinion I found his response smug.
N
I'll answer for Chee Wee (not Chee - common mistake
- Rental management made easy
http://www.sourceitsoftware.com
-Original Message-
From: [EMAIL PROTECTED] [mailto:delphi-
[EMAIL PROTECTED] On Behalf Of Neven MacEwan
Sent: Wednesday, 25 July 2007 8:19 p.m.
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] basic question
] On Behalf Of Neven MacEwan
Sent: Wednesday, 25 July 2007 8:19 p.m.
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] basic question
Dennis
Class methods have been around since Delphi 2. Where have you been
all these years?
Not explicitly, as I said, you cannot
Probably. ;-)
Which is why I clarified my original statement.
Cheers,
C.
P.S. I've been doing Delphi dev on and off since Delphi 1, so I do
understand the difference between the cases where I do and don't have
code in a method referring to instance properties as opposed to just a
simple
Subject: Re: [DUG] basic question
Dennis Chuah wrote:
As for the use of class methods ... plenty. Eg., use it to replace
unit procedures and functions. Use it to implement singleton classes
and class factories.
Yes I agree, I've used them for this 'pseudo objectification', Its
inelegant
On 7/26/07, Dennis Chuah [EMAIL PROTECTED] wrote:
... A constructor always instantiates an instance.
Unless the constructor raises an exception.
___
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin:
;) May be we are talking about different things?
In your case you were probably tricked by Delphi
(optimizer??)...
Yes, if you have just ShowMessage in your method
everything will be fine. But ... did you try to assign
value to some local variable? You will have AV cause
we don't have the object
Which leads me to another point, It would be nice (and maybe Delphi
does) have class variables reintroduced in subclasses ie
TSingleton = class
public
class var Instance;
end;
TSingletonA = class(TSingleton)
)
TSingletonB = class(TSingleton)
)
do a B 'share' Instance?
Jeremy
Hence the If
On 7/26/07, Neven MacEwan [EMAIL PROTECTED] wrote:
Jeremy
Use both, though if I was posting authoritively, I'd say Since
Delphi 2...
Which is great since neither were in Delphi 2 as well.
Interfaces - Delphi 3
Dynamic arrays - Delphi 4
Which also reraises the issue
My point is Delphi (generic) does not have Class Methods/Vars or
are you saying that 'Delphi' only applies to D2005+
Thanks for making me laugh.
I hope you don't use interfaces or dynamic arrays then. Since they
also weren't in Delphi 1.
___
NZ
Neven MacEwan wrote:
Sean
Thanks, I grovel corrected :-), Still little use with no data, ie Data
+ Algorithms = Programs
I thought I might add my 10c (1/2/5 what has happened to our currency?!)
to this discussion. I have used class methods for a long time and used
unit data as the data -
List
Subject: Re: [DUG] basic question
J
My point is Delphi (generic) does not have Class Methods/Vars
or are you saying that 'Delphi' only applies to D2005+
As for sarcasm, its a matter of opinion I found his response smug.
___
NZ Borland
On 7/26/07, Neven MacEwan [EMAIL PROTECTED] wrote:
Jeremy
Use both, though if I was posting authoritively, I'd say Since Delphi 2...
Which is great since neither were in Delphi 2 as well.
Interfaces - Delphi 3
Dynamic arrays - Delphi 4
Which also reraises the issue of What is Delphi now we
I thought I might add my 10c (1/2/5 what has happened to our
currency?!)
It has become so overvalued and full of itself that it will not
acknowledge such derisory amounts.
cheers,
peter
===
Peter Hyde, Development Director
* http://TurboNote.com --
Of Neven MacEwan
Sent: Thursday, 26 July 2007 11:35 AM
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] basic question
Chee Wee
I overreacted but then i had a few people stomping on my head at the
time :-)
Interesting that others didn't know this
Regards Neven
Neven,
No sarcasm
-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Neven MacEwan
Sent: 25 July 2007 15:26
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] basic question
J
My point is Delphi (generic) does not have Class Methods/Vars
or are you saying that 'Delphi' only
I agree, the Delphi for PHP name just doesn't seem right to me - they
apparently had big debates about it at CodeGear. I guess they are just
using the Delphi name to give it more credibility. Has anyone written
anything significant yet in it? The only thing I've done is the
mortgage
Okay, I admit, I had to look this one up
Derisory http://www.answers.com/main/ntquery?s=derisory+gwp=13
Alister Christie
Computers for People
Ph: 04 471 1849 Fax: 04 471 1266
http://www.salespartner.co.nz
PO Box 13085
Johnsonville
Wellington
[EMAIL PROTECTED] wrote:
I thought I might add
Jeremy
Use both, though if I was posting authoritively, I'd say Since Delphi 2...
Which also reraises the issue of What is Delphi now we have Delphi for
PHP?
Neven
My point is Delphi (generic) does not have Class Methods/Vars or
are you saying that 'Delphi' only applies to D2005+
Thanks
delphi@delphi.org.nz
Sent: Wednesday, July 25, 2007 10:15 PM
Subject: Re: [DUG] basic question
AnInstance := TAnObject.Create;
if that's not a class method I'm not sure what is ;)
D
On Wed, 25 Jul 2007 21:33:25 +1200, you wrote:
Sean
Thanks, I grovel corrected :-), Still little use
]
Sent: Thursday, 26 July 2007 10:37
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] basic question
I thought I might add my 10c (1/2/5 what has happened to our
currency?!)
It has become so overvalued and full of itself that it will not
acknowledge such derisory amounts.
cheers
- Delphi List delphi@delphi.org.nz
Sent: Wednesday, July 25, 2007 10:15 PM
Subject: Re: [DUG] basic question
AnInstance := TAnObject.Create;
if that's not a class method I'm not sure what is ;)
D
On Wed, 25 Jul 2007 21:33:25 +1200, you wrote:
Sean
Thanks, I grovel corrected :-), Still
Yes you can do this. In this case the Self pointer is nil, and any
reference to any property on the from B will give a AV, but if no
references to class instance properties, then in effect you have a class
function.
Is not very good programming. Does not really make sense unless you want
to
Yes, I got confused too and bit surprised to see why Delphi allowed me to do
this :)
Thanks
Ani
On 7/25/07, Myles Penlington [EMAIL PROTECTED] wrote:
Yes you can do this. In this case the Self pointer is nil, and any
reference to any property on the from B will give a AV, but if no
The Delphi compiler creates an implicit parameter to Self and places it before
the
other params to the method.
Take a look at the TMethod class to see how this works and can be used
successfully
to redirect code and data.
The code pointer is share by all instances of the object and exists even
You can do it in C# - for static functions and
variables.
--- ani chakra [EMAIL PROTECTED] wrote:
Hi,
Is it possible to call a method of a class without
creating a object of it,
even if the method is not a class function in Delphi
? I wrote the below
code just to test -
1. Created a
Remove FormB from AutoCreate list and you will have
AV.
--- David Moorhouse [EMAIL PROTECTED] wrote:
The Delphi compiler creates an implicit parameter to
Self and places it before the
other params to the method.
Take a look at the TMethod class to see how this
works and can be used
I've been thinking of doing a number of training movies on OOP, but it's
such a huge topic. I've been trying to keep my videos below 10 minutes
lately so I can put them on YouTube - I'd think about 50-100 movies
would be required to cover OOP properly. Currently there are 16
available
No you don't. ;-)
Try it.
C.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Edward Koryagin
Remove FormB from AutoCreate list and you will have AV.
--- David Moorhouse [EMAIL PROTECTED] wrote:
The Delphi compiler creates an implicit parameter to
Yes I do ;)
if you don't have
Application.CreateForm(TFormB, FormB);
in your project source you will have AV
--- Conor Boyd [EMAIL PROTECTED] wrote:
No you don't. ;-)
Try it.
C.
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
On Behalf Of Edward
- Delphi List
Subject: RE: [DUG] basic question
Yes I do ;)
if you don't have
Application.CreateForm(TFormB, FormB);
in your project source you will have AV
--- Conor Boyd [EMAIL PROTECTED] wrote:
No you don't. ;-)
Try it.
C.
-Original Message-
From: [EMAIL PROTECTED
Ani
What you are referring to is a Class Method and no Delphi does not
have them (though other OO languages do)
it also does not have class variables (hence there is not need for Class
Methods is the logic I presume)
The reason your code works is that the method you called makes no
matter
www.codegear.com
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Neven MacEwan
Sent: 25 July 2007 12:57
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] basic question
Ani
What you are referring to is a Class Method
www.codegear.com
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Neven MacEwan
Sent: 25 July 2007 12:57
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] basic question
Ani
What you are referring to is a Class Method and no Delphi
does
TShowOff = class
public
class var Count: Integer; // Hmm, I wonder what they call this.
class procedure Static1;
class procedure Static2; static;
end;
I much prefer to align my code differently though, since once one
Class var has been defined, all subsequent variables are also
July 2007 12:57
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] basic question
Ani
What you are referring to is a Class Method and no Delphi
does not have them (though other OO languages do) it also
does not have class variables (hence there is not need for
Class Methods
I'll answer for Chee Wee (not Chee - common mistake)
These articles were by Nick about changes since Delphi 7.
http://dn.codegear.com/article/34325 (VCL)
http://dn.codegear.com/article/34323 (IDE)
http://dn.codegear.com/article/34324 (Language)
I don't think his original reply was sarcastic
Title: Message
Add a
property to each of the components which you set to the other component at
design time. Thay way they will know about each other.
Stacey
-Original Message-From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 11 November 2003 21:47To:
[EMAIL PROTECTED] wrote:
snip
From an instance of my new component (TUVTable, dropped on the form), I
need to call methods of the instance of the TUVObject component on my
form. In TUVTable.pas I could add a uses clause, MainUnit, and then call
MainUnit.UVObject1.method - so allowing
Ross
Others have replied and pointed out the method (same as a TDatasource and
TDataSet link)
Also you should override
procedure Notification(AComponent: TComponent; Operation: TOperation);
override;
which is called when a component instance is destroyed (so that you can
clear your pointer
, 2003 8:34 AM
To: Multiple recipients of list delphi
Subject: Re: [DUG]: Basic question on custom components
[EMAIL PROTECTED] wrote:
snip
From an instance of my new component (TUVTable, dropped on the form), I
need to call methods of the instance of the TUVObject component on my
form
Message-
From: Stacey Verner
[mailto:[EMAIL PROTECTED]
Sent: Wednesday, 12 November 2003
8:16AM
To: Multiple recipients of list
delphi
Subject: RE: [DUG]: Basic question
on custom components
Add a
property to each of the components which you set to the other component at
design time. Thay way
You can either iterate through the controls on the form using
MyForm.Controls and checking thier type or you can define a private TList
and push all your buttons into the list on create (or in the constructor)
and iterate through the TList.
Graham
for i := 0 to Form.ComponentCount-1 do
if Form.Components[i].InheritsFrom(TButton) then
TButton(Form.Components[i]).Enabled:=true;
HTH
Neven
- Original Message -
From: Graham Mayes [EMAIL PROTECTED]
To: Multiple recipients of list delphi [EMAIL PROTECTED]
Sent: Friday, 11 May
James
For Counter := 1 to Form1.Controlscount do
Do a bit of VB programming do you? :-)
Neven
- Original Message -
From: James Low [EMAIL PROTECTED]
To: Multiple recipients of list delphi [EMAIL PROTECTED]
Sent: Friday, 11 May 2001 11:02
Subject: RE: [DUG]: basic question
);
if Assigned(LButton) then LButton.Enabled := True; // or whatever...
end;
David Brennan.
DB Solutions Ltd.
- Original Message -
From: Neven MacEwan [EMAIL PROTECTED]
To: Multiple recipients of list delphi [EMAIL PROTECTED]
Sent: Friday, May 11, 2001 10:57 AM
Subject: Re: [DUG]: basic question
by the price thing - at least Delphi programmers do not
have to contend with porting existing code to .Net too soon (a la VB) ;(.
-Original Message-
From: Neven MacEwan [mailto:[EMAIL PROTECTED]]
Sent: 11 May 2001 10:59
To: Multiple recipients of list delphi
Subject: Re: [DUG]: basic question
One construct I wish they'd put in delphi is the ability to write code like:
procedure TForm1.Button1Click(Sender: TObject);
var
ADataSet: TDataSet;
begin
for ADataSet in [qryStaff, qryClients, qryProducts] do
begin
ADataSet.Close;
ADataSet.Open;
end;
end;
At the moment to do
59 matches
Mail list logo