Nah, I just get curious and it pays to know your tools. Why all the questions - are you having a slow day?
As for debugging - breakpoints etc do support groups so you can turn on/off sets of breakpoints. However with regard to exceptions, I use them a lot and quite often have as many exception classes as I do actual useful classes (or more). When you are writing server side code a lot, it's one method of getting a lot of useful information quickly (and you can turn them off if required when they are fine grained). > if Query.FindField('col1') <> nil then Query.FindField('col1').AsString := >'blah' > I agree really bad code (in Delphi) - would be okay if the Delphi compiler was really good at optimisation - maybe this kind of code is written by ex C++ developers?? Myles var f: TField; f := Query.FindField('col1'); if assigned(f) then f.AsString := 'blah'; which is more efficient for the allocation of 1 pointer or should we just try Query.FindField('col1').AsString := 'blah' except end I agree on the debugging thing, its a pain it would be good if you could ingore handled exceptions per block of code not globally, I'd use try/excepts more It looks like im into traversing object properties still :-) Neven ----- Original Message ----- From: "Myles Penlington" <[EMAIL PROTECTED]> To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]> Sent: Friday, November 02, 2001 3:22 PM Subject: RE: [DUG]: Best practice - To except or not > Assigned() generates identical code to <> nil, and not Assigned() generates > identical code to = nil. > So take your pick. > > Myself - I prefer to use Assigned() - treat it as an inlined compiler > function - same applies to Pred(), Succ(), Inc() and Dec(). > > What really gets to me with Succ() and Pred() (Sometimes!) is that for > enumeration types they do not wrap around - because they generate identical > code to Inc() and Dec()!!!!! > > Myles. > > > -----Original Message----- > From: Neven MacEwan [mailto:[EMAIL PROTECTED]] > Sent: Friday, 2 November 2001 3:05 p.m. > To: Multiple recipients of list delphi > Subject: Re: [DUG]: Best practice - To except or not > > > Paul > > Thanks for the help, It would be great it assigned() worked wouldn't it > Maybe there is a suggestion for borland in there > > This leads to another question, is 'assigned()' pref to '<> nil'?, is > pred(count) better thasn Count-1? > > Actually thats inc(1) questions, or was that 1+1 questions > > It must be friday > > Neven > > > ----- Original Message ----- > From: "Paul Heinz" <[EMAIL PROTECTED]> > To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]> > Sent: Friday, November 02, 2001 2:53 PM > Subject: RE: [DUG]: Best practice - To except or not > > > > Sandeep wrote: > > > > > > > This is better > > > > > > > > > > if Assigned (Datasource.DataSet.Connection) > > > > > then Result := Datasource.DataSet.Connection; > > > > > > > > > > > > if Datasource.Dataset is nil won't this raise > > > > an exception? > > > > > > Conditon evaluates to false in that case > > > > In Delphi 5, you get an access violation since Assigned only tests the > final > > deref not the early one. Maybe it's changed in Delphi 6. > > > > TTFN, > > Paul. > > > > > > -------------------------------------------------------------------------- > - > > New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] > > Website: http://www.delphi.org.nz > > To UnSub, send email to: [EMAIL PROTECTED] > > with body of "unsubscribe delphi" > > Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/ > > > > -------------------------------------------------------------------------- - > New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] > Website: http://www.delphi.org.nz > To UnSub, send email to: [EMAIL PROTECTED] > with body of "unsubscribe delphi" > Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/ > -------------------------------------------------------------------------- - > New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] > Website: http://www.delphi.org.nz > To UnSub, send email to: [EMAIL PROTECTED] > with body of "unsubscribe delphi" > Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/ > --------------------------------------------------------------------------- New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] Website: http://www.delphi.org.nz To UnSub, send email to: [EMAIL PROTECTED] with body of "unsubscribe delphi" Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/ --------------------------------------------------------------------------- New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] Website: http://www.delphi.org.nz To UnSub, send email to: [EMAIL PROTECTED] with body of "unsubscribe delphi" Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/