2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 <META NAME=
"GENERATOR" Content=
"Microsoft Developer Studio">
21 <META HTTP-EQUIV=
"Content-Type" content=
"text/html; charset=iso-8859-1">
22 <TITLE>Document Title
</TITLE>
26 <script language=
"JScript">
27 // XEventListener implementation in JScript --------------------------------------------------
28 function XEventListener_Impl()
30 this._environment=
"JScript";
31 this._implementedInterfaces= new Array(
"com.sun.star.lang.XEventListener");
34 this.disposing= XEventListener_disposing;
36 this.bdisposingCalled= false;
38 this.resetDisposing= XEventListener_resetDisposing;
39 this.disposingCalled= XEventListener_disposingCalled;
42 function XEventListener_disposing( source)
45 alert(
"JScript Event Listener \n disposing is being called");
46 this.bdisposingCalled= true;
49 function XEventListener_resetDisposing()
51 this.bdisposingCalled= false;
54 function XEventListener_disposingCalled()
56 return this.bdisposingCalled;
60 function callOleTest( id)
62 var factory= new ActiveXObject(
"com.sun.star.ServiceManager");
63 var oletest= factory.createInstance(
"oletest.OleTest");
66 var arr= new Array(
1,
2,
3,
4,
0);
67 var arrDouble= new Array(
1.2345,
12.345,
123,
45,
1234.5,
12345);
68 var arrBool= new Array(
1,
0,
2,
0,
3);
69 var arrChar= new Array( '
1', 'A',
"1",
"A", ' ',
55,
56);
70 var arrString= new Array(
"hamburger",
"cheeseburger",
"chicken nuggets",
"chicken wings" ,
"pizza");
71 var arrAny= new Array(
100,
100.1235,
"hallo");
72 var arrSeq= new Array( arr, arr, arr);
73 var arrSeq2= new Array( arrSeq, arrSeq, arrSeq)
76 var arrout1= new Array();
77 var arrout2= new Array();
78 var arrout3= new Array();
81 var sfarray, sfarray1, sfarray2, sfarray3;
82 var arEventListener= new Array( new XEventListener_Impl(), new XEventListener_Impl(),
83 new XEventListener_Impl());
84 var arEventListener2= new Array( new XEventListener_Impl(), new XEventListener_Impl(),
85 new XEventListener_Impl());
86 var arArEventListener= new Array( arEventListener, arEventListener2);
90 case
1: ret= oletest.methodByte( arr);
91 sfarray= new VBArray( ret);
92 document.writeln(
"Param: " + arr.toString() +
"<br>");
93 document.writeln(
"Returns a Sequence< BYTE > <br>" + sfarray.toArray()) ; break;
95 case
2: ret= oletest.methodDouble( arrDouble);
96 sfarray= new VBArray( ret);
97 document.writeln(
"Param: " + arrDouble.toString() +
"<br>");
98 document.writeln(
"Returns a Sequence< double > <br>" + sfarray.toArray()) ; break;
100 case
3: ret= oletest.methodBool( arrBool);
101 sfarray= new VBArray( ret);
102 document.writeln(
"Param: " + arrBool.toString() +
"<br>");
103 document.writeln(
"Returns a Sequence< BOOL > <br>" + sfarray.toArray()) ; break;
105 case
4: ret= oletest.methodShort( arr);
106 sfarray= new VBArray( ret);
107 document.writeln(
"Param: " + arr.toString() +
"<br>");
108 document.writeln(
"Returns a Sequence< SHORT > <br>" + sfarray.toArray()) ; break;
110 case
5: ret= oletest.methodUShort( arr);
111 sfarray= new VBArray( ret);
112 document.writeln(
"Param: " + arr.toString() +
"<br>");
113 document.writeln(
"Returns a Sequence< unsigned SHORT > <br>" + sfarray.toArray()) ; break;
115 case
6: ret= oletest.methodLong( arr);
116 sfarray= new VBArray( ret);
117 document.writeln(
"Param: " + arr.toString() +
"<br>");
118 document.writeln(
"Returns a Sequence< LONG > <br>" + sfarray.toArray()) ; break;
120 case
7: ret= oletest.methodULong( arr);
121 sfarray= new VBArray( ret);
122 document.writeln(
"Param: " + arr.toString() +
"<br>");
123 document.writeln(
"Returns a Sequence< unsigned LONG > <br>" + sfarray.toArray()) ; break;
125 case
8: ret= oletest.methodChar( arrChar);
126 sfarray= new VBArray( ret);
127 document.writeln(
"Param: " + arrChar.toString() +
"<br>");
128 document.writeln(
"Returns a Sequence< wchar_t > <br>" + sfarray.toArray()) ; break;
130 case
9: ret= oletest.methodString( arrString);
131 sfarray= new VBArray( ret);
132 document.writeln(
"Param: " + arrString.toString() +
"<br>");
133 document.writeln(
"Returns a Sequence< UString > <br>" + sfarray.toArray()) ; break;
135 case
10: ret= oletest.methodAny( arrAny);
136 sfarray= new VBArray( ret);
137 document.writeln(
"Param: " + arrAny.toString() +
"<br>");
138 document.writeln(
"Returns a Sequence< UsrAny > <br>" + sfarray.toArray() ) ; break;
140 case
11: ret= oletest.methodSequence( arrSeq);
141 sfarray= new VBArray( ret);
142 document.writeln(
"Param: " + arrSeq.toString() +
"<br>");
143 document.writeln(
"Returns a Sequence< Sequence < long >> <br>") ;
144 var arr1= new Array();
145 arr1= sfarray.toArray();
146 for( i=
0; i < arr1.length; i++)
148 sfarray2= new VBArray( arr1[i]);
149 var arr2= new Array();
150 arr2= sfarray2.toArray();
151 document.writeln( arr2.toString() +
"<br>" );
155 case
12: ret= oletest.methodSequence2( arrSeq2);
156 document.writeln(
"Param: " + arrSeq2.toString() +
"<br>");
157 sfarray1= new VBArray( ret);
158 arr1= sfarray1.toArray();
159 for( i=
0; i < arr1.length; i++)
161 sfarray2= new VBArray( arr1[i]);
162 arr2= sfarray2.toArray();
164 for ( j=
0; j < arr2.length; j++)
166 sfarray3= new VBArray( arr2[j]);
167 arr3= sfarray3.toArray();
168 document.write( i+
" ");
169 document.writeln(j +
": "+ arr3.toString() +
"<br>" );
179 var ob= new Object();
180 ob.value=
"A JScript object!";
184 ret = oletest.methodXInterface( ar);
185 sfarray= new VBArray( ret);
186 var arRet= sfarray.toArray();
188 document.writeln(
"Params : Array containing objects ")
191 document.writeln(
"object " + index +
": " + ar[index].value +
" ");
193 document.writeln(
"<br>" ) ;
194 document.writeln(
"Return: <br>");
197 document.writeln(
"object " + index +
": " + arRet[index].value +
" ");
201 case
14: ret= oletest.methodFloat( arrDouble);
202 sfarray= new VBArray( ret);
203 document.writeln(
"Param: " + arrDouble.toString() +
"<br>");
204 document.writeln(
"Returns a Sequence< float> <br>" + sfarray.toArray()) ; break;
207 ret= oletest.methodXEventListeners( arEventListener);
208 sfarray= new VBArray(ret);
209 _ret= sfarray.toArray();
212 if( ! _ret[key].disposingCalled())
213 alert(
"Error! oletest.methodXEventListeners")
217 ret= oletest.methodXEventListenersMul( arArEventListener);
218 sfarray= new VBArray(ret);
219 _ret= sfarray.toArray();
222 sfarray2= new VBArray(_ret[key]);
223 _ret2= sfarray2.toArray();
226 if( ! _ret2[key2].disposingCalled())
227 alert(
"Error! oletest.methodXEventListeners")
234 // Properties: setting and getting values
235 case
200: oletest.AttrByte = arr;
236 ret= oletest.AttrByte;
237 document.writeln(
"Setting AttrByte: " + arr.toString() +
"<p>");
238 document.writeln(
"Getting AttrByte: " + arr.toString()); break;
240 case
201: oletest.AttrDouble= arrDouble;
241 ret= oletest.AttrDouble;
242 document.writeln(
"Setting AttrDouble: " + arrDouble.toString() +
"<p>");
243 document.writeln(
"Getting AttrDouble: " + arrDouble.toString()); break;
245 case
202: oletest.AttrBool= arrBool;
246 ret= oletest.AttrBool;
247 document.writeln(
"Setting AttrBool: " + arrBool.toString() +
"<p>");
248 document.writeln(
"Getting AttrBool: " + arrBool.toString()); break;
250 case
203: oletest.AttrShort= arr;
251 ret= oletest.AttrShort;
252 document.writeln(
"Setting AttrShort: " + arr.toString() +
"<p>");
253 document.writeln(
"Getting AttrShort: " + arr.toString()); break;
255 case
204: oletest.AttrUShort= arr;
256 ret= oletest.AttrUShort;
257 document.writeln(
"Setting AttrUShort: " + arr.toString() +
"<p>");
258 document.writeln(
"Getting AttrUShort: " + arr.toString()); break;
260 case
205: oletest.AttrLong= arr;
261 ret= oletest.AttrLong;
262 document.writeln(
"Setting AttrLong: " + arr.toString() +
"<p>");
263 document.writeln(
"Getting AttrLong: " + arr.toString()); break;
265 case
206: oletest.AttrULong= arr;
266 ret= oletest.AttrULong;
267 document.writeln(
"Setting AttrULong: " + arr.toString() +
"<p>");
268 document.writeln(
"Getting AttrULong: " + arr.toString()); break;
270 case
207: oletest.AttrChar= arrChar;
271 ret= oletest.AttrChar;
272 document.writeln(
"Setting AttrChar: " + arrChar.toString() +
"<p>");
273 document.writeln(
"Getting AttrChar: " + arrChar.toString()); break;
275 case
208: oletest.AttrString= arrString;
276 ret= oletest.AttrString;
277 document.writeln(
"Setting AttrString: " + arrString.toString() +
"<p>");
278 document.writeln(
"Getting AttrString: " + arrString.toString()); break;
280 case
209: oletest.AttrAny= arrAny;
281 ret= oletest.AttrAny;
282 document.writeln(
"Setting AttrAny: " + arrAny.toString() +
"<p>");
283 document.writeln(
"Getting AttrAny: " + arrAny.toString()); break;
285 case
210: oletest.AttrSequence= arrSeq;
286 ret= oletest.AttrSequence;
287 document.writeln(
"Setting AttrSequence: " + arrSeq.toString() +
"<p>");
288 document.writeln(
"Getting AttrSequence: " + arrSeq.toString()); break;
290 case
211: oletest.AttrSequence2= arrSeq2;
291 ret= oletest.AttrSequence2;
292 document.writeln(
"Setting AttrSequence2: " + arrSeq2.toString() +
"<p>");
293 document.writeln(
"Getting AttrSequence2: " + arrSeq2.toString()); break;
295 case
212: oletest.AttrFloat= arrDouble;
296 ret= oletest.AttrFloat;
297 document.writeln(
"Setting AttrFloat: " + arrDouble.toString() +
"<p>");
298 document.writeln(
"Getting AttrFloat: " + arrDouble.toString()); break;
302 // Out-parameter ------------------------------------------------------------
304 oletest.testout_methodByte( arrout1 );
305 alert(
"byte: " + arrout1[
0] ); break;
307 oletest.testout_methodDouble( arrout1 );
308 alert(
"double: " + arrout1[
0] ); break;
310 oletest.testout_methodBool( arrout1 );
311 alert(
"boolean: " + arrout1[
0] ); break;
313 oletest.testout_methodShort( arrout1 );
314 alert(
"short: " + arrout1[
0] ); break;
316 oletest.testout_methodUShort( arrout1 );
317 alert(
"unsigned short: " + arrout1[
0] ); break;
319 oletest.testout_methodLong( arrout1 );
320 alert(
"long: " + arrout1[
0] ); break;
322 oletest.testout_methodULong( arrout1 );
323 alert(
"unsigned long: " + arrout1[
0] ); break;
325 oletest.testout_methodChar( arrout1 );
326 alert(
"char: " + arrout1[
0] ); break;
328 oletest.testout_methodString( arrout1 );
329 alert(
"string: " + arrout1[
0] ); break;
331 oletest.testout_methodAny( arrout1 );
332 alert(
"any: " + arrout1[
0] ); break;
334 oletest.testout_methodSequence( arrout1 );
335 var sfarray= new VBArray( arrout1[
0]);
336 arr= sfarray.toArray();
337 document.writeln(
"use the browser's back arrow to go to the previous page <p>");
338 document.writeln( arr.toString());
341 oletest.testout_methodSequence2( arrout1 );
342 var sfarray= new VBArray( arrout1[
0]);
343 arr= sfarray.toArray();
345 for( i=
0; i < arr.length; i++)
347 var sfarray= new VBArray( arr[i]);
348 var arr2= new Array();
349 arr2= sfarray.toArray();
350 document.writeln( arr2.toString() +
"<br>" );
354 oletest.testout_methodMulParams1( arrout1, arrout2 );
355 document.writeln(
"int : " + arrout1[
0] +
" int :" + arrout2[
0] ); break;
357 oletest.testout_methodMulParams2( arrout1, arrout2, arrout3 );
358 document.writeln(
"int: " + arrout1[
0] +
" int: " + arrout2[
0] +
" string: " + arrout3[
0] ); break;
360 oletest.testout_methodMulParams3(
"hallo", arrout1 );
361 document.writeln(
"string: " + arrout1[
0] ); break;
363 oletest.testout_methodXInterface( arrout1 );
364 var outVal= arrout1[
0];
365 alert( outVal.AttrAny2);
366 document.writeln(
"string: " + arrout1[
0].AttrAny2); break;
368 oletest.testout_methodFloat( arrout1 );
369 alert(
"float: " + arrout1[
0] ); break;
374 oletest.testout_methodMulParams4( in1, arrout1, in2, arrout2, in3 );
375 document.write(
"param1 [in] float: " + in1 +
" param2 [out] float: " + arrout1[
0] +
376 " param3 [in] long: " + in2 +
" param4 [out] long: " + arrout2[
0] +
377 " param5 [in] long: " + in3);
381 // INOUT - Parameter -------------------------------------------------------------------------------
382 // The in value has to be placed on index
0 of the passed in array
385 oletest.testinout_methodByte( arrout1 );
386 alert(
"byte: " + arrout1[
0] ); break;
389 oletest.testinout_methodDouble( arrout1 );
390 alert(
"double: " + arrout1[
0] ); break;
393 oletest.testinout_methodBool( arrout1 );
394 alert(
"boolean: " + arrout1[
0] ); break;
397 oletest.testinout_methodShort( arrout1 );
398 alert(
"short: " + arrout1[
0] ); break;
401 oletest.testinout_methodUShort( arrout1 );
402 alert(
"unsigned short: " + arrout1[
0] ); break;
405 oletest.testinout_methodLong( arrout1 );
406 alert(
"long: " + arrout1[
0] ); break;
409 oletest.testinout_methodULong( arrout1 );
410 alert(
"unsigned long: " + arrout1[
0] ); break;
413 oletest.testinout_methodChar( arrout1 );
414 alert(
"char: " + arrout1[
0] ); break;
416 arrout1[
0]=
"I am a string";
417 oletest.testinout_methodString( arrout1 );
418 alert(
"string: " + arrout1[
0] ); break;
421 oletest.testinout_methodAny( arrout1 ); // the method simply returns the argument
422 sfarray= new VBArray( arrout1[
0]);
423 arr= sfarray.toArray();
424 alert(
"any: " + arr.toString() ); break;
427 oletest.testinout_methodSequence( arrout1 );
428 var sfarray= new VBArray( arrout1[
0]);
429 arr= sfarray.toArray();
430 document.writeln(
"use the browser's back arrow to go to the previous page <p>");
431 document.writeln( arr.toString());
435 oletest.testinout_methodSequence2( arrout1 );
436 var sfarray= new VBArray( arrout1[
0]);
437 arr= sfarray.toArray();
439 for( i=
0; i < arr.length; i++)
441 var sfarray= new VBArray( arr[i]);
442 var arr2= new Array();
443 arr2= sfarray.toArray();
444 document.writeln( arr2.toString() +
"<br>" );
448 var ob= new Object();
449 ob.value=
"this is a string";
452 alert (arrout1[
0].value);
453 oletest.testinout_methodXInterface( arrout1);
454 alert (arrout1[
0].value);
455 var outValue= arrout1[
0];
456 for ( key in outValue)
458 document.write( outValue[key] );
460 document.write(
"Out value: " + outValue );
461 document.write(
"Out 1 value: " + arrout1[
1]);
464 // var ob= new Object();
465 // ob.value=
"this is a string";
466 // inoutValue.Set(
"object", ob);
467 // oletest.testinout_methodXInterface( inoutValue);
468 // document.write(
"Out value: " + inoutValue.Get().value );
473 oletest.testinout_methodFloat( arrout1 );
474 alert(
"float: " + arrout1[
0] ); break;
482 ret= oletest.methodAnyTest1( i);
483 document.writeln(
"in: " + i +
" ret: " + ret);
487 ret= oletest.methodAnyTest1( i);
488 document.writeln(
"in: " + i +
" ret: " + ret);
492 ret= oletest.methodAnyTest1( i);
493 document.writeln(
"in: " + i +
" ret: " + ret);
497 ret= oletest.methodAnyTest1( i);
498 sfarray= new VBArray( ret);
499 document.writeln(
"in: " + i +
" ret: " + sfarray.toArray());
502 var obj= new Object();
503 obj[
1]=
"This is index 0";
504 ret= oletest.methodAnyTest1( obj);
505 document.writeln(
"in: " + obj +
" ret: " + ret);
513 ret= oletest.AttrAny2;
514 document.writeln(
"set: " + i +
" get: " + ret);
519 ret= oletest.AttrAny2;
520 document.writeln(
"set: " + i +
" get: " + ret);
525 ret= oletest.AttrAny2;
526 document.writeln(
"set: " + i +
" get: " + ret);
531 ret= oletest.AttrAny2;
532 sfarray= new VBArray( ret);
533 document.writeln(
"set: " + i +
" get: " + sfarray.toArray());
536 var obj= new Object();
537 obj[
1]=
"This is index 0";
538 oletest.AttrAny2= obj;
539 ret= oletest.AttrAny2;
540 document.writeln(
"set: " + obj +
" get: " + ret);
543 // Structs ----------------------------------------------
545 var struct= oletest._GetStruct(
"com.sun.star.beans.Property");
546 struct.Attributes=
1;
548 struct.Name=
"some Property"
549 oletest.methodStruct( struct);
552 var struct= oletest.retMethodStruct();
553 alert(
"Property::Attributes : " + struct.Attributes +
" \nProperty::Handle : "
554 + struct.Handle +
"\n Property::Name : " + struct.Name);
557 var struct= oletest._GetStruct(
"com.sun.star.beans.Property");
558 struct.Attributes=
1;
560 struct.Name=
"some Property"
561 oletest.AttrStruct= struct;
563 var struct2= oletest.AttrStruct;
564 alert(
"property get: \n Property::Attributes : " + struct2.Attributes +
" \nProperty::Handle : "
565 + struct2.Handle +
"\n Property::Name : " + struct2.Name);
570 var ret= oletest.retMethodByte();
571 var sfarray= VBArray( ret);
572 document.writeln( sfarray.toArray() );
581 function funcOut( out)
588 <script language=
"VBScript">
593 Set factory= GetObject(
"",
"com.sun.star.ServiceManager")
595 Set oletest= factory.createInstance(
"oletest.OleTest")
598 arrInt= Array(
1,
2,
3,
4,
5)
599 arrInt2= Array( -
1, -
2,
127,
128,
0)
600 arrDouble= Array(
1.1,
2.2,
3.3,
4.4,
5.5)
601 arrBool= Array(
0,
1,
0,
2,
0)
602 arrLong= Array( &Hff, &Hffff, &Hffffff, &Hffffffff)
603 arrString= Array(
"Chicken Wings",
"Cheeseburger",
"Hamburger")
604 arrChar= Array(
"a",
65,
"M")
605 arrAny= Array(
"Mickey",
3.14,
100,
"A")
610 arrDim2Int(i,j) = i*
2 + j
614 Dim arrDim3Int(
1,
1,
1)
618 arrDim3Int(i,j,k) = i*
2 + j*
2 + k
626 document.writeln
"param: "
628 ret= oletest.methodByte(arrInt)
629 document.writeln
"<br> return value: "
632 document.writeln
"param: "
634 ret= oletest.methodDouble(arrDouble)
635 document.writeln
"<br> return value: "
638 document.writeln
"param: "
640 ret= oletest.methodBool(arrBool)
641 document.writeln
"<br> return value: "
644 document.writeln
"param: "
646 ret= oletest.methodShort(arrInt2)
647 document.writeln
"<br> return value: "
650 document.writeln
"param: "
652 ret= oletest.methodUShort(arrInt)
653 document.writeln
"<br> return value: "
656 document.writeln
"param: "
658 ret= oletest.methodLong(arrLong)
659 document.writeln
"<br> return value: "
662 document.writeln
"param: "
664 ret= oletest.methodULong(arrInt)
665 document.writeln
"<br> return value: "
668 document.writeln
"param: "
670 ret= oletest.methodString(arrString)
671 document.writeln
"<br> return value: "
674 document.writeln
"param: "
676 ret= oletest.methodChar(arrChar)
677 document.writeln
"<br> return value: "
680 document.writeln
"param: "
682 ret= oletest.methodAny(arrAny)
683 document.writeln
"<br> return value: "
686 document.writeln
"param: "
687 printArray2 arrDim2Int
688 ret= oletest.methodSequence(arrDim2Int)
689 document.writeln
"<br> return value: "
691 document.write
"<br> array: "
700 oletest.testout_methodByte rOut
702 // void testout_methodFloat( [out] float rOut);
703 // void testout_methodDouble( [out] double rOut);
704 // void testout_methodBool( [out] boolean rOut);
705 // void testout_methodShort( [out] short rOut);
706 // void testout_methodUShort( [out] unsigned short rOut);
707 // void testout_methodLong( [out] long rOut);
708 // void testout_methodULong( [out] unsigned long rOut);
711 // In Out Parameter --------------------------------------------------
714 document.write
"param: " & CStr( a) &
"<br>"
715 oletest.testinout_methodByte a
719 document.write
"param: " & CStr( a) &
"<br>"
720 oletest.testinout_methodDouble a
724 document.write
"param: "& CStr( a) &
"<br>"
725 oletest.testinout_methodBool a
729 document.write
"param: "& CStr( a) &
"<br>"
730 oletest.testinout_methodShort a
734 document.write
"param: "& CStr( a) &
"<br>"
735 oletest.testinout_methodUShort a
739 document.write
"param: "& CStr( a) &
"<br>"
740 oletest.testinout_methodLong a
744 document.write
"param: "& CStr( a) &
"<br>"
745 oletest.testinout_methodULong a
749 document.write
"param: "& CStr( a) &
"<br>"
750 oletest.testinout_methodString a
754 document.write
"param: "& CStr( a) &
"<br>"
755 oletest.testinout_methodChar a
758 a=
"Ein String im Any"
759 document.write
"param: "& CStr( a) &
"<br>"
760 oletest.other_methodAnyIn a
765 document.write
"param: "& CStr( a) &
"<br>"
766 oletest.testout_methodByte( a)
768 // Attributes -----------------------------------------------------------------
770 document.write
"set: "
772 oletest.AttrByte= arrInt
774 call printArrayEx(
"<br> get: ",
"<br>", b)
776 document.write
"set: "
778 oletest.AttrDouble= arrDouble
779 b= oletest.AttrDouble
780 call printArrayEx(
"<br> get: ",
"<br>", b)
782 document.write
"set: "
784 oletest.AttrBool= arrBool
786 call printArrayEx(
"<br> get: ",
"<br>", b)
788 document.write
"set: "
790 oletest.AttrShort= arrInt2
792 call printArrayEx(
"<br> get: ",
"<br>", b)
794 document.write
"set: "
796 oletest.AttrUShort= arrInt
797 b= oletest.AttrUShort
798 call printArrayEx(
"<br> get: ",
"<br>", b)
800 document.write
"set: "
802 oletest.AttrLong= arrInt2
804 call printArrayEx(
"<br> get: ",
"<br>", b)
806 document.write
"set: "
808 oletest.AttrULong= arrInt
810 call printArrayEx(
"<br> get: ",
"<br>", b)
812 document.write
"set: "
814 oletest.AttrString= arrString
815 b= oletest.AttrString
816 call printArrayEx(
"<br> get: ",
"<br>", b)
818 document.write
"set: "
820 oletest.AttrChar= arrChar
822 call printArrayEx(
"<br> get: ",
"<br>", b)
824 document.write
"set: "
826 oletest.AttrAny= arrAny
828 call printArrayEx(
"<br> get: ",
"<br>", b)
831 document.write
"set: <br>"
832 printArray2 arrDim2Int :
833 oletest.AttrSequence= arrDim2Int
834 ret= oletest.AttrSequence
835 document.write
"get: "
837 document.write
"<br> array: "
846 call oletest.testinout_methodByte( aByte)
852 set struct= oletest.Bridge_GetStruct(
"com.sun.star.beans.Property")
855 struct.Name=
"some Property"
856 oletest.methodStruct struct
859 set struct= oletest.retMethodStruct()
860 alert(
"Property::Attributes : " & struct.Attributes & vblf &
" Property::Handle : " _
861 & struct.Handle & vblf &
" Property::Name : " & struct.Name)
864 set struct= oletest.Bridge_GetStruct(
"com.sun.star.beans.Property")
867 struct.Name=
"some Property"
868 oletest.AttrStruct= struct
870 set struct2= oletest.AttrStruct
871 alert(
"property get: " & vblf &
"Property::Attributes : " & struct2.Attributes & _
872 vblf &
" Property::Handle : " & struct2.Handle & vblf &
" Property::Name : " _
878 document.write
"array: "
880 document.write CStr(val) &
" "
884 // print a
2 dimensional Array
886 sub printArray2( arr)
887 elements1= UBound( arr,
1) - LBound( arr,
1) +
1
888 elements2= UBound( arr,
2) - LBound( arr,
2) +
1
890 For i=
0 To elements1 -
1
891 document.write(
"array " & CStr( i) &
": " )
892 For j=
0 To elements2 -
1
893 document.write CStr( arr(i,j))
895 document.write(
"<br>")
899 sub printArrayEx( pre, post, array)
908 <!-- Insert HTML here -->
911 Tests Array/Sequence conversion.
<br>
912 All methods receive a Sequence as Parameter. The element type of the Sequence is written on the buttons.
914 <button onclick='callOleTest(
1)'
>byte
</Button>
915 <button onclick='callOleTest(
14)'
>float
</Button>
916 <button onclick='callOleTest(
2)'
>double
</Button>
917 <button onclick='callOleTest(
3)'
>boolean
</Button>
918 <button onclick='callOleTest(
4)'
>short
</Button>
919 <button onclick='callOleTest(
5)'
>unsigned short
</Button>
920 <button onclick='callOleTest(
6)'
>long
</Button>
921 <button onclick='callOleTest(
7)'
>unsigned long
</Button>
922 <button onclick='callOleTest(
8)'
>char
</Button>
923 <button onclick='callOleTest(
9)'
>string
</Button>
924 <button onclick='callOleTest(
10)'
>any
</Button>
925 <button onclick='callOleTest(
11)'
>sequence
<long
> </Button>
926 <button onclick='callOleTest(
12)'
>sequence
<sequence
<long
> > </Button>
927 <button onclick='callOleTest(
13)' id=button2 name=button2
>XInterface
</Button>
928 <button onclick='callOleTest(
15)'
>XEventListener
</Button>
929 <button onclick='callOleTest(
16)'
>sequence
<XEventListener
></Button>
934 <button onclick='callOleTest(
2000)'
>byte
</Button>
935 <button onclick='callOleTest(
2016)'
>float
</Button>
936 <button onclick='callOleTest(
2001)'
>double
</Button>
937 <button onclick='callOleTest(
2002)'
>boolean
</Button>
938 <button onclick='callOleTest(
2003)'
>short
</Button>
939 <button onclick='callOleTest(
2004)'
>unsigned short
</Button>
940 <button onclick='callOleTest(
2005)'
>long
</Button>
941 <button onclick='callOleTest(
2006)'
>unsigned long
</Button>
942 <button onclick='callOleTest(
2007)'
>char
</Button>
943 <button onclick='callOleTest(
2008)'
>string
</Button>
944 <button onclick='callOleTest(
2009)'
>any
</Button>
945 <button onclick='callOleTest(
2010)'
>sequence<long>
</Button>
946 <button onclick='callOleTest(
2011)'
>sequence<sequence<long> >
</Button>
947 <button onclick='callOleTest(
2012)'
>2 out
</Button>
948 <button onclick='callOleTest(
2013)'
>3 out
</Button>
949 <button onclick='callOleTest(
2014)'
>1 in &
1 out
</Button>
950 <button onclick='callOleTest(
2015)'
>XInterface
</Button>
951 <button onclick='callOleTest(
2017)'
>mixed out and in
</Button>
955 In Out Parameter
<br>
956 <button onclick='callOleTest(
500)'
>byte
</Button>
957 <button onclick='callOleTest(
513)'
>float
</Button>
958 <button onclick='callOleTest(
501)'
>double
</Button>
959 <button onclick='callOleTest(
502)'
>boolean
</Button>
960 <button onclick='callOleTest(
503)'
>short
</Button>
961 <button onclick='callOleTest(
504)'
>unsigned short
</Button>
962 <button onclick='callOleTest(
505)'
>long
</Button>
963 <button onclick='callOleTest(
506)'
>unsigned long
</Button>
964 <button onclick='callOleTest(
507)'
>char
</Button>
965 <button onclick='callOleTest(
508)'
>string
</Button>
966 <button onclick='callOleTest(
509)'
>any
</Button>
967 <button onclick='callOleTest(
510)'
>sequence<long>
</Button>
968 <button onclick='callOleTest(
511)'
>sequence<sequence<long> >
</Button>
969 <button onclick='callOleTest(
512)'
>XInterface
</Button>
972 Tests Array/Sequence conversion with Attributes. All params are of type Sequence and
973 the element type of the Sequence is written on the buttons.
<br>
974 <button onclick='callOleTest(
200)'
>byte
</Button>
975 <button onclick='callOleTest(
212)'
>float
</Button>
976 <button onclick='callOleTest(
201)'
>double
</Button>
977 <button onclick='callOleTest(
202)'
>boolean
</Button>
978 <button onclick='callOleTest(
203)'
>short
</Button>
979 <button onclick='callOleTest(
204)'
>unsigned short
</Button>
980 <button onclick='callOleTest(
205)'
>long
</Button>
981 <button onclick='callOleTest(
206)'
>unsigned long
</Button>
982 <button onclick='callOleTest(
207)'
>char
</Button>
983 <button onclick='callOleTest(
208)'
>string
</Button>
984 <button onclick='callOleTest(
209)'
>any
</Button>
985 <button onclick='callOleTest(
210)'
>sequence<long>
</Button>
986 <button onclick='callOleTest(
211)'
>sequence<sequence<long> >
</Button>
989 Test of Any parameter in a method. Any contains:
<br>
990 <button onclick='callOleTest(
1000)'
>integer
</Button>
991 <button onclick='callOleTest(
1001)'
>double
</Button>
992 <button onclick='callOleTest(
1002)'
>string
</Button>
993 <button onclick='callOleTest(
1003)'
>array
</Button>
994 <button onclick='callOleTest(
1004)'
>object
</Button>
996 Test of Any parameter in a property. Any contains:
<br>
997 <button onclick='callOleTest(
1010)'
>integer
</Button>
998 <button onclick='callOleTest(
1011)'
>double
</Button>
999 <button onclick='callOleTest(
1012)'
>string
</Button>
1000 <button onclick='callOleTest(
1013)'
>array
</Button>
1001 <button onclick='callOleTest(
1014)'
>object
</Button>
1003 Test of Struct conversions
<br>
1004 <button onclick='callOleTest(
1020)'
>methodStruct
</Button>
1005 <button onclick='callOleTest(
1021)'
>return struct
</Button>
1006 <button onclick='callOleTest(
1022)'
>struct attribute
</Button>
1014 <h2> Visual Basic Tests
</h2>
1015 Test array /Sequence conversion and return value
<br>
1016 Template:
<b> Sequence < type > method( Sequence< type > )
</b> <br>
1017 <!--<font color= red>Multi dimensional arrays are not processed by VBSript</font> <br> -->
1018 <button onclick='callBasic(
0)'
>byte
</button>
1019 <button onclick='callBasic(
1)'
>double
</button>
1020 <button onclick='callBasic(
2)'
>boolean
</button>
1021 <button onclick='callBasic(
3)'
>short
</button>
1022 <button onclick='callBasic(
4)'
>u short
</button>
1023 <button onclick='callBasic(
5)'
>long
</button>
1024 <button onclick='callBasic(
6)'
>u long
</button>
1025 <button onclick='callBasic(
7)'
>string
</button>
1026 <button onclick='callBasic(
8)'
>char
</button>
1027 <button onclick='callBasic(
9)'
>any
</button> <br>
1028 <button onclick='callBasic(
10)'
>Seq < int >
</button> <br>
1031 IN/Out parameter
<br>
1032 Template:
<b> void method(type )
</b> <br>
1033 <button onclick='callBasic(
100)'
>byte
</button>
1034 <button onclick='callBasic(
101)'
>double
</button>
1035 <button onclick='callBasic(
102)'
>boolean
</button>
1036 <button onclick='callBasic(
103)'
>short
</button>
1037 <button onclick='callBasic(
104)'
>u short
</button>
1038 <button onclick='callBasic(
105)'
>long
</button>
1039 <button onclick='callBasic(
106)'
>u long
</button>
1040 <button onclick='callBasic(
107)'
>string
</button>
1041 <button onclick='callBasic(
108)'
>char
</button>
1042 <button onclick='callBasic(
109)'
>any
</button> <br>
1044 Simple out parameter
<br>
1045 <button onclick='callBasic(
150)'
>byte
</button>
1046 <!--<button onclick='callBasic(151)'>double</button>
1047 <button onclick='callBasic(152)'>boolean</button>
1048 <button onclick='callBasic(153)'>short</button>
1049 <button onclick='callBasic(155)'>long</button>
1050 <button onclick='callBasic(157)'>string</button>
1051 <button onclick='callBasic(158)'>char</button>
1052 <button onclick='callBasic(159)'>any</button> <br>
1057 Tests Array/Sequence conversion with
<b>Attributes
</b>. All params are of type Sequence and
1058 the element type of the Sequence is written on the buttons.
<br>
1059 <button onclick='callBasic(
200)'
>byte
</Button>
1060 <button onclick='callBasic(
201)'
>double
</Button>
1061 <button onclick='callBasic(
202)'
>boolean
</Button>
1062 <button onclick='callBasic(
203)'
>short
</Button>
1063 <button onclick='callBasic(
204)'
>unsigned short
</Button>
1064 <button onclick='callBasic(
205)'
>long
</Button>
1065 <button onclick='callBasic(
206)'
>unsigned long
</Button>
1066 <button onclick='callBasic(
207)'
>string
</Button>
1067 <button onclick='callBasic(
208)'
>char
</Button>
1068 <button onclick='callBasic(
209)'
>any
</Button>
1069 <button onclick='callBasic(
210)'
>sequence<long>
</Button> <br>
1071 In Out parameter
<br>
1072 <button onclick='callBasic(
300)'
>byte
</Button>
1075 <button onclick='callBasic(
400)'
>methodStruct
</button>
1076 <button onclick='callBasic(
401)'
>return Struct
</button>
1077 <button onclick='callBasic(
402)'
>struct attribute
</button>