Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Making a 'grid' table
Message
From
29/05/1998 15:17:19
 
 
To
29/05/1998 12:59:59
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00102892
Message ID:
00103216
Views:
19
>Hi. I didn't have time to read all the replies, but I think I have a fairly simple solution.
>
>The way that grids (or two dimentional arrays) are often stored is simply in consecutive one dimensional arrays - whether in memory or in a file on disk. If you created a table whose fields were simply "row-col", and "value" then you could "seek" the corresponding position quickly. You can easily expand the grid by adding records to the table and the index would handle the ordering of new records.
>
>ie. the grid:
> 1 2 3
>1 a b c
>2 d e f
>3 g h i
>4 j k l
>
>would be stored as
>
>r1c1:a
>r1c2:b
>r1c3:c
>r2c1:d
>r2c2:e
>r2c3:f
>r3c1:g
>r3c2:h
>r3c3:i
>r4c1:j
>r4c2:k
>r4c3:l
>
>adding a column would just mean appending 4 records: r1c4, r2c4,...r4c4
>Just a thought. Email me if you want a more detailed explanation.


That's the way I was thinking of doing it if I couldn't get the grid way to work. I think a grid will be more user friendly for inputting the prices. Plus, there's not so much to add when adding a new zone. In your case there was only 4 records, but in my case there could be hundreds of zones.

Thanks,
Previous
Reply
Map
View

Click here to load this message in the networking platform