Stephan Wunderlich wrote:

Hi Andrew,

Should getData() and getDataArray() work on a text table?

I tested this on windows and linux using 2.01 release candidates.

Create a text document and add a single text table.

Add some data to the text table. Use at least two rows and two columns.

Now, run this macro

Dim oTable

oTable = Thiscomponent.getTextTables().getbyIndex(0)

Dim oData() : oData() = oTable.getDataArray()

Dim a()     : a() = oData(1)

Print a(1)

MsgBox Join(a(), CHR$(10))

Print oTable.getCellByPosition(1, 1).getString()


The returned data is ALWAYS 0. Now, change getDataArray() to getData(). The returned values are still zero. What am I missing?


did you ensure that the cells are formatted as numbers ?

Regards

Stephan

Interesting....
Formatting the out AS a number allows non-zero numbers to be returned; I had not tried that before. Thanks for that information.
So getData() and getDataArray() both ONLY return numbers!

I thought that getData() should return numbers.
I thought that getDataArray() should return numbers AND strings.

I thought that the documentation stated this anyway. It does work this way in Calc. In my quick test, It generated an error if I tried to use setDataArray() with a string. Am I not correct in the difference between getData() and getDataArray().


--
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
My Book: http://www.hentzenwerke.com/catalog/oome.htm
Info:  http://www.pitonyak.org/oo.php
See Also: http://documentation.openoffice.org/HOW_TO/index.html


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to