Table.Field method

Joakim Schramm joakim at astrocalc.com
Thu Jul 6 01:06:28 CDT 2006


Ok then it's clear to me, thanks.

Just a design question, is it a bad idea to have 1 table with many fields or
better to split them up in several tables, I am mostly thinking of
performance?

I have to store almost 700 different values for 1 record, values that is
calculated and stored once but then only read. All this is stored in a UDT
(User Defined Type) structure, containg sub structures and and arrays.

As an example, I have 1 group of 8 different values stored in an UDT and an
array(34) As UDT. So just this batch of values will make 280 fields I one
table. But I can also store this as 35 sub records in a table with 8 fields,
+ 1 internat Index field (values 1 to 35) + an ObjectPtr pointing to main
record. This seam to me being a better structure and can more easily loop
through internal index and put into UDT and array. But what about
performance? I ask as it's a pretty complex design to build, not only in
table structure but also in code so like to do it "right" from start.

I think it would be 7-8 tables that need to be read, 2 in the style as above
and the others much simpler. Only 1 record will be read at a time, mostly,
sometimes 2 or 3 records, but still in a manual select style like clicking
in a list will load 1 record. I think valentina can do this fast and nicely,
right? 

Regards,
Joakim 

> -----Original Message-----
> From: valentina-bounces at lists.macserve.net 
> [mailto:valentina-bounces at lists.macserve.net] On Behalf Of 
> Ruslan Zasukhin
> Sent: 06 July 2006 00:00
> To: valentina at lists.macserve.net
> Subject: Re: Table.Field method
> 
> 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]
> 
> 
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina
> 



More information about the Valentina mailing list