Wojciech Gryc wrote:
I just had a few questions with regards to add-in development... I'll just
list them as concisely as possible. (Note that these relate to the R/Calc
integration!)

  1. Is it possible to have Calc functions overload each other? I have a
  number of functions that each pass different types of parameters (e.g.
  R("cor.test"; A1:A10; B1:B10) and R("rnorm(1)"), etc...) and I think
  giving them different names would be confusing.

Each function name can have only one implementation, but it can have variable parameters, see below.

  2. Is it possible to create a UNO add-in function with unlimited
parameters? I know concatenate() does this, but it's hard-coded, and I can't
  seem to find anything on the topic.

For the last parameter, use the type "sequence<any>". The sequence will contain the remaining parameters.

Also, some bugs or problems I'm having -- any advice would be appreciated.

  1. If I write a function that calls R (suppose R("rnorm(1)") and write
it in one cell, and the drag the cell so that the function repeats a number
  of times in a column or row, the adjacent cell gets a new value, but then
all subsequent cells have the same values. Considering rnorm(1) is a random
  number, it's unlikely this is a random occurrence. Is there any way to
  change it?

Normally, each cell is calculated separately. Are you sure there isn't something wrong with your code?

  2. While built-in functions like RAND() update automatically, the
functions I wrote in the add-in do not... For example, the rnorm(1) question
  above does not update itself when RAND() does. Can I force an update?

Shift-Ctrl-F9 (or the API method calculateAll) causes all formulas to be recalculated. You can't make an add-in function that is always recaclulated like RAND. We have that problem with RANDBETWEEN, too.

Niklas

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

Reply via email to