Subject RE: [IBO] Syntax
Author Norman Dunbar
Riho,

I use :

const int fld_forename = 0;
const int fld_surname = 1;
...

then I access the field s by ...fields[fld_forname]...

All I have to do is change the const ints :o)

HTH

regards,
Norman

-------------------------------------
Norman Dunbar
Database/Unix administrator
Lynx Financial Systems Ltd.
mailto:Norman.Dunbar@...
Tel: 0113 289 6265
Fax: 0113 289 3146
URL: http://www.Lynx-FS.com
-------------------------------------


-----Original Message-----
From: Riho-Rene Ellermaa [mailto:r.ellermaa@...]
Sent: Thursday, February 07, 2002 9:55 AM
To: IBObjects@yahoogroups.com
Subject: RE: [IBO] Syntax


With Fields[No] there is always the problem, that after changing query -
removing or adding fields - you must comb through you full project and
change Fields[9] to Fields[8] for example

Riho-Rene Ellermaa
senior programmer
Hansabank



>I often wonder about this sort of thing. Do personal preferences about
>syntax choice make any difference to the compiled code? Are there
penalties
>for making one's source code as comprehensible as possible?

There may be penalties. I don't know about the Assign method, but using
FieldByName in a loop makes IBO search for the field in every iteration
which is considerably slower than using Fields[<fieldno>]. For better
readability, one may use variables of type TIB_Column (or TIB_Field - I
never use these and don't quite know) and assign the actual field to the
column before starting the loop. If I've understood former suggestions
on
this list, this should be of similar speed to Fields[<fieldno>].



___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

This email is intended only for the use of the addressees named above and
may be confidential or legally privileged. If you are not an addressee you
must not read it and must not use any information contained in it, nor copy
it, nor inform any person other than Lynx Financial Systems or the
addressees of its existence or contents. If you have received this email
and are not a named addressee, please delete it and notify the Lynx
Financial Systems IT Department on 0113 2892990.