Subject RE: [IBO] Syntax
Author Norman Dunbar

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)



Norman Dunbar
Database/Unix administrator
Lynx Financial Systems Ltd.
Tel: 0113 289 6265
Fax: 0113 289 3146

-----Original Message-----
From: Riho-Rene Ellermaa [mailto:r.ellermaa@...]
Sent: Thursday, February 07, 2002 9:55 AM
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

>I often wonder about this sort of thing. Do personal preferences about
>syntax choice make any difference to the compiled code? Are there
>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
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.
___________________________________________________________________________ - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !

Your use of Yahoo! Groups is subject to

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.