[DUG] Stupid /easy question

2009-10-14 Thread Robert martin
Hi After the D2010 presentation yesterday I decided I should actually use some of the D2007 features I had not gotten around to using. Specifically the For .. in construct. I am sure I am missing something but here iss what I want to do I have the following 'old school code' (note the base

Re: [DUG] Stupid /easy question

2009-10-14 Thread Jeremy North
The enumerator for TStringList returns a pointers not the specific object type so you still need a typecast. var CountryAddressFormat: Pointer; begin for CountryAddressFormat in Self do begin Strings.AddObject( TCountryAddressFormat(CountryAddressFormat).CountryName,

Re: [DUG] Stupid /easy question

2009-10-14 Thread Jeremy North
It should read - FCountryList: TStringListTCountryAddressFormat; Do you really not prefix your Local, Global, Field and Parameters with nothing? I'm a L, _, F and A person myself! On Thu, Oct 15, 2009 at 8:29 AM, Jeremy North jeremy.no...@gmail.com wrote: The enumerator for TStringList

Re: [DUG] Stupid /easy question

2009-10-14 Thread Robert martin
oun...@delphi.org.nz] On Behalf Of Robert martin Sent: Thursday, 15 October 2009 10:06 a.m. To: NZ Borland Developers Group - Delphi List Subject: [DUG] Stupid /easy question Hi After the D2010 presentation yesterday I decided I should actually use some of the D2007 features I had not go

Re: [DUG] Stupid /easy question

2009-10-14 Thread Robert martin
Hi I understand the issue now. I will follow Jolyon's recommendation and create an enumerator for this otherwise its not much use if I need to typecast anyway (may as well use my original code). I use f for local class variables. No prefix for local variables. Don't really use globals. Use a

Re: [DUG] Stupid /easy question

2009-10-14 Thread Jolyon Smith
From: delphi-boun...@delphi.org.nz [mailto:delphi-boun...@delphi.org.nz] On Behalf Of Robert martin Sent: Thursday, 15 October 2009 10:45 a.m. To: NZ Borland Developers Group - Delphi List Subject: Re: [DUG] Stupid /easy question Hi Yeah I read examples of how to add enumerators

Re: [DUG] Stupid /easy question

2009-10-14 Thread Robert martin
Original Message- From: delphi-boun...@delphi.org.nz [mailto:delphi-boun...@delphi.org.nz] On Behalf Of Robert martin Sent: Thursday, 15 October 2009 10:06 a.m. To: NZ Borland Developers Group - Delphi List Subject: [DUG] Stupid /easy question Hi After the D2010 presentation y

Re: [DUG] Stupid /easy question

2009-10-14 Thread Roger Kingaby
or behaviour. J From: delphi-boun...@delphi.org.nz [mailto:delphi-boun...@delphi.org.nz ] On Behalf Of Robert martin Sent: Thursday, 15 October 2009 10:45 a.m. To: NZ Borland Developers Group - Delphi List Subject: Re: [DUG] Stupid /easy question Hi Yeah I read examples of how to add enumerators

Re: [DUG] Stupid /easy question

2009-10-14 Thread Sean Cross
-boun...@delphi.org.nz] On Behalf Of Robert martin Sent: Thursday, 15 October 2009 10:45 a.m. To: NZ Borland Developers Group - Delphi List Subject: Re: [DUG] Stupid /easy question Hi Yeah I read examples of how to add enumerators but since TObjectList already has one I didn't think I needed

Re: [DUG] Stupid /easy question

2009-10-14 Thread Jolyon Smith
List Subject: Re: [DUG] Stupid /easy question If you are using a version of Delphi with generics, you should be able to use a generic list and it'll work fine. eg var myList : TObjectListTMyObject; Regards Sean Cross CIO Catalyst Risk Management PO Box 230 Napier 4140 DDI: 06