Bonjour Jürgen Schmidt
Message du 2006-10-11 08:05:
Bernard Marcelly wrote:
Hi again,
Some additional info.
Message du 2006-10-10 21:18:
Hi Jürgen,
Message du 2006-10-10 17:07:

out parameters working fine, you simply have to initialize the array and an array with the length of 0 is fine.


Yes, this is what I did in Javascript. And it does not work with a called Basic script.


sorry Bernard, i was to fast with my last answer and that an array with lenth 0 would be ok. The out parameter has to be an initialized array of length 1 but the expected return value can be null.

Thanks, this was not obvious for me :)


See my changed BeanShell exmaple:

import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XComponentContext;
import com.sun.star.frame.XDesktop;
import com.sun.star.frame.XModel;
import com.sun.star.script.provider.XScriptProviderSupplier;
import com.sun.star.script.provider.XScriptProvider;

oDoc = XSCRIPTCONTEXT.getDocument();
xsps = UnoRuntime.queryInterface(XScriptProviderSupplier.class,oDoc);
scriptPro = xsps.getScriptProvider();
xsp =  UnoRuntime.queryInterface(XScriptProvider.class, scriptPro);
xscript = xsp.getScript("vnd.sun.star.script:Standard.Module1.show2?language=Basic&location=document");
args = new Object [1];
args[0] = "Hello";
short[ ] [ ] a = new short[1][ ];
a[0]=null;
Object [ ][ ] b = new Object[1][ ];
b[0] = null;
xscript.invoke(args, a, b);

args[0] = b[0][0];
xscript.invoke(args, a, b);


Run on Windows XP, I get after first invoke:
  a[0][0] = 0
  b[0][0] = "Hello"
That's better but not yet the expected result.
It should display "Finished" because macro show2 has assigned "Finished" to the argument...

Thanks for helping
   Bernard

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

Reply via email to