xref: /aoo41x/main/extensions/test/ole/OleTest.htm (revision 5b501c92)
1*5b501c92SAndrew Rist<!--***********************************************************
2*5b501c92SAndrew Rist *
3*5b501c92SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*5b501c92SAndrew Rist * or more contributor license agreements.  See the NOTICE file
5*5b501c92SAndrew Rist * distributed with this work for additional information
6*5b501c92SAndrew Rist * regarding copyright ownership.  The ASF licenses this file
7*5b501c92SAndrew Rist * to you under the Apache License, Version 2.0 (the
8*5b501c92SAndrew Rist * "License"); you may not use this file except in compliance
9*5b501c92SAndrew Rist * with the License.  You may obtain a copy of the License at
10*5b501c92SAndrew Rist *
11*5b501c92SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
12*5b501c92SAndrew Rist *
13*5b501c92SAndrew Rist * Unless required by applicable law or agreed to in writing,
14*5b501c92SAndrew Rist * software distributed under the License is distributed on an
15*5b501c92SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*5b501c92SAndrew Rist * KIND, either express or implied.  See the License for the
17*5b501c92SAndrew Rist * specific language governing permissions and limitations
18*5b501c92SAndrew Rist * under the License.
19*5b501c92SAndrew Rist *
20*5b501c92SAndrew Rist ***********************************************************-->
21cdf0e10cSrcweir<HTML>
22cdf0e10cSrcweir<HEAD>
23cdf0e10cSrcweir<META NAME="GENERATOR" Content="Microsoft Developer Studio">
24cdf0e10cSrcweir<META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">
25cdf0e10cSrcweir<TITLE>Document Title</TITLE>
26cdf0e10cSrcweir</HEAD>
27cdf0e10cSrcweir<BODY id=theBody>
28cdf0e10cSrcweir
29cdf0e10cSrcweir<script language="JScript">
30cdf0e10cSrcweir// XEventListener implementation in JScript --------------------------------------------------
31cdf0e10cSrcweirfunction XEventListener_Impl()
32cdf0e10cSrcweir{
33cdf0e10cSrcweir	this._environment= "JScript";
34cdf0e10cSrcweir	this._implementedInterfaces= new Array( "com.sun.star.lang.XEventListener");
35cdf0e10cSrcweir
36cdf0e10cSrcweir	//XEventListener
37cdf0e10cSrcweir	this.disposing= XEventListener_disposing;
38cdf0e10cSrcweir
39cdf0e10cSrcweir	this.bdisposingCalled= false;
40cdf0e10cSrcweir	this.bQuiet= true;
41cdf0e10cSrcweir	this.resetDisposing= XEventListener_resetDisposing;
42cdf0e10cSrcweir	this.disposingCalled= XEventListener_disposingCalled;
43cdf0e10cSrcweir}
44cdf0e10cSrcweir
45cdf0e10cSrcweirfunction XEventListener_disposing( source)
46cdf0e10cSrcweir{
47cdf0e10cSrcweir  if( !this.bQuiet)
48cdf0e10cSrcweir        alert("JScript Event Listener \n disposing is being called");
49cdf0e10cSrcweir  this.bdisposingCalled= true;
50cdf0e10cSrcweir}
51cdf0e10cSrcweir
52cdf0e10cSrcweirfunction XEventListener_resetDisposing()
53cdf0e10cSrcweir{
54cdf0e10cSrcweir   this.bdisposingCalled= false;
55cdf0e10cSrcweir}
56cdf0e10cSrcweir
57cdf0e10cSrcweirfunction XEventListener_disposingCalled()
58cdf0e10cSrcweir{
59cdf0e10cSrcweir     return this.bdisposingCalled;
60cdf0e10cSrcweir}
61cdf0e10cSrcweir
62cdf0e10cSrcweir//--------------------------------------------------------------------------------------------
63cdf0e10cSrcweirfunction callOleTest(	 id)
64cdf0e10cSrcweir{
65cdf0e10cSrcweir	var factory= new ActiveXObject("com.sun.star.ServiceManager");
66cdf0e10cSrcweir	var oletest= factory.createInstance("oletest.OleTest");
67cdf0e10cSrcweir//	alert(oletest);
68cdf0e10cSrcweir
69cdf0e10cSrcweir	var arr= new Array( 1, 2, 3, 4, 0);
70cdf0e10cSrcweir	var arrDouble= new Array( 1.2345, 12.345, 123,45, 1234.5, 12345);
71cdf0e10cSrcweir	var arrBool= new Array( 1, 0, 2, 0, 3);
72cdf0e10cSrcweir	var arrChar= new Array( '1', 'A', "1", "A", ' ', 55, 56);
73cdf0e10cSrcweir	var arrString= new Array("hamburger","cheeseburger", "chicken nuggets", "chicken wings" , "pizza");
74cdf0e10cSrcweir	var arrAny= new Array( 100, 100.1235,"hallo");
75cdf0e10cSrcweir	var arrSeq= new Array( arr, arr, arr);
76cdf0e10cSrcweir	var arrSeq2= new Array( arrSeq, arrSeq, arrSeq)
77cdf0e10cSrcweir
78cdf0e10cSrcweir
79cdf0e10cSrcweir	var arrout1= new Array();
80cdf0e10cSrcweir	var arrout2= new Array();
81cdf0e10cSrcweir	var arrout3= new Array();
82cdf0e10cSrcweir
83cdf0e10cSrcweir	var ret, i;
84cdf0e10cSrcweir	var sfarray, sfarray1, sfarray2, sfarray3;
85cdf0e10cSrcweir	var arEventListener= new Array( new XEventListener_Impl(), new XEventListener_Impl(),
86cdf0e10cSrcweir	                                new XEventListener_Impl());
87cdf0e10cSrcweir	var arEventListener2= new Array( new XEventListener_Impl(), new XEventListener_Impl(),
88cdf0e10cSrcweir	                                new XEventListener_Impl());
89cdf0e10cSrcweir	var arArEventListener= new Array( arEventListener, arEventListener2);
90cdf0e10cSrcweir	switch( id)
91cdf0e10cSrcweir	{
92cdf0e10cSrcweir	// Array in-params
93cdf0e10cSrcweir	case 1: ret= oletest.methodByte( arr);
94cdf0e10cSrcweir		sfarray= new VBArray( ret);
95cdf0e10cSrcweir		document.writeln( "Param: " + arr.toString()  + "<br>");
96cdf0e10cSrcweir		document.writeln( "Returns a Sequence&lt BYTE &gt <br>" + sfarray.toArray()) ; break;
97cdf0e10cSrcweir
98cdf0e10cSrcweir	case 2: ret= oletest.methodDouble( arrDouble);
99cdf0e10cSrcweir		sfarray= new VBArray( ret);
100cdf0e10cSrcweir		document.writeln( "Param: " + arrDouble.toString() +"<br>");
101cdf0e10cSrcweir		document.writeln( "Returns a Sequence&lt double &gt <br>" + sfarray.toArray()) ; break;
102cdf0e10cSrcweir
103cdf0e10cSrcweir	case 3:	ret= oletest.methodBool( arrBool);
104cdf0e10cSrcweir		sfarray= new VBArray( ret);
105cdf0e10cSrcweir		document.writeln( "Param: " + arrBool.toString() +"<br>");
106cdf0e10cSrcweir		document.writeln( "Returns a Sequence&lt BOOL &gt <br>" + sfarray.toArray()) ; break;
107cdf0e10cSrcweir
108cdf0e10cSrcweir	case 4: ret= oletest.methodShort( arr);
109cdf0e10cSrcweir		sfarray= new VBArray( ret);
110cdf0e10cSrcweir		document.writeln( "Param: " + arr.toString() +"<br>");
111cdf0e10cSrcweir		document.writeln( "Returns a Sequence&lt SHORT &gt <br>" + sfarray.toArray()) ; break;
112cdf0e10cSrcweir
113cdf0e10cSrcweir	case 5: ret= oletest.methodUShort( arr);
114cdf0e10cSrcweir		sfarray= new VBArray( ret);
115cdf0e10cSrcweir		document.writeln( "Param: " + arr.toString() +"<br>");
116cdf0e10cSrcweir		document.writeln( "Returns a Sequence&lt unsigned SHORT &gt <br>" + sfarray.toArray()) ; break;
117cdf0e10cSrcweir
118cdf0e10cSrcweir	case 6: ret= oletest.methodLong( arr);
119cdf0e10cSrcweir		sfarray= new VBArray( ret);
120cdf0e10cSrcweir		document.writeln( "Param: " + arr.toString() +"<br>");
121cdf0e10cSrcweir		document.writeln( "Returns a Sequence&lt LONG &gt <br>" + sfarray.toArray()) ; break;
122cdf0e10cSrcweir
123cdf0e10cSrcweir	case 7:	ret= oletest.methodULong( arr);
124cdf0e10cSrcweir		sfarray= new VBArray( ret);
125cdf0e10cSrcweir		document.writeln( "Param: " + arr.toString() +"<br>");
126cdf0e10cSrcweir		document.writeln( "Returns a Sequence&lt unsigned LONG &gt <br>" + sfarray.toArray()) ; break;
127cdf0e10cSrcweir
128cdf0e10cSrcweir	case 8: ret= oletest.methodChar( arrChar);
129cdf0e10cSrcweir		sfarray= new VBArray( ret);
130cdf0e10cSrcweir		document.writeln( "Param: " + arrChar.toString() +"<br>");
131cdf0e10cSrcweir		document.writeln( "Returns a Sequence&lt wchar_t &gt <br>" + sfarray.toArray()) ; break;
132cdf0e10cSrcweir
133cdf0e10cSrcweir	case 9:	ret= oletest.methodString( arrString);
134cdf0e10cSrcweir		sfarray= new VBArray( ret);
135cdf0e10cSrcweir		document.writeln( "Param: " + arrString.toString() +"<br>");
136cdf0e10cSrcweir		document.writeln( "Returns a Sequence&lt UString &gt <br>" + sfarray.toArray()) ; break;
137cdf0e10cSrcweir
138cdf0e10cSrcweir	case 10: ret= oletest.methodAny( arrAny);
139cdf0e10cSrcweir		sfarray= new VBArray( ret);
140cdf0e10cSrcweir		document.writeln( "Param: " + arrAny.toString() +"<br>");
141cdf0e10cSrcweir		document.writeln( "Returns a Sequence&lt UsrAny &gt <br>" + sfarray.toArray() ) ; break;
142cdf0e10cSrcweir
143cdf0e10cSrcweir	case 11: ret= oletest.methodSequence( arrSeq);
144cdf0e10cSrcweir		sfarray= new VBArray( ret);
145cdf0e10cSrcweir		document.writeln( "Param: " + arrSeq.toString() +"<br>");
146cdf0e10cSrcweir		document.writeln("Returns a Sequence&lt Sequence &lt long &gt&gt <br>") ;
147cdf0e10cSrcweir		var arr1= new Array();
148cdf0e10cSrcweir		arr1= sfarray.toArray();
149cdf0e10cSrcweir		for( i=0; i < arr1.length; i++)
150cdf0e10cSrcweir		{
151cdf0e10cSrcweir			sfarray2= new VBArray( arr1[i]);
152cdf0e10cSrcweir			var arr2= new Array();
153cdf0e10cSrcweir			arr2= sfarray2.toArray();
154cdf0e10cSrcweir			document.writeln( arr2.toString() + "<br>" );
155cdf0e10cSrcweir		}
156cdf0e10cSrcweir		break;
157cdf0e10cSrcweir
158cdf0e10cSrcweir	case 12: ret= oletest.methodSequence2( arrSeq2);
159cdf0e10cSrcweir		document.writeln( "Param: " + arrSeq2.toString() +"<br>");
160cdf0e10cSrcweir		sfarray1= new VBArray( ret);
161cdf0e10cSrcweir		arr1= sfarray1.toArray();
162cdf0e10cSrcweir		for( i=0; i < arr1.length; i++)
163cdf0e10cSrcweir		{
164cdf0e10cSrcweir			sfarray2= new VBArray( arr1[i]);
165cdf0e10cSrcweir			arr2= sfarray2.toArray();
166cdf0e10cSrcweir
167cdf0e10cSrcweir			for ( j=0; j < arr2.length; j++)
168cdf0e10cSrcweir			{
169cdf0e10cSrcweir				sfarray3= new VBArray( arr2[j]);
170cdf0e10cSrcweir				arr3= sfarray3.toArray();
171cdf0e10cSrcweir				document.write( i+ " ");
172cdf0e10cSrcweir				document.writeln(j + ": "+ arr3.toString() + "<br>" );
173cdf0e10cSrcweir			}
174cdf0e10cSrcweir
175cdf0e10cSrcweir		}
176cdf0e10cSrcweir		break;
177cdf0e10cSrcweir
178cdf0e10cSrcweir	case 13:
179cdf0e10cSrcweir		var ar= new Array();
180cdf0e10cSrcweir		for( i=0; i< 3; i++)
181cdf0e10cSrcweir		{
182cdf0e10cSrcweir			var ob= new Object();
183cdf0e10cSrcweir			ob.value= "A JScript object!";
184cdf0e10cSrcweir			ar[i]= ob;
185cdf0e10cSrcweir		}
186cdf0e10cSrcweir
187cdf0e10cSrcweir		ret	=	oletest.methodXInterface( ar);
188cdf0e10cSrcweir		sfarray= new VBArray( ret);
189cdf0e10cSrcweir		var arRet= sfarray.toArray();
190cdf0e10cSrcweir
191cdf0e10cSrcweir		document.writeln( "Params : Array containing objects ")
192cdf0e10cSrcweir		for( index in ar)
193cdf0e10cSrcweir		{
194cdf0e10cSrcweir			document.writeln( "object " + index + ": " + ar[index].value +"  ");
195cdf0e10cSrcweir		}
196cdf0e10cSrcweir		document.writeln( "<br>" ) ;
197cdf0e10cSrcweir		document.writeln("Return: <br>");
198cdf0e10cSrcweir		for( index in arRet)
199cdf0e10cSrcweir		{
200cdf0e10cSrcweir			document.writeln( "object " + index + ": " + arRet[index].value + " ");
201cdf0e10cSrcweir		}
202cdf0e10cSrcweir		break;
203cdf0e10cSrcweir
204cdf0e10cSrcweir	case 14: ret= oletest.methodFloat( arrDouble);
205cdf0e10cSrcweir		sfarray= new VBArray( ret);
206cdf0e10cSrcweir		document.writeln( "Param: " + arrDouble.toString() +"<br>");
207cdf0e10cSrcweir		document.writeln( "Returns a Sequence&lt float&gt <br>" + sfarray.toArray()) ; break;
208cdf0e10cSrcweir
209cdf0e10cSrcweir	case 15:
210cdf0e10cSrcweir		ret= oletest.methodXEventListeners( arEventListener);
211cdf0e10cSrcweir		sfarray= new VBArray(ret);
212cdf0e10cSrcweir		_ret= sfarray.toArray();
213cdf0e10cSrcweir		for ( key in _ret)
214cdf0e10cSrcweir		{
215cdf0e10cSrcweir	           if( ! _ret[key].disposingCalled())
216cdf0e10cSrcweir		      alert("Error! oletest.methodXEventListeners")
217cdf0e10cSrcweir		}
218cdf0e10cSrcweir		break;
219cdf0e10cSrcweir	case 16:
220cdf0e10cSrcweir	   ret= oletest.methodXEventListenersMul( arArEventListener);
221cdf0e10cSrcweir	   sfarray= new VBArray(ret);
222cdf0e10cSrcweir	   _ret= sfarray.toArray();
223cdf0e10cSrcweir	   for( key in _ret)
224cdf0e10cSrcweir	   {
225cdf0e10cSrcweir	      sfarray2= new VBArray(_ret[key]);
226cdf0e10cSrcweir	      _ret2= sfarray2.toArray();
227cdf0e10cSrcweir	      for( key2 in _ret2)
228cdf0e10cSrcweir	      {
229cdf0e10cSrcweir	        if( ! _ret2[key2].disposingCalled())
230cdf0e10cSrcweir		      alert("Error! oletest.methodXEventListeners")
231cdf0e10cSrcweir	      }
232cdf0e10cSrcweir	   }
233cdf0e10cSrcweir	break;
234cdf0e10cSrcweir
235cdf0e10cSrcweir
236cdf0e10cSrcweir
237cdf0e10cSrcweir	// Properties: setting and getting values
238cdf0e10cSrcweir	case 200: oletest.AttrByte = arr;
239cdf0e10cSrcweir		ret= oletest.AttrByte;
240cdf0e10cSrcweir		document.writeln("Setting AttrByte: " + arr.toString() + "<p>");
241cdf0e10cSrcweir		document.writeln("Getting AttrByte: " + arr.toString()); break;
242cdf0e10cSrcweir
243cdf0e10cSrcweir	case 201: oletest.AttrDouble= arrDouble;
244cdf0e10cSrcweir		ret= oletest.AttrDouble;
245cdf0e10cSrcweir		document.writeln("Setting AttrDouble: " + arrDouble.toString() + "<p>");
246cdf0e10cSrcweir		document.writeln("Getting AttrDouble: " + arrDouble.toString()); break;
247cdf0e10cSrcweir
248cdf0e10cSrcweir	case 202: oletest.AttrBool= arrBool;
249cdf0e10cSrcweir		ret= oletest.AttrBool;
250cdf0e10cSrcweir		document.writeln("Setting AttrBool: " + arrBool.toString() + "<p>");
251cdf0e10cSrcweir		document.writeln("Getting AttrBool: " + arrBool.toString()); break;
252cdf0e10cSrcweir
253cdf0e10cSrcweir	case 203: oletest.AttrShort= arr;
254cdf0e10cSrcweir		ret= oletest.AttrShort;
255cdf0e10cSrcweir		document.writeln("Setting AttrShort: " + arr.toString() + "<p>");
256cdf0e10cSrcweir		document.writeln("Getting AttrShort: " + arr.toString()); break;
257cdf0e10cSrcweir
258cdf0e10cSrcweir	case 204: oletest.AttrUShort= arr;
259cdf0e10cSrcweir		ret= oletest.AttrUShort;
260cdf0e10cSrcweir		document.writeln("Setting AttrUShort: " + arr.toString() + "<p>");
261cdf0e10cSrcweir		document.writeln("Getting AttrUShort: " + arr.toString()); break;
262cdf0e10cSrcweir
263cdf0e10cSrcweir	case 205: oletest.AttrLong= arr;
264cdf0e10cSrcweir		ret= oletest.AttrLong;
265cdf0e10cSrcweir		document.writeln("Setting AttrLong: " + arr.toString() + "<p>");
266cdf0e10cSrcweir		document.writeln("Getting AttrLong: " + arr.toString()); break;
267cdf0e10cSrcweir
268cdf0e10cSrcweir	case 206: oletest.AttrULong= arr;
269cdf0e10cSrcweir		ret= oletest.AttrULong;
270cdf0e10cSrcweir		document.writeln("Setting AttrULong: " + arr.toString() + "<p>");
271cdf0e10cSrcweir		document.writeln("Getting AttrULong: " + arr.toString()); break;
272cdf0e10cSrcweir
273cdf0e10cSrcweir	case 207: oletest.AttrChar= arrChar;
274cdf0e10cSrcweir		ret= oletest.AttrChar;
275cdf0e10cSrcweir		document.writeln("Setting AttrChar: " + arrChar.toString() + "<p>");
276cdf0e10cSrcweir		document.writeln("Getting AttrChar: " + arrChar.toString()); break;
277cdf0e10cSrcweir
278cdf0e10cSrcweir	case 208: oletest.AttrString= arrString;
279cdf0e10cSrcweir		ret= oletest.AttrString;
280cdf0e10cSrcweir		document.writeln("Setting AttrString: " + arrString.toString() + "<p>");
281cdf0e10cSrcweir		document.writeln("Getting AttrString: " + arrString.toString()); break;
282cdf0e10cSrcweir
283cdf0e10cSrcweir	case 209: oletest.AttrAny= arrAny;
284cdf0e10cSrcweir		ret= oletest.AttrAny;
285cdf0e10cSrcweir		document.writeln("Setting AttrAny: " + arrAny.toString() + "<p>");
286cdf0e10cSrcweir		document.writeln("Getting AttrAny: " + arrAny.toString()); break;
287cdf0e10cSrcweir
288cdf0e10cSrcweir	case 210: oletest.AttrSequence= arrSeq;
289cdf0e10cSrcweir		ret= oletest.AttrSequence;
290cdf0e10cSrcweir		document.writeln("Setting AttrSequence: " + arrSeq.toString() + "<p>");
291cdf0e10cSrcweir		document.writeln("Getting AttrSequence: " + arrSeq.toString()); break;
292cdf0e10cSrcweir
293cdf0e10cSrcweir	case 211: oletest.AttrSequence2= arrSeq2;
294cdf0e10cSrcweir		ret= oletest.AttrSequence2;
295cdf0e10cSrcweir		document.writeln("Setting AttrSequence2: " + arrSeq2.toString() + "<p>");
296cdf0e10cSrcweir		document.writeln("Getting AttrSequence2: " + arrSeq2.toString()); break;
297cdf0e10cSrcweir
298cdf0e10cSrcweir	case 212: oletest.AttrFloat= arrDouble;
299cdf0e10cSrcweir		ret= oletest.AttrFloat;
300cdf0e10cSrcweir		document.writeln("Setting AttrFloat: " + arrDouble.toString() + "<p>");
301cdf0e10cSrcweir		document.writeln("Getting AttrFloat: " + arrDouble.toString()); break;
302cdf0e10cSrcweir
303cdf0e10cSrcweir
304cdf0e10cSrcweir
305cdf0e10cSrcweir	// Out-parameter ------------------------------------------------------------
306cdf0e10cSrcweir	case (2000):
307cdf0e10cSrcweir		oletest.testout_methodByte( arrout1 );
308cdf0e10cSrcweir		alert("byte: " + arrout1[0] ); 	break;
309cdf0e10cSrcweir	case (2001):
310cdf0e10cSrcweir		oletest.testout_methodDouble( arrout1 );
311cdf0e10cSrcweir		alert( "double: " + arrout1[0] ); break;
312cdf0e10cSrcweir	case (2002):
313cdf0e10cSrcweir		oletest.testout_methodBool( arrout1 );
314cdf0e10cSrcweir		alert( "boolean: " + arrout1[0] );	break;
315cdf0e10cSrcweir	case (2003):
316cdf0e10cSrcweir		oletest.testout_methodShort( arrout1 );
317cdf0e10cSrcweir		alert( "short: " + arrout1[0] ); break;
318cdf0e10cSrcweir	case (2004):
319cdf0e10cSrcweir		oletest.testout_methodUShort( arrout1 );
320cdf0e10cSrcweir		alert( "unsigned short: " + arrout1[0] ); break;
321cdf0e10cSrcweir	case (2005):
322cdf0e10cSrcweir		oletest.testout_methodLong( arrout1 );
323cdf0e10cSrcweir		alert( "long: " + arrout1[0] );	break;
324cdf0e10cSrcweir	case (2006):
325cdf0e10cSrcweir		oletest.testout_methodULong( arrout1 );
326cdf0e10cSrcweir		alert( "unsigned long: " + arrout1[0] ); break;
327cdf0e10cSrcweir	case (2007):
328cdf0e10cSrcweir		oletest.testout_methodChar( arrout1 );
329cdf0e10cSrcweir		alert( "char: " + arrout1[0] );	break;
330cdf0e10cSrcweir	case (2008):
331cdf0e10cSrcweir		oletest.testout_methodString( arrout1 );
332cdf0e10cSrcweir		alert( "string: " + arrout1[0] ); break;
333cdf0e10cSrcweir	case (2009):
334cdf0e10cSrcweir		oletest.testout_methodAny( arrout1 );
335cdf0e10cSrcweir		alert( "any: " + arrout1[0] );	break;
336cdf0e10cSrcweir	case (2010):
337cdf0e10cSrcweir		oletest.testout_methodSequence( arrout1 );
338cdf0e10cSrcweir		var sfarray= new VBArray( arrout1[0]);
339cdf0e10cSrcweir		arr= sfarray.toArray();
340cdf0e10cSrcweir		document.writeln("use the browser's back arrow to go to the previous page <p>");
341cdf0e10cSrcweir		document.writeln( arr.toString());
342cdf0e10cSrcweir		break;
343cdf0e10cSrcweir	case (2011):
344cdf0e10cSrcweir		oletest.testout_methodSequence2( arrout1 );
345cdf0e10cSrcweir		var sfarray= new VBArray( arrout1[0]);
346cdf0e10cSrcweir		arr= sfarray.toArray();
347cdf0e10cSrcweir		var i;
348cdf0e10cSrcweir		for( i=0; i < arr.length; i++)
349cdf0e10cSrcweir		{
350cdf0e10cSrcweir			var sfarray= new VBArray( arr[i]);
351cdf0e10cSrcweir			var arr2= new Array();
352cdf0e10cSrcweir			arr2= sfarray.toArray();
353cdf0e10cSrcweir			document.writeln( arr2.toString() + "<br>" );
354cdf0e10cSrcweir		}
355cdf0e10cSrcweir		break;
356cdf0e10cSrcweir	case (2012):
357cdf0e10cSrcweir		oletest.testout_methodMulParams1( arrout1, arrout2 );
358cdf0e10cSrcweir		document.writeln( "int : " + arrout1[0] + " int :" + arrout2[0] ); break;
359cdf0e10cSrcweir	case (2013):
360cdf0e10cSrcweir		oletest.testout_methodMulParams2( arrout1, arrout2, arrout3 );
361cdf0e10cSrcweir		document.writeln( "int: " + arrout1[0] + " int: " + arrout2[0] + " string: " + arrout3[0] ); break;
362cdf0e10cSrcweir	case (2014):
363cdf0e10cSrcweir		oletest.testout_methodMulParams3( "hallo", arrout1 );
364cdf0e10cSrcweir		document.writeln( "string: " + arrout1[0] ); break;
365cdf0e10cSrcweir	case (2015):
366cdf0e10cSrcweir		oletest.testout_methodXInterface( arrout1 );
367cdf0e10cSrcweir		var outVal= arrout1[0];
368cdf0e10cSrcweir		alert( outVal.AttrAny2);
369cdf0e10cSrcweir		document.writeln( "string: " + arrout1[0].AttrAny2); break;
370cdf0e10cSrcweir	case (2016):
371cdf0e10cSrcweir		oletest.testout_methodFloat( arrout1 );
372cdf0e10cSrcweir		alert( "float: " + arrout1[0] ); break;
373cdf0e10cSrcweir	case (2017):
374cdf0e10cSrcweir		var in1= 3.14;
375cdf0e10cSrcweir		var in2= 1111;
376cdf0e10cSrcweir		var in3= -2222;
377cdf0e10cSrcweir		oletest.testout_methodMulParams4( in1, arrout1, in2, arrout2, in3 );
378cdf0e10cSrcweir		document.write("param1 [in] float: " + in1 + " param2 [out] float: " + arrout1[0] +
379cdf0e10cSrcweir					" param3 [in] long: " + in2 + " param4 [out] long: " + arrout2[0] +
380cdf0e10cSrcweir					" param5 [in] long: " + in3);
381cdf0e10cSrcweir		break;
382cdf0e10cSrcweir
383cdf0e10cSrcweir
384cdf0e10cSrcweir	// INOUT - Parameter -------------------------------------------------------------------------------
385cdf0e10cSrcweir	// The in value has to be placed on index 0 of the passed in array
386cdf0e10cSrcweir	case (500):
387cdf0e10cSrcweir		arrout1[0]= 100;
388cdf0e10cSrcweir		oletest.testinout_methodByte( arrout1 );
389cdf0e10cSrcweir		alert("byte: " + arrout1[0] ); 	break;
390cdf0e10cSrcweir	case (501):
391cdf0e10cSrcweir		arrout1[0]= 3.14;
392cdf0e10cSrcweir		oletest.testinout_methodDouble( arrout1 );
393cdf0e10cSrcweir		alert( "double: " + arrout1[0] ); break;
394cdf0e10cSrcweir	case (502):
395cdf0e10cSrcweir		arrout1[0]= false;
396cdf0e10cSrcweir		oletest.testinout_methodBool( arrout1 );
397cdf0e10cSrcweir		alert( "boolean: " + arrout1[0] );	break;
398cdf0e10cSrcweir	case (503):
399cdf0e10cSrcweir		arrout1[0]= 200;
400cdf0e10cSrcweir		oletest.testinout_methodShort( arrout1 );
401cdf0e10cSrcweir		alert( "short: " + arrout1[0] ); break;
402cdf0e10cSrcweir	case (504):
403cdf0e10cSrcweir		arrout1[0]= 300;
404cdf0e10cSrcweir		oletest.testinout_methodUShort( arrout1 );
405cdf0e10cSrcweir		alert( "unsigned short: " + arrout1[0] ); break;
406cdf0e10cSrcweir	case (505):
407cdf0e10cSrcweir		arrout1[0]= 400;
408cdf0e10cSrcweir		oletest.testinout_methodLong( arrout1 );
409cdf0e10cSrcweir		alert( "long: " + arrout1[0] );	break;
410cdf0e10cSrcweir	case (506):
411cdf0e10cSrcweir		arrout1[0]= 500;
412cdf0e10cSrcweir		oletest.testinout_methodULong( arrout1 );
413cdf0e10cSrcweir		alert( "unsigned long: " + arrout1[0] ); break;
414cdf0e10cSrcweir	case (507):
415cdf0e10cSrcweir		arrout1[0]= "A";
416cdf0e10cSrcweir		oletest.testinout_methodChar( arrout1 );
417cdf0e10cSrcweir		alert( "char: " + arrout1[0] );	break;
418cdf0e10cSrcweir	case (508):
419cdf0e10cSrcweir		arrout1[0]= "I am a string";
420cdf0e10cSrcweir		oletest.testinout_methodString( arrout1 );
421cdf0e10cSrcweir		alert( "string: " + arrout1[0] ); break;
422cdf0e10cSrcweir	case (509):
423cdf0e10cSrcweir		arrout1[0]= arr;
424cdf0e10cSrcweir		oletest.testinout_methodAny( arrout1 ); // the method simply returns the argument
425cdf0e10cSrcweir		sfarray= new VBArray( arrout1[0]);
426cdf0e10cSrcweir		arr= sfarray.toArray();
427cdf0e10cSrcweir		alert( "any: " + arr.toString() );	break;
428cdf0e10cSrcweir	case (510):
429cdf0e10cSrcweir		arrout1[0]= arr;
430cdf0e10cSrcweir		oletest.testinout_methodSequence( arrout1 );
431cdf0e10cSrcweir		var sfarray= new VBArray( arrout1[0]);
432cdf0e10cSrcweir		arr= sfarray.toArray();
433cdf0e10cSrcweir		document.writeln("use the browser's back arrow to go to the previous page <p>");
434cdf0e10cSrcweir		document.writeln( arr.toString());
435cdf0e10cSrcweir		break;
436cdf0e10cSrcweir	case (511):
437cdf0e10cSrcweir		arrout1[0]= arrSeq;
438cdf0e10cSrcweir		oletest.testinout_methodSequence2( arrout1 );
439cdf0e10cSrcweir		var sfarray= new VBArray( arrout1[0]);
440cdf0e10cSrcweir		arr= sfarray.toArray();
441cdf0e10cSrcweir		var i;
442cdf0e10cSrcweir		for( i=0; i < arr.length; i++)
443cdf0e10cSrcweir		{
444cdf0e10cSrcweir			var sfarray= new VBArray( arr[i]);
445cdf0e10cSrcweir			var arr2= new Array();
446cdf0e10cSrcweir			arr2= sfarray.toArray();
447cdf0e10cSrcweir			document.writeln( arr2.toString() + "<br>" );
448cdf0e10cSrcweir		}
449cdf0e10cSrcweir		break;
450cdf0e10cSrcweir	case 512:
451cdf0e10cSrcweir		var ob= new Object();
452cdf0e10cSrcweir		ob.value= "this is a string";
453cdf0e10cSrcweir
454cdf0e10cSrcweir		arrout1[0]= ob;
455cdf0e10cSrcweir		alert (arrout1[0].value);
456cdf0e10cSrcweir		oletest.testinout_methodXInterface( arrout1);
457cdf0e10cSrcweir		alert (arrout1[0].value);
458cdf0e10cSrcweir		var outValue= arrout1[0];
459cdf0e10cSrcweir		for ( key in outValue)
460cdf0e10cSrcweir		{
461cdf0e10cSrcweir			document.write( outValue[key] );
462cdf0e10cSrcweir		}
463cdf0e10cSrcweir		document.write("Out value: " + outValue );
464cdf0e10cSrcweir		document.write("Out 1 value: " + arrout1[1]);
465cdf0e10cSrcweir		break;
466cdf0e10cSrcweir
467cdf0e10cSrcweir//	 	var ob= new Object();
468cdf0e10cSrcweir//		ob.value= "this is a string";
469cdf0e10cSrcweir//		inoutValue.Set( "object", ob);
470cdf0e10cSrcweir//		oletest.testinout_methodXInterface( inoutValue);
471cdf0e10cSrcweir//		document.write("Out value: " + inoutValue.Get().value );
472cdf0e10cSrcweir//		break;
473cdf0e10cSrcweir
474cdf0e10cSrcweir	case (513):
475cdf0e10cSrcweir		arrout1[0]= 3.14;
476cdf0e10cSrcweir		oletest.testinout_methodFloat( arrout1 );
477cdf0e10cSrcweir		alert( "float: " + arrout1[0] ); break;
478cdf0e10cSrcweir
479cdf0e10cSrcweir
480cdf0e10cSrcweir
481cdf0e10cSrcweir	// Test ANY
482cdf0e10cSrcweir	// Methods
483cdf0e10cSrcweir	case 1000:
484cdf0e10cSrcweir		i= 100;
485cdf0e10cSrcweir		ret= oletest.methodAnyTest1( i);
486cdf0e10cSrcweir		document.writeln( "in: " + i + " ret: " + ret);
487cdf0e10cSrcweir		break;
488cdf0e10cSrcweir	case 1001:
489cdf0e10cSrcweir		i= 3.14;
490cdf0e10cSrcweir		ret= oletest.methodAnyTest1( i);
491cdf0e10cSrcweir		document.writeln( "in: " + i + " ret: " + ret);
492cdf0e10cSrcweir		break;
493cdf0e10cSrcweir	case 1002:
494cdf0e10cSrcweir		i= "Hallo"
495cdf0e10cSrcweir		ret= oletest.methodAnyTest1( i);
496cdf0e10cSrcweir		document.writeln( "in: " + i + " ret: " + ret);
497cdf0e10cSrcweir		break;
498cdf0e10cSrcweir	case 1003:
499cdf0e10cSrcweir		i= arr;
500cdf0e10cSrcweir		ret= oletest.methodAnyTest1( i);
501cdf0e10cSrcweir		sfarray= new VBArray( ret);
502cdf0e10cSrcweir		document.writeln( "in: " + i + " ret: " + sfarray.toArray());
503cdf0e10cSrcweir		break;
504cdf0e10cSrcweir	case 1004:
505cdf0e10cSrcweir		var obj= new Object();
506cdf0e10cSrcweir		obj[1]= "This is index 0";
507cdf0e10cSrcweir		ret= oletest.methodAnyTest1( obj);
508cdf0e10cSrcweir		document.writeln( "in: " + obj + " ret: " + ret);
509cdf0e10cSrcweir		break;
510cdf0e10cSrcweir
511cdf0e10cSrcweir
512cdf0e10cSrcweir	// Test ANY property
513cdf0e10cSrcweir	case 1010:
514cdf0e10cSrcweir		i= 100;
515cdf0e10cSrcweir		oletest.AttrAny2= i;
516cdf0e10cSrcweir		ret= oletest.AttrAny2;
517cdf0e10cSrcweir		document.writeln( "set: " + i + " get: " + ret);
518cdf0e10cSrcweir		break;
519cdf0e10cSrcweir	case 1011:
520cdf0e10cSrcweir		i= 3.14;
521cdf0e10cSrcweir		oletest.AttrAny2= i;
522cdf0e10cSrcweir		ret= oletest.AttrAny2;
523cdf0e10cSrcweir		document.writeln( "set: " + i + " get: " + ret);
524cdf0e10cSrcweir		break;
525cdf0e10cSrcweir	case 1012:
526cdf0e10cSrcweir		i= "Hallo"
527cdf0e10cSrcweir		oletest.AttrAny2= i;
528cdf0e10cSrcweir		ret= oletest.AttrAny2;
529cdf0e10cSrcweir		document.writeln( "set: " + i + " get: " + ret);
530cdf0e10cSrcweir		break;
531cdf0e10cSrcweir	case 1013:
532cdf0e10cSrcweir		i= arr;
533cdf0e10cSrcweir		oletest.AttrAny2= i;
534cdf0e10cSrcweir		ret= oletest.AttrAny2;
535cdf0e10cSrcweir		sfarray= new VBArray( ret);
536cdf0e10cSrcweir		document.writeln( "set: " + i + " get: " + sfarray.toArray());
537cdf0e10cSrcweir		break;
538cdf0e10cSrcweir	case 1014:
539cdf0e10cSrcweir		var obj= new Object();
540cdf0e10cSrcweir		obj[1]= "This is index 0";
541cdf0e10cSrcweir		oletest.AttrAny2= obj;
542cdf0e10cSrcweir		ret= oletest.AttrAny2;
543cdf0e10cSrcweir		document.writeln( "set: " + obj + " get: " + ret);
544cdf0e10cSrcweir		break;
545cdf0e10cSrcweir
546cdf0e10cSrcweir	// Structs ----------------------------------------------
547cdf0e10cSrcweir	case 1020:
548cdf0e10cSrcweir		 var struct= oletest._GetStruct("com.sun.star.beans.Property");
549cdf0e10cSrcweir		 struct.Attributes= 1;
550cdf0e10cSrcweir		 struct.Handle= 2;
551cdf0e10cSrcweir		 struct.Name= "some Property"
552cdf0e10cSrcweir		 oletest.methodStruct( struct);
553cdf0e10cSrcweir		 break;
554cdf0e10cSrcweir	case 1021:
555cdf0e10cSrcweir		var struct= oletest.retMethodStruct();
556cdf0e10cSrcweir		alert( "Property::Attributes : " + struct.Attributes + " \nProperty::Handle : "
557cdf0e10cSrcweir		+ struct.Handle + "\n Property::Name : " + struct.Name);
558cdf0e10cSrcweir		break;
559cdf0e10cSrcweir	case 1022:
560cdf0e10cSrcweir		 var struct= oletest._GetStruct("com.sun.star.beans.Property");
561cdf0e10cSrcweir		 struct.Attributes= 1;
562cdf0e10cSrcweir		 struct.Handle= 2;
563cdf0e10cSrcweir		 struct.Name= "some Property"
564cdf0e10cSrcweir		 oletest.AttrStruct=  struct;
565cdf0e10cSrcweir
566cdf0e10cSrcweir		 var struct2= oletest.AttrStruct;
567cdf0e10cSrcweir		alert( "property get: \n Property::Attributes : " + struct2.Attributes + " \nProperty::Handle : "
568cdf0e10cSrcweir		+ struct2.Handle + "\n Property::Name : " + struct2.Name);
569cdf0e10cSrcweir		break;
570cdf0e10cSrcweir
571cdf0e10cSrcweir	case 2100:
572cdf0e10cSrcweir		alert("2100");
573cdf0e10cSrcweir		var ret= oletest.retMethodByte();
574cdf0e10cSrcweir		var sfarray= VBArray( ret);
575cdf0e10cSrcweir		document.writeln( sfarray.toArray() );
576cdf0e10cSrcweir		break;
577cdf0e10cSrcweir
578cdf0e10cSrcweir
579cdf0e10cSrcweir
580cdf0e10cSrcweir	}
581cdf0e10cSrcweir
582cdf0e10cSrcweir}
583cdf0e10cSrcweir
584cdf0e10cSrcweirfunction funcOut( out)
585cdf0e10cSrcweir{
586cdf0e10cSrcweir	out["du"]= 0xffff;
587cdf0e10cSrcweir}
588cdf0e10cSrcweir
589cdf0e10cSrcweir</script>
590cdf0e10cSrcweir
591cdf0e10cSrcweir<script language="VBScript">
592cdf0e10cSrcweir
593cdf0e10cSrcweirsub callBasic(id)
594cdf0e10cSrcweir
595cdf0e10cSrcweir	Dim factory
596cdf0e10cSrcweir	Set	factory= GetObject("", "com.sun.star.ServiceManager")
597cdf0e10cSrcweir
598cdf0e10cSrcweir	Set	oletest= factory.createInstance("oletest.OleTest")
599cdf0e10cSrcweir
600cdf0e10cSrcweir
601cdf0e10cSrcweir	arrInt= Array(1,2,3,4,5)
602cdf0e10cSrcweir	arrInt2= Array( -1, -2, 127, 128, 0)
603cdf0e10cSrcweir	arrDouble= Array(1.1, 2.2, 3.3, 4.4, 5.5)
604cdf0e10cSrcweir	arrBool= Array(0,1,0,2,0)
605cdf0e10cSrcweir	arrLong= Array( &Hff, &Hffff, &Hffffff, &Hffffffff)
606cdf0e10cSrcweir	arrString= Array("Chicken Wings", "Cheeseburger", "Hamburger")
607cdf0e10cSrcweir	arrChar= Array("a",65, "M")
608cdf0e10cSrcweir	arrAny= Array("Mickey", 3.14, 100, "A")
609cdf0e10cSrcweir
610cdf0e10cSrcweir	Dim arrDim2Int(1,1)
611cdf0e10cSrcweir	For i= 0 To 1
612cdf0e10cSrcweir		For j= 0 To 1
613cdf0e10cSrcweir			arrDim2Int(i,j) = i*2 + j
614cdf0e10cSrcweir		Next
615cdf0e10cSrcweir	Next
616cdf0e10cSrcweir
617cdf0e10cSrcweir	Dim arrDim3Int(1,1,1)
618cdf0e10cSrcweir	For i= 0 To 1
619cdf0e10cSrcweir		For j= 0 To 1
620cdf0e10cSrcweir			For k=0 To 1
621cdf0e10cSrcweir				arrDim3Int(i,j,k) = i*2 + j*2 + k
622cdf0e10cSrcweir			Next
623cdf0e10cSrcweir		Next
624cdf0e10cSrcweir	Next
625cdf0e10cSrcweir
626cdf0e10cSrcweir
627cdf0e10cSrcweir	select case id
628cdf0e10cSrcweir		case 0
629cdf0e10cSrcweir			document.writeln "param: "
630cdf0e10cSrcweir			printArray arrInt
631cdf0e10cSrcweir			ret= oletest.methodByte(arrInt)
632cdf0e10cSrcweir			document.writeln "<br> return value: "
633cdf0e10cSrcweir			printArray ret
634cdf0e10cSrcweir		case 1
635cdf0e10cSrcweir			document.writeln "param: "
636cdf0e10cSrcweir			printArray arrDouble
637cdf0e10cSrcweir			ret= oletest.methodDouble(arrDouble)
638cdf0e10cSrcweir			document.writeln "<br> return value: "
639cdf0e10cSrcweir			printArray ret
640cdf0e10cSrcweir		case 2
641cdf0e10cSrcweir			document.writeln "param: "
642cdf0e10cSrcweir			printArray arrBool
643cdf0e10cSrcweir			ret= oletest.methodBool(arrBool)
644cdf0e10cSrcweir			document.writeln "<br> return value: "
645cdf0e10cSrcweir			printArray ret
646cdf0e10cSrcweir		case 3
647cdf0e10cSrcweir			document.writeln "param: "
648cdf0e10cSrcweir			printArray arrInt2
649cdf0e10cSrcweir			ret= oletest.methodShort(arrInt2)
650cdf0e10cSrcweir			document.writeln "<br> return value: "
651cdf0e10cSrcweir			printArray ret
652cdf0e10cSrcweir		case 4
653cdf0e10cSrcweir			document.writeln "param: "
654cdf0e10cSrcweir			printArray arrInt
655cdf0e10cSrcweir			ret= oletest.methodUShort(arrInt)
656cdf0e10cSrcweir			document.writeln "<br> return value: "
657cdf0e10cSrcweir			printArray ret
658cdf0e10cSrcweir		case 5
659cdf0e10cSrcweir			document.writeln "param: "
660cdf0e10cSrcweir			printArray arrLong
661cdf0e10cSrcweir			ret= oletest.methodLong(arrLong)
662cdf0e10cSrcweir			document.writeln "<br> return value: "
663cdf0e10cSrcweir			printArray ret
664cdf0e10cSrcweir		case 6
665cdf0e10cSrcweir			document.writeln "param: "
666cdf0e10cSrcweir			printArray arrInt
667cdf0e10cSrcweir			ret= oletest.methodULong(arrInt)
668cdf0e10cSrcweir			document.writeln "<br> return value: "
669cdf0e10cSrcweir			printArray ret
670cdf0e10cSrcweir		case 7
671cdf0e10cSrcweir			document.writeln "param: "
672cdf0e10cSrcweir			printArray arrString
673cdf0e10cSrcweir			ret= oletest.methodString(arrString)
674cdf0e10cSrcweir			document.writeln "<br> return value: "
675cdf0e10cSrcweir			printArray ret
676cdf0e10cSrcweir		case 8
677cdf0e10cSrcweir			document.writeln "param: "
678cdf0e10cSrcweir			printArray arrChar
679cdf0e10cSrcweir			ret= oletest.methodChar(arrChar)
680cdf0e10cSrcweir			document.writeln "<br> return value: "
681cdf0e10cSrcweir			printArray ret
682cdf0e10cSrcweir		case 9
683cdf0e10cSrcweir			document.writeln "param: "
684cdf0e10cSrcweir			printArray arrAny
685cdf0e10cSrcweir			ret= oletest.methodAny(arrAny)
686cdf0e10cSrcweir			document.writeln "<br> return value: "
687cdf0e10cSrcweir			printArray ret
688cdf0e10cSrcweir		case 10
689cdf0e10cSrcweir			document.writeln "param: "
690cdf0e10cSrcweir			printArray2 arrDim2Int
691cdf0e10cSrcweir			ret= oletest.methodSequence(arrDim2Int)
692cdf0e10cSrcweir			document.writeln "<br> return value: "
693cdf0e10cSrcweir			for each val in ret
694cdf0e10cSrcweir				document.write "<br> array: "
695cdf0e10cSrcweir				for each val2 in val
696cdf0e10cSrcweir					document.write val2
697cdf0e10cSrcweir				next
698cdf0e10cSrcweir			next
699cdf0e10cSrcweir
700cdf0e10cSrcweir	// Out Parameter
701cdf0e10cSrcweir		case 150
702cdf0e10cSrcweir			dim rOut
703cdf0e10cSrcweir			oletest.testout_methodByte rOut
704cdf0e10cSrcweir			MsgBox rOut
705cdf0e10cSrcweir//	void testout_methodFloat( [out] float rOut);
706cdf0e10cSrcweir//	void testout_methodDouble( [out] double rOut);
707cdf0e10cSrcweir//	void testout_methodBool( [out] boolean rOut);
708cdf0e10cSrcweir//	void testout_methodShort( [out] short rOut);
709cdf0e10cSrcweir//	void testout_methodUShort( [out] unsigned short rOut);
710cdf0e10cSrcweir//	void testout_methodLong( [out]  long rOut);
711cdf0e10cSrcweir//	void testout_methodULong( [out] unsigned long rOut);
712cdf0e10cSrcweir
713cdf0e10cSrcweir
714cdf0e10cSrcweir // In Out Parameter --------------------------------------------------
715cdf0e10cSrcweir		case 100
716cdf0e10cSrcweir			a= 100
717cdf0e10cSrcweir			document.write "param: " & CStr(  a) & "<br>"
718cdf0e10cSrcweir			oletest.testinout_methodByte a
719cdf0e10cSrcweir			document.write a
720cdf0e10cSrcweir		case 101
721cdf0e10cSrcweir			a= 1.11
722cdf0e10cSrcweir			document.write "param: " & CStr(  a) & "<br>"
723cdf0e10cSrcweir			oletest.testinout_methodDouble a
724cdf0e10cSrcweir			document.write a
725cdf0e10cSrcweir		case 102
726cdf0e10cSrcweir			a= 5
727cdf0e10cSrcweir			document.write "param: "& CStr(  a) & "<br>"
728cdf0e10cSrcweir			oletest.testinout_methodBool a
729cdf0e10cSrcweir			document.write a
730cdf0e10cSrcweir		case 103
731cdf0e10cSrcweir			a= -10
732cdf0e10cSrcweir			document.write "param: "& CStr(  a) & "<br>"
733cdf0e10cSrcweir			oletest.testinout_methodShort a
734cdf0e10cSrcweir			document.write a
735cdf0e10cSrcweir		case 104
736cdf0e10cSrcweir			a= 128
737cdf0e10cSrcweir			document.write "param: "& CStr(  a) & "<br>"
738cdf0e10cSrcweir			oletest.testinout_methodUShort a
739cdf0e10cSrcweir			document.write a
740cdf0e10cSrcweir		case 105
741cdf0e10cSrcweir			a= 65556
742cdf0e10cSrcweir			document.write "param: "& CStr(  a) & "<br>"
743cdf0e10cSrcweir			oletest.testinout_methodLong a
744cdf0e10cSrcweir			document.write a
745cdf0e10cSrcweir		case 106
746cdf0e10cSrcweir			a= 65556
747cdf0e10cSrcweir			document.write "param: "& CStr(  a) & "<br>"
748cdf0e10cSrcweir			oletest.testinout_methodULong a
749cdf0e10cSrcweir			document.write a
750cdf0e10cSrcweir		case 107
751cdf0e10cSrcweir			a= "ein test string"
752cdf0e10cSrcweir			document.write "param: "& CStr(  a) & "<br>"
753cdf0e10cSrcweir			oletest.testinout_methodString a
754cdf0e10cSrcweir			document.write a
755cdf0e10cSrcweir		case 108
756cdf0e10cSrcweir			a= "W"
757cdf0e10cSrcweir			document.write "param: "& CStr(  a) & "<br>"
758cdf0e10cSrcweir			oletest.testinout_methodChar a
759cdf0e10cSrcweir			document.write a
760cdf0e10cSrcweir		case 109
761cdf0e10cSrcweir			a= "Ein String im Any"
762cdf0e10cSrcweir			document.write "param: "& CStr(  a) & "<br>"
763cdf0e10cSrcweir			oletest.other_methodAnyIn a
764cdf0e10cSrcweir			document.write a
765cdf0e10cSrcweir
766cdf0e10cSrcweir		case 150
767cdf0e10cSrcweir			dim a
768cdf0e10cSrcweir			document.write "param: "& CStr(  a) & "<br>"
769cdf0e10cSrcweir			oletest.testout_methodByte( a)
770cdf0e10cSrcweir			document.write a
771cdf0e10cSrcweir// Attributes -----------------------------------------------------------------
772cdf0e10cSrcweir		case 200
773cdf0e10cSrcweir			document.write "set: "
774cdf0e10cSrcweir			printArray arrInt
775cdf0e10cSrcweir			oletest.AttrByte= arrInt
776cdf0e10cSrcweir			b= oletest.AttrByte
777cdf0e10cSrcweir			call printArrayEx( "<br> get: ", "<br>", b)
778cdf0e10cSrcweir		case 201
779cdf0e10cSrcweir			document.write "set: "
780cdf0e10cSrcweir			printArray arrDouble
781cdf0e10cSrcweir			oletest.AttrDouble= arrDouble
782cdf0e10cSrcweir			b= oletest.AttrDouble
783cdf0e10cSrcweir			call printArrayEx( "<br> get: ", "<br>", b)
784cdf0e10cSrcweir		case 202
785cdf0e10cSrcweir			document.write "set: "
786cdf0e10cSrcweir			printArray arrBool :
787cdf0e10cSrcweir			oletest.AttrBool= arrBool
788cdf0e10cSrcweir			b= oletest.AttrBool
789cdf0e10cSrcweir			call printArrayEx( "<br> get: ", "<br>", b)
790cdf0e10cSrcweir		case 203
791cdf0e10cSrcweir			document.write "set: "
792cdf0e10cSrcweir			printArray arrInt2 :
793cdf0e10cSrcweir			oletest.AttrShort= arrInt2
794cdf0e10cSrcweir			b= oletest.AttrShort
795cdf0e10cSrcweir			call printArrayEx( "<br> get: ", "<br>", b)
796cdf0e10cSrcweir		case 204
797cdf0e10cSrcweir			document.write "set: "
798cdf0e10cSrcweir			printArray arrInt
799cdf0e10cSrcweir			oletest.AttrUShort= arrInt
800cdf0e10cSrcweir			b= oletest.AttrUShort
801cdf0e10cSrcweir			call printArrayEx( "<br> get: ", "<br>", b)
802cdf0e10cSrcweir		case 205
803cdf0e10cSrcweir			document.write "set: "
804cdf0e10cSrcweir			printArray arrInt2
805cdf0e10cSrcweir			oletest.AttrLong= arrInt2
806cdf0e10cSrcweir			b= oletest.AttrLong
807cdf0e10cSrcweir			call printArrayEx( "<br> get: ", "<br>", b)
808cdf0e10cSrcweir		case 206
809cdf0e10cSrcweir			document.write "set: "
810cdf0e10cSrcweir			printArray arrInt
811cdf0e10cSrcweir			oletest.AttrULong= arrInt
812cdf0e10cSrcweir			b= oletest.AttrULong
813cdf0e10cSrcweir			call printArrayEx( "<br> get: ", "<br>", b)
814cdf0e10cSrcweir		case 207
815cdf0e10cSrcweir			document.write "set: "
816cdf0e10cSrcweir			printArray arrString
817cdf0e10cSrcweir			oletest.AttrString= arrString
818cdf0e10cSrcweir			b= oletest.AttrString
819cdf0e10cSrcweir			call printArrayEx( "<br> get: ", "<br>", b)
820cdf0e10cSrcweir		case 208
821cdf0e10cSrcweir			document.write "set: "
822cdf0e10cSrcweir			printArray arrChar
823cdf0e10cSrcweir			oletest.AttrChar= arrChar
824cdf0e10cSrcweir			b= oletest.AttrChar
825cdf0e10cSrcweir			call printArrayEx( "<br> get: ", "<br>", b)
826cdf0e10cSrcweir		case 209
827cdf0e10cSrcweir			document.write "set: "
828cdf0e10cSrcweir			printArray arrAny
829cdf0e10cSrcweir			oletest.AttrAny= arrAny
830cdf0e10cSrcweir			b= oletest.AttrAny
831cdf0e10cSrcweir			call printArrayEx( "<br> get: ", "<br>", b)
832cdf0e10cSrcweir
833cdf0e10cSrcweir		case 210
834cdf0e10cSrcweir			document.write "set: <br>"
835cdf0e10cSrcweir			printArray2 arrDim2Int :
836cdf0e10cSrcweir			oletest.AttrSequence= arrDim2Int
837cdf0e10cSrcweir			ret= oletest.AttrSequence
838cdf0e10cSrcweir			document.write "get: "
839cdf0e10cSrcweir			for each val in ret
840cdf0e10cSrcweir				document.write "<br> array: "
841cdf0e10cSrcweir				for each val2 in val
842cdf0e10cSrcweir					document.write val2
843cdf0e10cSrcweir				next
844cdf0e10cSrcweir			next
845cdf0e10cSrcweir
846cdf0e10cSrcweir		case 300
847cdf0e10cSrcweir			dim aByte
848cdf0e10cSrcweir			aByte= 100
849cdf0e10cSrcweir			call oletest.testinout_methodByte( aByte)
850cdf0e10cSrcweir			MsgBox aByte
851cdf0e10cSrcweir
852cdf0e10cSrcweir
853cdf0e10cSrcweir		case 400
854cdf0e10cSrcweir
855cdf0e10cSrcweir		set  struct= oletest.Bridge_GetStruct("com.sun.star.beans.Property")
856cdf0e10cSrcweir		 struct.Attributes= 1
857cdf0e10cSrcweir		 struct.Handle= 2
858cdf0e10cSrcweir		 struct.Name= "some Property"
859cdf0e10cSrcweir		 oletest.methodStruct struct
860cdf0e10cSrcweir
861cdf0e10cSrcweir	case 401
862cdf0e10cSrcweir		set struct= oletest.retMethodStruct()
863cdf0e10cSrcweir		alert( "Property::Attributes : " & struct.Attributes & vblf & " Property::Handle : " _
864cdf0e10cSrcweir		& struct.Handle & vblf & " Property::Name : " & struct.Name)
865cdf0e10cSrcweir
866cdf0e10cSrcweir	case 402
867cdf0e10cSrcweir		set struct= oletest.Bridge_GetStruct("com.sun.star.beans.Property")
868cdf0e10cSrcweir		 struct.Attributes= 1
869cdf0e10cSrcweir		 struct.Handle= 2
870cdf0e10cSrcweir		 struct.Name= "some Property"
871cdf0e10cSrcweir		 oletest.AttrStruct=  struct
872cdf0e10cSrcweir
873cdf0e10cSrcweir		 set struct2= oletest.AttrStruct
874cdf0e10cSrcweir		alert( "property get: " & vblf & "Property::Attributes : " & struct2.Attributes & _
875cdf0e10cSrcweir		vblf & " Property::Handle : " &  struct2.Handle & vblf & " Property::Name : " _
876cdf0e10cSrcweir		& struct2.Name)
877cdf0e10cSrcweir	end select
878cdf0e10cSrcweirend sub
879cdf0e10cSrcweir
880cdf0e10cSrcweirsub printArray( arr)
881cdf0e10cSrcweir	document.write "array: "
882cdf0e10cSrcweir	For Each val In arr
883cdf0e10cSrcweir		document.write CStr(val) & " "
884cdf0e10cSrcweir	Next
885cdf0e10cSrcweirend sub
886cdf0e10cSrcweir
887cdf0e10cSrcweir// print a 2 dimensional Array
888cdf0e10cSrcweir
889cdf0e10cSrcweirsub printArray2( arr)
890cdf0e10cSrcweir		elements1= UBound( arr, 1) - LBound( arr, 1) +1
891cdf0e10cSrcweir		elements2= UBound( arr, 2) - LBound( arr, 2) +1
892cdf0e10cSrcweir
893cdf0e10cSrcweir		For i=0 To elements1 -1
894cdf0e10cSrcweir			document.write( "array " & CStr( i) & ": "  )
895cdf0e10cSrcweir			For j=0 To elements2 -1
896cdf0e10cSrcweir				document.write CStr( arr(i,j))
897cdf0e10cSrcweir			Next
898cdf0e10cSrcweir			document.write( "<br>")
899cdf0e10cSrcweir		Next
900cdf0e10cSrcweirend sub
901cdf0e10cSrcweir
902cdf0e10cSrcweirsub printArrayEx( pre, post, array)
903cdf0e10cSrcweir	document.write pre
904cdf0e10cSrcweir	printArray array
905cdf0e10cSrcweir	document.write post
906cdf0e10cSrcweirend sub
907cdf0e10cSrcweir</script>
908cdf0e10cSrcweir
909cdf0e10cSrcweir<div id=out> </div>
910cdf0e10cSrcweir
911cdf0e10cSrcweir<!-- Insert HTML here -->
912cdf0e10cSrcweir
913cdf0e10cSrcweir<h2> JScript </h2>
914cdf0e10cSrcweirTests Array/Sequence conversion.<br>
915cdf0e10cSrcweirAll methods receive a Sequence as Parameter. The element type of the Sequence is written on the buttons.
916cdf0e10cSrcweir<br>
917cdf0e10cSrcweir<button onclick='callOleTest( 1)'>byte</Button>
918cdf0e10cSrcweir<button onclick='callOleTest( 14)'>float</Button>
919cdf0e10cSrcweir<button onclick='callOleTest( 2)'>double</Button>
920cdf0e10cSrcweir<button onclick='callOleTest( 3)'>boolean</Button>
921cdf0e10cSrcweir<button onclick='callOleTest( 4)'>short</Button>
922cdf0e10cSrcweir<button onclick='callOleTest( 5)'>unsigned short</Button>
923cdf0e10cSrcweir<button onclick='callOleTest( 6)'>long</Button>
924cdf0e10cSrcweir<button onclick='callOleTest( 7)'>unsigned long</Button>
925cdf0e10cSrcweir<button onclick='callOleTest( 8)'>char</Button>
926cdf0e10cSrcweir<button onclick='callOleTest( 9)'>string</Button>
927cdf0e10cSrcweir<button onclick='callOleTest( 10)'>any</Button>
928cdf0e10cSrcweir<button onclick='callOleTest( 11)'>sequence&lt;long&gt; </Button>
929cdf0e10cSrcweir<button onclick='callOleTest( 12)'>sequence&lt;sequence&lt;long&gt; &gt; </Button>
930cdf0e10cSrcweir<button onclick='callOleTest( 13)' id=button2 name=button2>XInterface</Button>
931cdf0e10cSrcweir<button onclick='callOleTest( 15)'>XEventListener</Button>
932cdf0e10cSrcweir<button onclick='callOleTest( 16)'>sequence&lt;XEventListener&gt;</Button>
933cdf0e10cSrcweir<p>
934cdf0e10cSrcweir
935cdf0e10cSrcweir<p>
936cdf0e10cSrcweirOut Parameter <br>
937cdf0e10cSrcweir<button onclick='callOleTest( 2000)'>byte </Button>
938cdf0e10cSrcweir<button onclick='callOleTest( 2016)'>float</Button>
939cdf0e10cSrcweir<button onclick='callOleTest( 2001)'>double</Button>
940cdf0e10cSrcweir<button onclick='callOleTest( 2002)'>boolean</Button>
941cdf0e10cSrcweir<button onclick='callOleTest( 2003)'>short</Button>
942cdf0e10cSrcweir<button onclick='callOleTest( 2004)'>unsigned short</Button>
943cdf0e10cSrcweir<button onclick='callOleTest( 2005)'>long</Button>
944cdf0e10cSrcweir<button onclick='callOleTest( 2006)'>unsigned long</Button>
945cdf0e10cSrcweir<button onclick='callOleTest( 2007)'>char</Button>
946cdf0e10cSrcweir<button onclick='callOleTest( 2008)'>string</Button>
947cdf0e10cSrcweir<button onclick='callOleTest( 2009)'>any</Button>
948cdf0e10cSrcweir<button onclick='callOleTest( 2010)'>sequence&ltlong&gt </Button>
949cdf0e10cSrcweir<button onclick='callOleTest( 2011)'>sequence&ltsequence&ltlong&gt &gt </Button>
950cdf0e10cSrcweir<button onclick='callOleTest( 2012)'>2 out </Button>
951cdf0e10cSrcweir<button onclick='callOleTest( 2013)'>3 out </Button>
952cdf0e10cSrcweir<button onclick='callOleTest( 2014)'>1 in & 1 out </Button>
953cdf0e10cSrcweir<button onclick='callOleTest( 2015)'>XInterface </Button>
954cdf0e10cSrcweir<button onclick='callOleTest( 2017)'>mixed out and in </Button>
955cdf0e10cSrcweir
956cdf0e10cSrcweir
957cdf0e10cSrcweir<p>
958cdf0e10cSrcweirIn Out Parameter <br>
959cdf0e10cSrcweir<button onclick='callOleTest( 500)'>byte </Button>
960cdf0e10cSrcweir<button onclick='callOleTest( 513)'>float</Button>
961cdf0e10cSrcweir<button onclick='callOleTest( 501)'>double</Button>
962cdf0e10cSrcweir<button onclick='callOleTest( 502)'>boolean</Button>
963cdf0e10cSrcweir<button onclick='callOleTest( 503)'>short</Button>
964cdf0e10cSrcweir<button onclick='callOleTest( 504)'>unsigned short</Button>
965cdf0e10cSrcweir<button onclick='callOleTest( 505)'>long</Button>
966cdf0e10cSrcweir<button onclick='callOleTest( 506)'>unsigned long</Button>
967cdf0e10cSrcweir<button onclick='callOleTest( 507)'>char</Button>
968cdf0e10cSrcweir<button onclick='callOleTest( 508)'>string</Button>
969cdf0e10cSrcweir<button onclick='callOleTest( 509)'>any</Button>
970cdf0e10cSrcweir<button onclick='callOleTest( 510)'>sequence&ltlong&gt </Button>
971cdf0e10cSrcweir<button onclick='callOleTest( 511)'>sequence&ltsequence&ltlong&gt &gt </Button>
972cdf0e10cSrcweir<button onclick='callOleTest( 512)'>XInterface </Button>
973cdf0e10cSrcweir<p>
974cdf0e10cSrcweir
975cdf0e10cSrcweirTests Array/Sequence conversion with Attributes. All params are of type Sequence and
976cdf0e10cSrcweir the element type of the Sequence is written on the buttons. <br>
977cdf0e10cSrcweir<button onclick='callOleTest( 200)'>byte </Button>
978cdf0e10cSrcweir<button onclick='callOleTest( 212)'>float</Button>
979cdf0e10cSrcweir<button onclick='callOleTest( 201)'>double</Button>
980cdf0e10cSrcweir<button onclick='callOleTest( 202)'>boolean</Button>
981cdf0e10cSrcweir<button onclick='callOleTest( 203)'>short</Button>
982cdf0e10cSrcweir<button onclick='callOleTest( 204)'>unsigned short</Button>
983cdf0e10cSrcweir<button onclick='callOleTest( 205)'>long</Button>
984cdf0e10cSrcweir<button onclick='callOleTest( 206)'>unsigned long</Button>
985cdf0e10cSrcweir<button onclick='callOleTest( 207)'>char</Button>
986cdf0e10cSrcweir<button onclick='callOleTest( 208)'>string</Button>
987cdf0e10cSrcweir<button onclick='callOleTest( 209)'>any</Button>
988cdf0e10cSrcweir<button onclick='callOleTest( 210)'>sequence&ltlong&gt </Button>
989cdf0e10cSrcweir<button onclick='callOleTest( 211)'>sequence&ltsequence&ltlong&gt &gt </Button>
990cdf0e10cSrcweir<p>
991cdf0e10cSrcweir
992cdf0e10cSrcweirTest of Any parameter in a method. Any contains:<br>
993cdf0e10cSrcweir<button onclick='callOleTest( 1000)'>integer </Button>
994cdf0e10cSrcweir<button onclick='callOleTest( 1001)'>double </Button>
995cdf0e10cSrcweir<button onclick='callOleTest( 1002)'>string</Button>
996cdf0e10cSrcweir<button onclick='callOleTest( 1003)'>array</Button>
997cdf0e10cSrcweir<button onclick='callOleTest( 1004)'>object</Button>
998cdf0e10cSrcweir<p>
999cdf0e10cSrcweirTest of Any parameter in a property. Any contains:<br>
1000cdf0e10cSrcweir<button onclick='callOleTest( 1010)'>integer </Button>
1001cdf0e10cSrcweir<button onclick='callOleTest( 1011)'>double </Button>
1002cdf0e10cSrcweir<button onclick='callOleTest( 1012)'>string</Button>
1003cdf0e10cSrcweir<button onclick='callOleTest( 1013)'>array</Button>
1004cdf0e10cSrcweir<button onclick='callOleTest( 1014)'>object</Button>
1005cdf0e10cSrcweir<P>
1006cdf0e10cSrcweirTest of Struct conversions<br>
1007cdf0e10cSrcweir<button onclick='callOleTest( 1020)'>methodStruct </Button>
1008cdf0e10cSrcweir<button onclick='callOleTest( 1021)'>return struct</Button>
1009cdf0e10cSrcweir<button onclick='callOleTest( 1022)'>struct attribute</Button>
1010cdf0e10cSrcweir
1011cdf0e10cSrcweir
1012cdf0e10cSrcweir
1013cdf0e10cSrcweir
1014cdf0e10cSrcweir<p>
1015cdf0e10cSrcweir
1016cdf0e10cSrcweir
1017cdf0e10cSrcweir<h2> Visual Basic Tests </h2>
1018cdf0e10cSrcweirTest array /Sequence conversion and return value<br>
1019cdf0e10cSrcweirTemplate: <b> Sequence &lt type &gt method( Sequence&lt type &gt ) </b> <br>
1020cdf0e10cSrcweir<!--<font color= red>Multi dimensional arrays are not processed by VBSript</font> <br>  -->
1021cdf0e10cSrcweir<button onclick='callBasic(0)'>byte</button>
1022cdf0e10cSrcweir<button onclick='callBasic(1)'>double</button>
1023cdf0e10cSrcweir<button onclick='callBasic(2)'>boolean</button>
1024cdf0e10cSrcweir<button onclick='callBasic(3)'>short</button>
1025cdf0e10cSrcweir<button onclick='callBasic(4)'>u short</button>
1026cdf0e10cSrcweir<button onclick='callBasic(5)'>long</button>
1027cdf0e10cSrcweir<button onclick='callBasic(6)'>u long</button>
1028cdf0e10cSrcweir<button onclick='callBasic(7)'>string</button>
1029cdf0e10cSrcweir<button onclick='callBasic(8)'>char</button>
1030cdf0e10cSrcweir<button onclick='callBasic(9)'>any</button> <br>
1031cdf0e10cSrcweir<button onclick='callBasic(10)'>Seq &lt int &gt</button> <br>
1032cdf0e10cSrcweir
1033cdf0e10cSrcweir
1034cdf0e10cSrcweirIN/Out parameter <br>
1035cdf0e10cSrcweirTemplate: <b> void method(type  ) </b> <br>
1036cdf0e10cSrcweir<button onclick='callBasic(100)'>byte</button>
1037cdf0e10cSrcweir<button onclick='callBasic(101)'>double</button>
1038cdf0e10cSrcweir<button onclick='callBasic(102)'>boolean</button>
1039cdf0e10cSrcweir<button onclick='callBasic(103)'>short</button>
1040cdf0e10cSrcweir<button onclick='callBasic(104)'>u short</button>
1041cdf0e10cSrcweir<button onclick='callBasic(105)'>long</button>
1042cdf0e10cSrcweir<button onclick='callBasic(106)'>u long</button>
1043cdf0e10cSrcweir<button onclick='callBasic(107)'>string</button>
1044cdf0e10cSrcweir<button onclick='callBasic(108)'>char</button>
1045cdf0e10cSrcweir<button onclick='callBasic(109)'>any</button> <br>
1046cdf0e10cSrcweir
1047cdf0e10cSrcweirSimple out parameter<br>
1048cdf0e10cSrcweir<button onclick='callBasic(150)'>byte</button>
1049cdf0e10cSrcweir<!--<button onclick='callBasic(151)'>double</button>
1050cdf0e10cSrcweir<button onclick='callBasic(152)'>boolean</button>
1051cdf0e10cSrcweir<button onclick='callBasic(153)'>short</button>
1052cdf0e10cSrcweir<button onclick='callBasic(155)'>long</button>
1053cdf0e10cSrcweir<button onclick='callBasic(157)'>string</button>
1054cdf0e10cSrcweir<button onclick='callBasic(158)'>char</button>
1055cdf0e10cSrcweir<button onclick='callBasic(159)'>any</button> <br>
1056cdf0e10cSrcweir//-->
1057cdf0e10cSrcweir<br>
1058cdf0e10cSrcweir
1059cdf0e10cSrcweir
1060cdf0e10cSrcweirTests Array/Sequence conversion with <b>Attributes</b>. All params are of type Sequence and
1061cdf0e10cSrcweir the element type of the Sequence is written on the buttons. <br>
1062cdf0e10cSrcweir<button onclick='callBasic( 200)'>byte </Button>
1063cdf0e10cSrcweir<button onclick='callBasic( 201)'>double</Button>
1064cdf0e10cSrcweir<button onclick='callBasic( 202)'>boolean</Button>
1065cdf0e10cSrcweir<button onclick='callBasic( 203)'>short</Button>
1066cdf0e10cSrcweir<button onclick='callBasic( 204)'>unsigned short</Button>
1067cdf0e10cSrcweir<button onclick='callBasic( 205)'>long</Button>
1068cdf0e10cSrcweir<button onclick='callBasic( 206)'>unsigned long</Button>
1069cdf0e10cSrcweir<button onclick='callBasic( 207)'>string</Button>
1070cdf0e10cSrcweir<button onclick='callBasic( 208)'>char</Button>
1071cdf0e10cSrcweir<button onclick='callBasic( 209)'>any</Button>
1072cdf0e10cSrcweir<button onclick='callBasic( 210)'>sequence&ltlong&gt </Button> <br>
1073cdf0e10cSrcweir
1074cdf0e10cSrcweirIn Out parameter <br>
1075cdf0e10cSrcweir<button onclick='callBasic( 300)'>byte</Button>
1076cdf0e10cSrcweir<p>
1077cdf0e10cSrcweirStructs <br>
1078cdf0e10cSrcweir<button onclick='callBasic(400)'>methodStruct</button>
1079cdf0e10cSrcweir<button onclick='callBasic(401)'>return Struct</button>
1080cdf0e10cSrcweir<button onclick='callBasic(402)'>struct attribute</button>
1081cdf0e10cSrcweir
1082cdf0e10cSrcweir
1083cdf0e10cSrcweir
1084