Dear Niklas,
Thanks for your prompt reply, it was very helpful. 

I saw "Any" type works for optional parameters when the parameter is
not an array...for array parameters, for example,

* * *
double myFunc(
[in] Any p1, 
[in] Sequence < Sequence < Any> > p2
)
* * *

p1 is shown as optional in Calc, but p2 is always shown as reqired..

Do you have any idea?

Thanks a lot,
Xutuan



> -----Original Message-----
> From: Niklas Nebel [mailto:[EMAIL PROTECTED] 
> Sent: 17 June 2005 11:05
> To: [email protected]
> Subject: Re: [dev] A few question about Add-in for Calc!
> 
> 
> xutuan Zhang wrote:
> > I am writting some Add-in code for Calc to call my DLL/.so 
> written in
> > C..I have a few questions below:
> > 
> > 1. For "short" type parameters in my C code, if I use "short" in
IDL
> > file, sal_Int16 in the cpp code, then the function will not 
> be able to
> > show in Calc's function list...i.e., the registration fails 
> (only for
> > this perticular function which has type "short"). If I change it to
> > long/sal_Int32, the function will show in the list.
> 
> Only the types mentioned in the description for service "AddIn" are 
> allowed (see 
> http://api.openoffice.org/docs/common/ref/com/sun/star/sheet/A
ddIn.html).

> 2. How can I set an input parameter as [optional]? i.e., by default,
I
> want all the input parameter to be 0. Currently all params are shown
as
> "required", i.e., if even one input parameter is missing, then the
> function would return "Err:504".

You can use the type "any" for a single optional parameter, or 
"sequence<any>" for an unknown number of parameters. Note that Calc 
allows missing parameters only at the end, so a formula like 
"=MYFUNC(;1)" isn't possible (there are plans to change this for a
later 
version).

Niklas

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




        
        
                
___________________________________________________________ 
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail 
http://uk.messenger.yahoo.com

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

Reply via email to