[sc-dev] Absurd behaviour while displaying values in a range of cells

2010-06-03 Thread rashi dhing
I have defined a function in which I take as input,  cell values from a
range and after doing some calculation
output them on the spreadsheet using the ScDocument::SetString and
ScDocument::SetValue functions.
But the values get printed partially ( Eg: 8 => 3 [half an 8] )  in each of
the cells .Then after a while or if
I scroll down the sheet and back up, then the all the values are  displayed
entirely. To me it seems like
a case where the values are in memory but are not being entirely printed on
the sheet. So I need to refresh
the spreadsheet manually. How do I enforce a refresh of the spreadsheet ?

Thanks,

Rashi


Re: [sc-dev] Absurd behaviour while displaying values in a range of cells

2010-06-03 Thread Eike Rathke
Hi rashi,

On Thursday, 2010-06-03 17:52:10 +0300, rashi dhing wrote:

> I have defined a function in which I take as input,  cell values from a
> range and after doing some calculation
> output them on the spreadsheet using the ScDocument::SetString and
> ScDocument::SetValue functions.

Modifying sheet content while interpreting functions is a big no-no.
Please don't do that.

Thanks
  Eike

-- 
 OOo/SO Calc core developer. Number formatter stricken i18n transpositionizer.
 SunSign   0x87F8D412 : 2F58 5236 DB02 F335 8304  7D6C 65C9 F9B5 87F8 D412
 OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS
 Please don't send personal mail to the e...@sun.com account, which I use for
 mailing lists only and don't read from outside Sun. Use er...@sun.com Thanks.


pgpeZKjkBRxYl.pgp
Description: PGP signature


Re: [sc-dev] Absurd behaviour while displaying values in a range of cells

2010-06-04 Thread rashi dhing
Hi Eike, Could you tell me why modifying the spreadsheet while  interpreting

a function is not the right approach and what is the workaround or the right
approach ?

Many thanks,

Rashi

On Thu, Jun 3, 2010 at 6:47 PM, Eike Rathke  wrote:

> Hi rashi,
>
> On Thursday, 2010-06-03 17:52:10 +0300, rashi dhing wrote:
>
> > I have defined a function in which I take as input,  cell values from a
> > range and after doing some calculation
> > output them on the spreadsheet using the ScDocument::SetString and
> > ScDocument::SetValue functions.
>
> Modifying sheet content while interpreting functions is a big no-no.
> Please don't do that.
>
> Thanks
>  Eike
>
> --
>  OOo/SO Calc core developer. Number formatter stricken i18n
> transpositionizer.
>  SunSign   0x87F8D412 : 2F58 5236 DB02 F335 8304  7D6C 65C9 F9B5 87F8 D412
>  OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS
>  Please don't send personal mail to the e...@sun.com account, which I use
> for
>  mailing lists only and don't read from outside Sun. Use er...@sun.comthanks.
>



-- 
" Happiness makes up in height for what it lacks in length." (Robert Frost)


Re: [sc-dev] Absurd behaviour while displaying values in a range of cells

2010-06-07 Thread rashi dhing
Hi Eike,

On Thu, Jun 3, 2010 at 6:47 PM, Eike Rathke  wrote:

>
>
> Modifying sheet content while interpreting functions is a big no-no.
> Please don't do that.
>

I do need to display the result of my function in a range of cells. How can
I facilitate that in
this scenario ?

Thanks,

Rashi


Re: [sc-dev] Absurd behaviour while displaying values in a range of cells

2010-06-07 Thread Niklas Nebel

On 06/07/10 09:12, rashi dhing wrote:

I do need to display the result of my function in a range of cells. How can
I facilitate that in
this scenario ?


You can return an array and display it in an array formula (the kind of 
formula you get with Shift-Ctrl-Enter).


Niklas

-
To unsubscribe, e-mail: dev-unsubscr...@sc.openoffice.org
For additional commands, e-mail: dev-h...@sc.openoffice.org



Re: [sc-dev] Absurd behaviour while displaying values in a range of cells

2010-06-08 Thread rashi dhing
Thanks Niklas, will take a look at how array formulas work ! Can you tell me
which modules to look at tho ?

Rashi

On Mon, Jun 7, 2010 at 10:50 AM, Niklas Nebel  wrote:

> On 06/07/10 09:12, rashi dhing wrote:
>
>> I do need to display the result of my function in a range of cells. How
>> can
>> I facilitate that in
>> this scenario ?
>>
>
> You can return an array and display it in an array formula (the kind of
> formula you get with Shift-Ctrl-Enter).
>
> Niklas
>
>


Re: [sc-dev] Absurd behaviour while displaying values in a range of cells

2010-06-08 Thread Niklas Nebel

On 06/08/10 09:43, rashi dhing wrote:

Thanks Niklas, will take a look at how array formulas work ! Can you tell me
which modules to look at tho ?


It depends on what you're really doing. Assuming that you're adding a 
function to ScInterpreter, take a look at GetNewMat/PushMatrix, and how 
they are used in the other functions.


Niklas

-
To unsubscribe, e-mail: dev-unsubscr...@sc.openoffice.org
For additional commands, e-mail: dev-h...@sc.openoffice.org



Re: [sc-dev] Absurd behaviour while displaying values in a range of cells

2010-06-16 Thread Eike Rathke
Hi rashi,

On Friday, 2010-06-04 14:10:31 +0300, rashi dhing wrote:

> Hi Eike, Could you tell me why modifying the spreadsheet while  interpreting
> a function is not the right approach

That could modify cells that are still to be interpreted, even for the
same formula the modifying function is part of, or cells that were
already interpreted for some formula but then would deliver a different
result in another step. It's like biting the hand that feeds you..

> and what is the workaround or the right approach ?

See Niklas' answer about returning an array.

  Eike

-- 
 OOo/SO Calc core developer. Number formatter stricken i18n transpositionizer.
 SunSign   0x87F8D412 : 2F58 5236 DB02 F335 8304  7D6C 65C9 F9B5 87F8 D412
 OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS
 Please don't send personal mail to the e...@sun.com account, which I use for
 mailing lists only and don't read from outside Sun. Use er...@sun.com Thanks.


pgpIdpMfeVFtP.pgp
Description: PGP signature


Re: [sc-dev] Absurd behaviour while displaying values in a range of cells

2010-07-06 Thread rashi dhing
So I did pore over the various functions of the ScInterpreter like GetNewMat
and PushMatrix etc.
Apart from being extremely complicated, I still really didn't understand
where the result matrix
was being set/put into the spreadsheet. I did create a matrix but now I
don't know how to
print the values onto the sheet. PushMatrix pushes the matrix onto the stack
but that
does not serve my purpose !!

-Rashi



On Wed, Jun 16, 2010 at 7:08 PM, Eike Rathke  wrote:

> Hi rashi,
>
> On Friday, 2010-06-04 14:10:31 +0300, rashi dhing wrote:
>
> > Hi Eike, Could you tell me why modifying the spreadsheet while
>  interpreting
> > a function is not the right approach
>
> That could modify cells that are still to be interpreted, even for the
> same formula the modifying function is part of, or cells that were
> already interpreted for some formula but then would deliver a different
> result in another step. It's like biting the hand that feeds you..
>
> > and what is the workaround or the right approach ?
>
> See Niklas' answer about returning an array.
>
>  Eike
>
> --
>  OOo/SO Calc core developer. Number formatter stricken i18n
> transpositionizer.
>  SunSign   0x87F8D412 : 2F58 5236 DB02 F335 8304  7D6C 65C9 F9B5 87F8 D412
>  OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS
>  Please don't send personal mail to the e...@sun.com account, which I use
> for
>  mailing lists only and don't read from outside Sun. Use er...@sun.comthanks.
>



-- 
" Happiness makes up in height for what it lacks in length." (Robert Frost)


Re: [sc-dev] Absurd behaviour while displaying values in a range of cells

2010-07-06 Thread Eike Rathke
Hi rashi,

On Tuesday, 2010-07-06 12:40:35 +0300, rashi dhing wrote:

> So I did pore over the various functions of the ScInterpreter like GetNewMat
> and PushMatrix etc.
> Apart from being extremely complicated, I still really didn't understand
> where the result matrix
> was being set/put into the spreadsheet.

The result matrix is stored at the top left cell of a matrix formula
range, if there is any (e.g. created by having selected an area and
entered the formula using Ctrl+Enter), respectively at the formula cell.
So if the entire matrix result is to be displayed you, or the user, need
to create a matrix formula range of at least the same size. In the UI
that is done automatically if no range was selected, e.g. entering the
formula =MUNIT(2) and terminating the input with Ctrl+Enter instead of
Enter creates a 2x2 matrix formula range.

> I did create a matrix but now I don't know how to print the values
> onto the sheet. PushMatrix pushes the matrix onto the stack but that
> does not serve my purpose !!

What is your purpose then? So far I thought you created a spreadsheet
function that delivers an array/matrix result. If the final result of
a formula was a matrix on the interpreter's stack, that matrix result is
stored at the formula cell for display purposes or further evaluation.
It's nothing you should have to care about.

  Eike

-- 
 OOo Calc core developer. Number formatter stricken i18n transpositionizer.
 Signature key 0x87F8D412 : 2F58 5236 DB02 F335 8304  7D6C 65C9 F9B5 87F8 D412
 OpenOffice.org Engineering at Oracle: http://blogs.sun.com/GullFOSS
 Please don't send personal mail to the e...@sun.com account, which I use for
 mailing lists only and don't read from outside Oracle. Use er...@sun.com 
Thanks.


pgpBJ2uBnG08X.pgp
Description: PGP signature


Re: [sc-dev] Absurd behaviour while displaying values in a range of cells

2010-07-06 Thread rashi dhing
Hi Eike,

So does this mean that if I create a matrix formula range and call
PushMatrix,
I will have the result displayed on the sheet ?

Thanks,

Rashi

On Tue, Jul 6, 2010 at 2:22 PM, Eike Rathke  wrote:

> Hi rashi,
>
> On Tuesday, 2010-07-06 12:40:35 +0300, rashi dhing wrote:
>
> > So I did pore over the various functions of the ScInterpreter like
> GetNewMat
> > and PushMatrix etc.
> > Apart from being extremely complicated, I still really didn't understand
> > where the result matrix
> > was being set/put into the spreadsheet.
>
> The result matrix is stored at the top left cell of a matrix formula
> range, if there is any (e.g. created by having selected an area and
> entered the formula using Ctrl+Enter), respectively at the formula cell.
> So if the entire matrix result is to be displayed you, or the user, need
> to create a matrix formula range of at least the same size. In the UI
> that is done automatically if no range was selected, e.g. entering the
> formula =MUNIT(2) and terminating the input with Ctrl+Enter instead of
> Enter creates a 2x2 matrix formula range.
>
> > I did create a matrix but now I don't know how to print the values
> > onto the sheet. PushMatrix pushes the matrix onto the stack but that
> > does not serve my purpose !!
>
> What is your purpose then? So far I thought you created a spreadsheet
> function that delivers an array/matrix result. If the final result of
> a formula was a matrix on the interpreter's stack, that matrix result is
> stored at the formula cell for display purposes or further evaluation.
> It's nothing you should have to care about.
>
>  Eike
>
> --
>  OOo Calc core developer. Number formatter stricken i18n transpositionizer.
>  Signature key 0x87F8D412 : 2F58 5236 DB02 F335 8304  7D6C 65C9 F9B5 87F8
> D412
>  OpenOffice.org Engineering at Oracle: http://blogs.sun.com/GullFOSS
>  Please don't send personal mail to the e...@sun.com account, which I use
> for
>  mailing lists only and don't read from outside Oracle. Use 
> er...@sun.comthanks.
>


Re: [sc-dev] Absurd behaviour while displaying values in a range of cells

2010-07-06 Thread Niklas Nebel

On 07/06/10 13:47, rashi dhing wrote:

So does this mean that if I create a matrix formula range and call
PushMatrix,
I will have the result displayed on the sheet ?


Yes, you get the same behavior as with the MUNIT function. See 
ScInterpreter::ScEMat for the implementation of MUNIT.


Niklas

-
To unsubscribe, e-mail: dev-unsubscr...@sc.openoffice.org
For additional commands, e-mail: dev-h...@sc.openoffice.org