Table.Field method
Ruslan Zasukhin
sunshine at public.kherson.ua
Thu Jul 6 01:00:13 CDT 2006
On 7/5/06 11:20 PM, "Joakim Schramm" <joakim at astrocalc.com> wrote:
Hi Joakim,
> I wonder if I can access a fileds value based on its ID (ID of field)? In
> the VTable Field methods it says
>
> Field( inNameOrIndex as VARIANT ) as IVField
>
> And... "Also this method allows you to access fields of a Table by index."
>
> The VField interface doesn't talk about any index though but Field.ID is
> what index is referencing to?
Index of field this is just from 1 to N
where N = Table.FieldCount
Index you use in simple loops:
for I = 1 to FieldCount
fld = Table.Field( I )
end
ID of field, is some number which is stored on disk.
It is never changed for this field.
E.g. You can change type of field, but its ID still is the same.
So far there is no many usefullness from ID,
Just we have implement them ...may be for future things.
Of you will find own way to use them.
> I am abit confused about this as first of all ID and Index is kinda 2
> different things to me and also it says Index start with 1, but looking at
> my structure in vstudio field.id always start with 3 and count up.
YES index and IF is different things.
Look. You can make 20 fields in Table. They have Id as 3..23.
IDs 1 and 2 are used on default for RecID and OID.
Later you delete first 10 fields,
But ID of rest fields still are the same, so you have IDs
1, 2, 13, ... 23
> This looks to me as ID and index not is the same thing here but then how can
> I get the fields index?
Just
FOR I 1 to fieldCount
> To recap what I want to do, I want to have a table with many fields and some
> of these fields has similar type of values that will go into an array in
> code. So I like to loop through the fields and read into array directly (or
> write). Note, not all fields will be of this type, so out of lets say 200
> fields I may like to look through filed 20 to 54 etc.
--
Best regards,
Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc
Valentina - Joining Worlds of Information
http://www.paradigmasoft.com
[I feel the need: the need for speed]
More information about the Valentina
mailing list