[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

BeeJ

9/27/2011 4:11:00 PM

I have an String array of R Rows and C Columns.
The number of rows can be very large.
The number of columns might be around 20.

I need to display the contents of a subset of these rows, say 10 rows
and all the associtated columns.

Not only is there data in each cell (Rows * Columns) but there are
other possible "non-standard" parameters like forecolor or backcolor.

Now if I create a parallel array for forecolor and backcolor, I now
have some very large memory space usage, most of which is just a place
holder.

So I want to significantly reduce the amount of storage space.

Since the number of cells where forecolor and backcolor are
"non-standard" is relatively small I could use some other method like a
Dictionary to specify differences.

e.g.
DicFore.Add "row,col", Color
DicBack.Add "row,col", Color

So the Key is a string of the Cell Row and Cell Col.

Then when I display the row, if cycle through the Dictionary and look
up the row & col to see if a color is to be applied.

Color = DicFore("row,col")

So, is there a better faster way to do something like this?
Rather not use a Dictionary.


1 Answer

GS

9/27/2011 5:08:00 PM

0

BeeJ used his keyboard to write :
> I have an String array of R Rows and C Columns.
> The number of rows can be very large.
> The number of columns might be around 20.
>
> I need to display the contents of a subset of these rows, say 10 rows and all
> the associtated columns.
>
> Not only is there data in each cell (Rows * Columns) but there are other
> possible "non-standard" parameters like forecolor or backcolor.
>
> Now if I create a parallel array for forecolor and backcolor, I now have some
> very large memory space usage, most of which is just a place holder.
>
> So I want to significantly reduce the amount of storage space.
>
> Since the number of cells where forecolor and backcolor are "non-standard" is
> relatively small I could use some other method like a Dictionary to specify
> differences.
>
> e.g.
> DicFore.Add "row,col", Color
> DicBack.Add "row,col", Color
>
> So the Key is a string of the Cell Row and Cell Col.
>
> Then when I display the row, if cycle through the Dictionary and look up the
> row & col to see if a color is to be applied.
>
> Color = DicFore("row,col")
>
> So, is there a better faster way to do something like this?
> Rather not use a Dictionary.

I'm thinking an array is the simplest approach, where the array index
is the row# and the col/color is a delimited value for each row.

Example
Dim vData(), vTemp 'as Variant
Dim lRows&, lCols& 'as Long

'do stuff...
Redim vData(lRows)
vData(1) = "6,15,3,..."
'..where 6= col1's colorindex, 15= col2's colorindex, ..and so on
vTemp = Split(vData(1), ",")
'..process cols for row1 based on index in vTemp()

If you use RGB then choose a different column delimiter in the string.

--
Garry

Free usenet access at http://www.eternal-sep...
ClassicVB Users Regroup! comp.lang.basic.visual.misc