FlexGrid TextMatrix vs TextArray

FlexGrid TextMatrix vs TextArray

Post by Atrej » Thu, 05 Aug 2004 23:00:10


What in heck is the actual difference, besides syntax, between
TextMatrix and TextArray. The MSDN descriptions of purpose and use
imply they are basically two ways of doing the same thing!


---Atreju---
 
 
 

FlexGrid TextMatrix vs TextArray

Post by Bob Butle » Thu, 05 Aug 2004 23:28:44


With regard to the MSFlexGrid control?
They are basically two ways of doing the same thing and the difference is
syntax. I use TextMatrix pretty much exclusively but if the logic in your
app makes it easier to address the cells using a single number then
TextArray comes in handy. Either property could be dropped and you could
convert from row,col to index or vice-versa as needed.

--
Reply to the group so all can participate
VB.Net... just say "No"

 
 
 

FlexGrid TextMatrix vs TextArray

Post by Al » Thu, 05 Aug 2004 23:38:13

TextArray Allows you to set the Value of the Cell without changing the Row.
And TextMatrix is based on The Row Number and the Cell (Column)

Explain.
Suppose you have a grid filled with 10 rows
one fixedrow and 6 cells

and you want to select the row number 5 and the cell # 3

'- Row # 5 and Cell # 3
flexgrid.TextMatrix(5,3)
meanwhile with the textArray you must
position the rowcursor to row = 5
and Col = 3 in order to display the value

Good Luck..1
 
 
 

FlexGrid TextMatrix vs TextArray

Post by Bob Butle » Thu, 05 Aug 2004 23:54:53


I think you are confusing .TextArray with .Text (which is a third way of
working with the values).

--
Reply to the group so all can participate
VB.Net... just say "No"
 
 
 

FlexGrid TextMatrix vs TextArray

Post by Jan Hyd » Fri, 06 Aug 2004 00:03:13

"Al" < XXXX@XXXXX.COM >'s wild thoughts were released on Wed,
4 Aug 2004 10:38:13 -0400 bearing the following fruit:


That's not correct, they both do the same same thing.






Jan Hyde (VB MVP)

--
Show me a small clock made by an old witch and I'll show you a time-hex watch.

(Hirsch and McNair)

[Abolish the TV License - http://www.yqcomputer.com/ ]
 
 
 

FlexGrid TextMatrix vs TextArray

Post by Rick Roths » Fri, 06 Aug 2004 00:32:32

> > What in heck is the actual difference, besides syntax, between
is
your
could

Personally, I never understood the need for the TextArray property. I
find it so much easier to think of the grid using Row and Col
coordinates to index into the various cells. The only thing I can
possibly think of where TextArray "might" be useful is if you wished to
save out (and perhaps later restore) the grids contents to a
one-dimension array.

Dim X As Long
Dim Size As Long
Dim FlexStuff() As String
With MSFlexGrid1
Size = .Rows * .Cols
ReDim FlexStuff(Size - 1)
For X = 0 To Size - 1
FlexStuff(X) = .TextArray(X)
Next
End With

Using TextArray would alleviate you having to remember whether you
iterated via rows before columns (or vice versa) in the nested For-Next
loops required to accomodate the two-dimensional TextMatrix property. I
know that is real stretch, but I honestly can't think of another reason
to use the indexing scheming required by the TextArray property.

Rick - MVP