Re: [DUG] basic question

2007-07-26 Thread Jeremy North
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

RE: [DUG] basic question

2007-07-26 Thread David Brennan
] 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

Re: [DUG] basic question

2007-07-26 Thread Jeremy North
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

Re: [DUG] basic question

2007-07-26 Thread Neven MacEwan
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

Re: [DUG] basic question

2007-07-26 Thread Dennis Chuah
: 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

Re: [DUG] basic question

2007-07-26 Thread Dennis Chuah
] 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

Re: [DUG] basic question

2007-07-26 Thread Steve Peacocke
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

Re: [DUG] basic question

2007-07-25 Thread ani chakra
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)

Re: [DUG] basic question

2007-07-25 Thread Neven MacEwan
@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

RE: [DUG] basic question

2007-07-25 Thread Sean Cross
] [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

RE: [DUG] basic question

2007-07-25 Thread Conor Boyd
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

Re: [DUG] basic question

2007-07-25 Thread Todd Martin
: [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

Re: [DUG] basic question

2007-07-25 Thread Neven MacEwan
- 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

Re: [DUG] basic question

2007-07-25 Thread David Moorhouse
] 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

RE: [DUG] basic question

2007-07-25 Thread Conor Boyd
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

RE: [DUG] basic question

2007-07-25 Thread Myles Penlington
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

Re: [DUG] basic question

2007-07-25 Thread Jeremy North
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:

RE: [DUG] basic question

2007-07-25 Thread Edward Koryagin
;) 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

RE: [DUG] basic question

2007-07-25 Thread Sean Cross
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?

Re: [DUG] basic question

2007-07-25 Thread Neven MacEwan
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

Re: [DUG] basic question

2007-07-25 Thread Jeremy North
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

Re: [DUG] basic question

2007-07-25 Thread Richard Vowles
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 -

Re: [DUG] basic question

2007-07-25 Thread Neven MacEwan
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

Re: [DUG] basic question

2007-07-25 Thread Jeremy North
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

Re: [DUG] basic question

2007-07-25 Thread peter
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 --

RE: [DUG] basic question

2007-07-25 Thread Tim Jarvis
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

RE: [DUG] basic question

2007-07-25 Thread Chee Wee Chua
- 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

Re: [DUG] basic question

2007-07-25 Thread Alister Christie
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

Re: [DUG] basic question

2007-07-25 Thread Alister Christie
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

Re: [DUG] basic question

2007-07-25 Thread Neven MacEwan
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

Re: [DUG] basic question

2007-07-25 Thread Neven MacEwan
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

RE: [DUG] basic question

2007-07-25 Thread Ross Levis
] 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

Re: [DUG] basic question

2007-07-25 Thread Dennis Chuah
- 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

RE: [DUG] basic question

2007-07-24 Thread Myles Penlington
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

Re: [DUG] basic question

2007-07-24 Thread ani chakra
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

Re: [DUG] basic question

2007-07-24 Thread David Moorhouse
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

Re: [DUG] basic question

2007-07-24 Thread Edward Koryagin
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

Re: [DUG] basic question

2007-07-24 Thread 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 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

Re: [DUG] basic question

2007-07-24 Thread Alister Christie
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

RE: [DUG] basic question

2007-07-24 Thread Conor Boyd
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

RE: [DUG] basic question

2007-07-24 Thread Edward Koryagin
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

RE: [DUG] basic question

2007-07-24 Thread Ross Levis
- 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

Re: [DUG] basic question

2007-07-24 Thread Neven MacEwan
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

RE: [DUG] basic question

2007-07-24 Thread Chee Wee Chua
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

RE: [DUG] basic question

2007-07-24 Thread Chee Wee Chua
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

Re: [DUG] basic question

2007-07-24 Thread Jeremy North
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

Re: [DUG] basic question

2007-07-24 Thread Neven MacEwan
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

Re: [DUG] basic question

2007-07-24 Thread Jeremy North
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

RE: [DUG]: Basic question on custom components

2003-11-11 Thread Stacey Verner
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:

Re: [DUG]: Basic question on custom components

2003-11-11 Thread Corey Murtagh
[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

Re: [DUG]: Basic question on custom components

2003-11-11 Thread Neven MacEwan
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

RE: [DUG]: Basic question on custom components

2003-11-11 Thread Leigh Wanstead
, 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

RE: [DUG]: Basic question on custom components

2003-11-11 Thread Dave . Jollie
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

RE: [DUG]: basic question?

2001-05-10 Thread Luke Pascoe
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.

Re: [DUG]: basic question?

2001-05-10 Thread Neven MacEwan
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

Re: [DUG]: basic question?

2001-05-10 Thread Neven MacEwan
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

Re: [DUG]: basic question?

2001-05-10 Thread David Brennan
); 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

RE: [DUG]: basic question?

2001-05-10 Thread James Low
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

Re: [DUG]: basic question?

2001-05-10 Thread Mark Derricutt
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