3 <META NAME=
"GENERATOR" Content=
"Microsoft Developer Studio">
4 <META HTTP-EQUIV=
"Content-Type" content=
"text/html; charset=iso-8859-1">
5 <TITLE>Document Title
</TITLE>
9 <script language=
"JScript">
10 // XEventListener implementation in JScript --------------------------------------------------
11 function XEventListener_Impl()
13 this._environment=
"JScript";
14 this._implementedInterfaces= new Array(
"com.sun.star.lang.XEventListener");
17 this.disposing= XEventListener_disposing;
19 this.bdisposingCalled= false;
21 this.resetDisposing= XEventListener_resetDisposing;
22 this.disposingCalled= XEventListener_disposingCalled;
25 function XEventListener_disposing( source)
28 alert(
"JScript Event Listener \n disposing is being called");
29 this.bdisposingCalled= true;
32 function XEventListener_resetDisposing()
34 this.bdisposingCalled= false;
37 function XEventListener_disposingCalled()
39 return this.bdisposingCalled;
42 //--------------------------------------------------------------------------------------------
43 function callOleTest( id)
45 var factory= new ActiveXObject(
"com.sun.star.ServiceManager");
46 var oletest= factory.createInstance(
"oletest.OleTest");
49 var arr= new Array(
1,
2,
3,
4,
0);
50 var arrDouble= new Array(
1.2345,
12.345,
123,
45,
1234.5,
12345);
51 var arrBool= new Array(
1,
0,
2,
0,
3);
52 var arrChar= new Array( '
1', 'A',
"1",
"A", ' ',
55,
56);
53 var arrString= new Array(
"hamburger",
"cheeseburger",
"chicken nuggets",
"chicken wings" ,
"pizza");
54 var arrAny= new Array(
100,
100.1235,
"hallo");
55 var arrSeq= new Array( arr, arr, arr);
56 var arrSeq2= new Array( arrSeq, arrSeq, arrSeq)
59 var arrout1= new Array();
60 var arrout2= new Array();
61 var arrout3= new Array();
64 var sfarray, sfarray1, sfarray2, sfarray3;
65 var arEventListener= new Array( new XEventListener_Impl(), new XEventListener_Impl(),
66 new XEventListener_Impl());
67 var arEventListener2= new Array( new XEventListener_Impl(), new XEventListener_Impl(),
68 new XEventListener_Impl());
69 var arArEventListener= new Array( arEventListener, arEventListener2);
73 case
1: ret= oletest.methodByte( arr);
74 sfarray= new VBArray( ret);
75 document.writeln(
"Param: " + arr.toString() +
"<br>");
76 document.writeln(
"Returns a Sequence< BYTE > <br>" + sfarray.toArray()) ; break;
78 case
2: ret= oletest.methodDouble( arrDouble);
79 sfarray= new VBArray( ret);
80 document.writeln(
"Param: " + arrDouble.toString() +
"<br>");
81 document.writeln(
"Returns a Sequence< double > <br>" + sfarray.toArray()) ; break;
83 case
3: ret= oletest.methodBool( arrBool);
84 sfarray= new VBArray( ret);
85 document.writeln(
"Param: " + arrBool.toString() +
"<br>");
86 document.writeln(
"Returns a Sequence< BOOL > <br>" + sfarray.toArray()) ; break;
88 case
4: ret= oletest.methodShort( arr);
89 sfarray= new VBArray( ret);
90 document.writeln(
"Param: " + arr.toString() +
"<br>");
91 document.writeln(
"Returns a Sequence< SHORT > <br>" + sfarray.toArray()) ; break;
93 case
5: ret= oletest.methodUShort( arr);
94 sfarray= new VBArray( ret);
95 document.writeln(
"Param: " + arr.toString() +
"<br>");
96 document.writeln(
"Returns a Sequence< unsigned SHORT > <br>" + sfarray.toArray()) ; break;
98 case
6: ret= oletest.methodLong( arr);
99 sfarray= new VBArray( ret);
100 document.writeln(
"Param: " + arr.toString() +
"<br>");
101 document.writeln(
"Returns a Sequence< LONG > <br>" + sfarray.toArray()) ; break;
103 case
7: ret= oletest.methodULong( arr);
104 sfarray= new VBArray( ret);
105 document.writeln(
"Param: " + arr.toString() +
"<br>");
106 document.writeln(
"Returns a Sequence< unsigned LONG > <br>" + sfarray.toArray()) ; break;
108 case
8: ret= oletest.methodChar( arrChar);
109 sfarray= new VBArray( ret);
110 document.writeln(
"Param: " + arrChar.toString() +
"<br>");
111 document.writeln(
"Returns a Sequence< wchar_t > <br>" + sfarray.toArray()) ; break;
113 case
9: ret= oletest.methodString( arrString);
114 sfarray= new VBArray( ret);
115 document.writeln(
"Param: " + arrString.toString() +
"<br>");
116 document.writeln(
"Returns a Sequence< UString > <br>" + sfarray.toArray()) ; break;
118 case
10: ret= oletest.methodAny( arrAny);
119 sfarray= new VBArray( ret);
120 document.writeln(
"Param: " + arrAny.toString() +
"<br>");
121 document.writeln(
"Returns a Sequence< UsrAny > <br>" + sfarray.toArray() ) ; break;
123 case
11: ret= oletest.methodSequence( arrSeq);
124 sfarray= new VBArray( ret);
125 document.writeln(
"Param: " + arrSeq.toString() +
"<br>");
126 document.writeln(
"Returns a Sequence< Sequence < long >> <br>") ;
127 var arr1= new Array();
128 arr1= sfarray.toArray();
129 for( i=
0; i < arr1.length; i++)
131 sfarray2= new VBArray( arr1[i]);
132 var arr2= new Array();
133 arr2= sfarray2.toArray();
134 document.writeln( arr2.toString() +
"<br>" );
138 case
12: ret= oletest.methodSequence2( arrSeq2);
139 document.writeln(
"Param: " + arrSeq2.toString() +
"<br>");
140 sfarray1= new VBArray( ret);
141 arr1= sfarray1.toArray();
142 for( i=
0; i < arr1.length; i++)
144 sfarray2= new VBArray( arr1[i]);
145 arr2= sfarray2.toArray();
147 for ( j=
0; j < arr2.length; j++)
149 sfarray3= new VBArray( arr2[j]);
150 arr3= sfarray3.toArray();
151 document.write( i+
" ");
152 document.writeln(j +
": "+ arr3.toString() +
"<br>" );
162 var ob= new Object();
163 ob.value=
"A JScript object!";
167 ret = oletest.methodXInterface( ar);
168 sfarray= new VBArray( ret);
169 var arRet= sfarray.toArray();
171 document.writeln(
"Params : Array containing objects ")
174 document.writeln(
"object " + index +
": " + ar[index].value +
" ");
176 document.writeln(
"<br>" ) ;
177 document.writeln(
"Return: <br>");
180 document.writeln(
"object " + index +
": " + arRet[index].value +
" ");
184 case
14: ret= oletest.methodFloat( arrDouble);
185 sfarray= new VBArray( ret);
186 document.writeln(
"Param: " + arrDouble.toString() +
"<br>");
187 document.writeln(
"Returns a Sequence< float> <br>" + sfarray.toArray()) ; break;
190 ret= oletest.methodXEventListeners( arEventListener);
191 sfarray= new VBArray(ret);
192 _ret= sfarray.toArray();
195 if( ! _ret[key].disposingCalled())
196 alert(
"Error! oletest.methodXEventListeners")
200 ret= oletest.methodXEventListenersMul( arArEventListener);
201 sfarray= new VBArray(ret);
202 _ret= sfarray.toArray();
205 sfarray2= new VBArray(_ret[key]);
206 _ret2= sfarray2.toArray();
209 if( ! _ret2[key2].disposingCalled())
210 alert(
"Error! oletest.methodXEventListeners")
217 // Properties: setting and getting values
218 case
200: oletest.AttrByte = arr;
219 ret= oletest.AttrByte;
220 document.writeln(
"Setting AttrByte: " + arr.toString() +
"<p>");
221 document.writeln(
"Getting AttrByte: " + arr.toString()); break;
223 case
201: oletest.AttrDouble= arrDouble;
224 ret= oletest.AttrDouble;
225 document.writeln(
"Setting AttrDouble: " + arrDouble.toString() +
"<p>");
226 document.writeln(
"Getting AttrDouble: " + arrDouble.toString()); break;
228 case
202: oletest.AttrBool= arrBool;
229 ret= oletest.AttrBool;
230 document.writeln(
"Setting AttrBool: " + arrBool.toString() +
"<p>");
231 document.writeln(
"Getting AttrBool: " + arrBool.toString()); break;
233 case
203: oletest.AttrShort= arr;
234 ret= oletest.AttrShort;
235 document.writeln(
"Setting AttrShort: " + arr.toString() +
"<p>");
236 document.writeln(
"Getting AttrShort: " + arr.toString()); break;
238 case
204: oletest.AttrUShort= arr;
239 ret= oletest.AttrUShort;
240 document.writeln(
"Setting AttrUShort: " + arr.toString() +
"<p>");
241 document.writeln(
"Getting AttrUShort: " + arr.toString()); break;
243 case
205: oletest.AttrLong= arr;
244 ret= oletest.AttrLong;
245 document.writeln(
"Setting AttrLong: " + arr.toString() +
"<p>");
246 document.writeln(
"Getting AttrLong: " + arr.toString()); break;
248 case
206: oletest.AttrULong= arr;
249 ret= oletest.AttrULong;
250 document.writeln(
"Setting AttrULong: " + arr.toString() +
"<p>");
251 document.writeln(
"Getting AttrULong: " + arr.toString()); break;
253 case
207: oletest.AttrChar= arrChar;
254 ret= oletest.AttrChar;
255 document.writeln(
"Setting AttrChar: " + arrChar.toString() +
"<p>");
256 document.writeln(
"Getting AttrChar: " + arrChar.toString()); break;
258 case
208: oletest.AttrString= arrString;
259 ret= oletest.AttrString;
260 document.writeln(
"Setting AttrString: " + arrString.toString() +
"<p>");
261 document.writeln(
"Getting AttrString: " + arrString.toString()); break;
263 case
209: oletest.AttrAny= arrAny;
264 ret= oletest.AttrAny;
265 document.writeln(
"Setting AttrAny: " + arrAny.toString() +
"<p>");
266 document.writeln(
"Getting AttrAny: " + arrAny.toString()); break;
268 case
210: oletest.AttrSequence= arrSeq;
269 ret= oletest.AttrSequence;
270 document.writeln(
"Setting AttrSequence: " + arrSeq.toString() +
"<p>");
271 document.writeln(
"Getting AttrSequence: " + arrSeq.toString()); break;
273 case
211: oletest.AttrSequence2= arrSeq2;
274 ret= oletest.AttrSequence2;
275 document.writeln(
"Setting AttrSequence2: " + arrSeq2.toString() +
"<p>");
276 document.writeln(
"Getting AttrSequence2: " + arrSeq2.toString()); break;
278 case
212: oletest.AttrFloat= arrDouble;
279 ret= oletest.AttrFloat;
280 document.writeln(
"Setting AttrFloat: " + arrDouble.toString() +
"<p>");
281 document.writeln(
"Getting AttrFloat: " + arrDouble.toString()); break;
285 // Out-parameter ------------------------------------------------------------
287 oletest.testout_methodByte( arrout1 );
288 alert(
"byte: " + arrout1[
0] ); break;
290 oletest.testout_methodDouble( arrout1 );
291 alert(
"double: " + arrout1[
0] ); break;
293 oletest.testout_methodBool( arrout1 );
294 alert(
"boolean: " + arrout1[
0] ); break;
296 oletest.testout_methodShort( arrout1 );
297 alert(
"short: " + arrout1[
0] ); break;
299 oletest.testout_methodUShort( arrout1 );
300 alert(
"unsigned short: " + arrout1[
0] ); break;
302 oletest.testout_methodLong( arrout1 );
303 alert(
"long: " + arrout1[
0] ); break;
305 oletest.testout_methodULong( arrout1 );
306 alert(
"unsigned long: " + arrout1[
0] ); break;
308 oletest.testout_methodChar( arrout1 );
309 alert(
"char: " + arrout1[
0] ); break;
311 oletest.testout_methodString( arrout1 );
312 alert(
"string: " + arrout1[
0] ); break;
314 oletest.testout_methodAny( arrout1 );
315 alert(
"any: " + arrout1[
0] ); break;
317 oletest.testout_methodSequence( arrout1 );
318 var sfarray= new VBArray( arrout1[
0]);
319 arr= sfarray.toArray();
320 document.writeln(
"use the browser's back arrow to go to the previous page <p>");
321 document.writeln( arr.toString());
324 oletest.testout_methodSequence2( arrout1 );
325 var sfarray= new VBArray( arrout1[
0]);
326 arr= sfarray.toArray();
328 for( i=
0; i < arr.length; i++)
330 var sfarray= new VBArray( arr[i]);
331 var arr2= new Array();
332 arr2= sfarray.toArray();
333 document.writeln( arr2.toString() +
"<br>" );
337 oletest.testout_methodMulParams1( arrout1, arrout2 );
338 document.writeln(
"int : " + arrout1[
0] +
" int :" + arrout2[
0] ); break;
340 oletest.testout_methodMulParams2( arrout1, arrout2, arrout3 );
341 document.writeln(
"int: " + arrout1[
0] +
" int: " + arrout2[
0] +
" string: " + arrout3[
0] ); break;
343 oletest.testout_methodMulParams3(
"hallo", arrout1 );
344 document.writeln(
"string: " + arrout1[
0] ); break;
346 oletest.testout_methodXInterface( arrout1 );
347 var outVal= arrout1[
0];
348 alert( outVal.AttrAny2);
349 document.writeln(
"string: " + arrout1[
0].AttrAny2); break;
351 oletest.testout_methodFloat( arrout1 );
352 alert(
"float: " + arrout1[
0] ); break;
357 oletest.testout_methodMulParams4( in1, arrout1, in2, arrout2, in3 );
358 document.write(
"param1 [in] float: " + in1 +
" param2 [out] float: " + arrout1[
0] +
359 " param3 [in] long: " + in2 +
" param4 [out] long: " + arrout2[
0] +
360 " param5 [in] long: " + in3);
364 // INOUT - Parameter -------------------------------------------------------------------------------
365 // The in value has to be placed on index
0 of the passed in array
368 oletest.testinout_methodByte( arrout1 );
369 alert(
"byte: " + arrout1[
0] ); break;
372 oletest.testinout_methodDouble( arrout1 );
373 alert(
"double: " + arrout1[
0] ); break;
376 oletest.testinout_methodBool( arrout1 );
377 alert(
"boolean: " + arrout1[
0] ); break;
380 oletest.testinout_methodShort( arrout1 );
381 alert(
"short: " + arrout1[
0] ); break;
384 oletest.testinout_methodUShort( arrout1 );
385 alert(
"unsigned short: " + arrout1[
0] ); break;
388 oletest.testinout_methodLong( arrout1 );
389 alert(
"long: " + arrout1[
0] ); break;
392 oletest.testinout_methodULong( arrout1 );
393 alert(
"unsigned long: " + arrout1[
0] ); break;
396 oletest.testinout_methodChar( arrout1 );
397 alert(
"char: " + arrout1[
0] ); break;
399 arrout1[
0]=
"I am a string";
400 oletest.testinout_methodString( arrout1 );
401 alert(
"string: " + arrout1[
0] ); break;
404 oletest.testinout_methodAny( arrout1 ); // the method simply returns the argument
405 sfarray= new VBArray( arrout1[
0]);
406 arr= sfarray.toArray();
407 alert(
"any: " + arr.toString() ); break;
410 oletest.testinout_methodSequence( arrout1 );
411 var sfarray= new VBArray( arrout1[
0]);
412 arr= sfarray.toArray();
413 document.writeln(
"use the browser's back arrow to go to the previous page <p>");
414 document.writeln( arr.toString());
418 oletest.testinout_methodSequence2( arrout1 );
419 var sfarray= new VBArray( arrout1[
0]);
420 arr= sfarray.toArray();
422 for( i=
0; i < arr.length; i++)
424 var sfarray= new VBArray( arr[i]);
425 var arr2= new Array();
426 arr2= sfarray.toArray();
427 document.writeln( arr2.toString() +
"<br>" );
431 var ob= new Object();
432 ob.value=
"this is a string";
435 alert (arrout1[
0].value);
436 oletest.testinout_methodXInterface( arrout1);
437 alert (arrout1[
0].value);
438 var outValue= arrout1[
0];
439 for ( key in outValue)
441 document.write( outValue[key] );
443 document.write(
"Out value: " + outValue );
444 document.write(
"Out 1 value: " + arrout1[
1]);
447 // var ob= new Object();
448 // ob.value=
"this is a string";
449 // inoutValue.Set(
"object", ob);
450 // oletest.testinout_methodXInterface( inoutValue);
451 // document.write(
"Out value: " + inoutValue.Get().value );
456 oletest.testinout_methodFloat( arrout1 );
457 alert(
"float: " + arrout1[
0] ); break;
465 ret= oletest.methodAnyTest1( i);
466 document.writeln(
"in: " + i +
" ret: " + ret);
470 ret= oletest.methodAnyTest1( i);
471 document.writeln(
"in: " + i +
" ret: " + ret);
475 ret= oletest.methodAnyTest1( i);
476 document.writeln(
"in: " + i +
" ret: " + ret);
480 ret= oletest.methodAnyTest1( i);
481 sfarray= new VBArray( ret);
482 document.writeln(
"in: " + i +
" ret: " + sfarray.toArray());
485 var obj= new Object();
486 obj[
1]=
"This is index 0";
487 ret= oletest.methodAnyTest1( obj);
488 document.writeln(
"in: " + obj +
" ret: " + ret);
496 ret= oletest.AttrAny2;
497 document.writeln(
"set: " + i +
" get: " + ret);
502 ret= oletest.AttrAny2;
503 document.writeln(
"set: " + i +
" get: " + ret);
508 ret= oletest.AttrAny2;
509 document.writeln(
"set: " + i +
" get: " + ret);
514 ret= oletest.AttrAny2;
515 sfarray= new VBArray( ret);
516 document.writeln(
"set: " + i +
" get: " + sfarray.toArray());
519 var obj= new Object();
520 obj[
1]=
"This is index 0";
521 oletest.AttrAny2= obj;
522 ret= oletest.AttrAny2;
523 document.writeln(
"set: " + obj +
" get: " + ret);
526 // Structs ----------------------------------------------
528 var struct= oletest._GetStruct(
"com.sun.star.beans.Property");
529 struct.Attributes=
1;
531 struct.Name=
"some Property"
532 oletest.methodStruct( struct);
535 var struct= oletest.retMethodStruct();
536 alert(
"Property::Attributes : " + struct.Attributes +
" \nProperty::Handle : "
537 + struct.Handle +
"\n Property::Name : " + struct.Name);
540 var struct= oletest._GetStruct(
"com.sun.star.beans.Property");
541 struct.Attributes=
1;
543 struct.Name=
"some Property"
544 oletest.AttrStruct= struct;
546 var struct2= oletest.AttrStruct;
547 alert(
"property get: \n Property::Attributes : " + struct2.Attributes +
" \nProperty::Handle : "
548 + struct2.Handle +
"\n Property::Name : " + struct2.Name);
553 var ret= oletest.retMethodByte();
554 var sfarray= VBArray( ret);
555 document.writeln( sfarray.toArray() );
564 function funcOut( out)
571 <script language=
"VBScript">
576 Set factory= GetObject(
"",
"com.sun.star.ServiceManager")
578 Set oletest= factory.createInstance(
"oletest.OleTest")
581 arrInt= Array(
1,
2,
3,
4,
5)
582 arrInt2= Array( -
1, -
2,
127,
128,
0)
583 arrDouble= Array(
1.1,
2.2,
3.3,
4.4,
5.5)
584 arrBool= Array(
0,
1,
0,
2,
0)
585 arrLong= Array( &Hff, &Hffff, &Hffffff, &Hffffffff)
586 arrString= Array(
"Chicken Wings",
"Cheeseburger",
"Hamburger")
587 arrChar= Array(
"a",
65,
"M")
588 arrAny= Array(
"Mickey",
3.14,
100,
"A")
593 arrDim2Int(i,j) = i*
2 + j
597 Dim arrDim3Int(
1,
1,
1)
601 arrDim3Int(i,j,k) = i*
2 + j*
2 + k
609 document.writeln
"param: "
611 ret= oletest.methodByte(arrInt)
612 document.writeln
"<br> return value: "
615 document.writeln
"param: "
617 ret= oletest.methodDouble(arrDouble)
618 document.writeln
"<br> return value: "
621 document.writeln
"param: "
623 ret= oletest.methodBool(arrBool)
624 document.writeln
"<br> return value: "
627 document.writeln
"param: "
629 ret= oletest.methodShort(arrInt2)
630 document.writeln
"<br> return value: "
633 document.writeln
"param: "
635 ret= oletest.methodUShort(arrInt)
636 document.writeln
"<br> return value: "
639 document.writeln
"param: "
641 ret= oletest.methodLong(arrLong)
642 document.writeln
"<br> return value: "
645 document.writeln
"param: "
647 ret= oletest.methodULong(arrInt)
648 document.writeln
"<br> return value: "
651 document.writeln
"param: "
653 ret= oletest.methodString(arrString)
654 document.writeln
"<br> return value: "
657 document.writeln
"param: "
659 ret= oletest.methodChar(arrChar)
660 document.writeln
"<br> return value: "
663 document.writeln
"param: "
665 ret= oletest.methodAny(arrAny)
666 document.writeln
"<br> return value: "
669 document.writeln
"param: "
670 printArray2 arrDim2Int
671 ret= oletest.methodSequence(arrDim2Int)
672 document.writeln
"<br> return value: "
674 document.write
"<br> array: "
683 oletest.testout_methodByte rOut
685 // void testout_methodFloat( [out] float rOut);
686 // void testout_methodDouble( [out] double rOut);
687 // void testout_methodBool( [out] boolean rOut);
688 // void testout_methodShort( [out] short rOut);
689 // void testout_methodUShort( [out] unsigned short rOut);
690 // void testout_methodLong( [out] long rOut);
691 // void testout_methodULong( [out] unsigned long rOut);
694 // In Out Parameter --------------------------------------------------
697 document.write
"param: " & CStr( a) &
"<br>"
698 oletest.testinout_methodByte a
702 document.write
"param: " & CStr( a) &
"<br>"
703 oletest.testinout_methodDouble a
707 document.write
"param: "& CStr( a) &
"<br>"
708 oletest.testinout_methodBool a
712 document.write
"param: "& CStr( a) &
"<br>"
713 oletest.testinout_methodShort a
717 document.write
"param: "& CStr( a) &
"<br>"
718 oletest.testinout_methodUShort a
722 document.write
"param: "& CStr( a) &
"<br>"
723 oletest.testinout_methodLong a
727 document.write
"param: "& CStr( a) &
"<br>"
728 oletest.testinout_methodULong a
732 document.write
"param: "& CStr( a) &
"<br>"
733 oletest.testinout_methodString a
737 document.write
"param: "& CStr( a) &
"<br>"
738 oletest.testinout_methodChar a
741 a=
"Ein String im Any"
742 document.write
"param: "& CStr( a) &
"<br>"
743 oletest.other_methodAnyIn a
748 document.write
"param: "& CStr( a) &
"<br>"
749 oletest.testout_methodByte( a)
751 // Attributes -----------------------------------------------------------------
753 document.write
"set: "
755 oletest.AttrByte= arrInt
757 call printArrayEx(
"<br> get: ",
"<br>", b)
759 document.write
"set: "
761 oletest.AttrDouble= arrDouble
762 b= oletest.AttrDouble
763 call printArrayEx(
"<br> get: ",
"<br>", b)
765 document.write
"set: "
767 oletest.AttrBool= arrBool
769 call printArrayEx(
"<br> get: ",
"<br>", b)
771 document.write
"set: "
773 oletest.AttrShort= arrInt2
775 call printArrayEx(
"<br> get: ",
"<br>", b)
777 document.write
"set: "
779 oletest.AttrUShort= arrInt
780 b= oletest.AttrUShort
781 call printArrayEx(
"<br> get: ",
"<br>", b)
783 document.write
"set: "
785 oletest.AttrLong= arrInt2
787 call printArrayEx(
"<br> get: ",
"<br>", b)
789 document.write
"set: "
791 oletest.AttrULong= arrInt
793 call printArrayEx(
"<br> get: ",
"<br>", b)
795 document.write
"set: "
797 oletest.AttrString= arrString
798 b= oletest.AttrString
799 call printArrayEx(
"<br> get: ",
"<br>", b)
801 document.write
"set: "
803 oletest.AttrChar= arrChar
805 call printArrayEx(
"<br> get: ",
"<br>", b)
807 document.write
"set: "
809 oletest.AttrAny= arrAny
811 call printArrayEx(
"<br> get: ",
"<br>", b)
814 document.write
"set: <br>"
815 printArray2 arrDim2Int :
816 oletest.AttrSequence= arrDim2Int
817 ret= oletest.AttrSequence
818 document.write
"get: "
820 document.write
"<br> array: "
829 call oletest.testinout_methodByte( aByte)
835 set struct= oletest.Bridge_GetStruct(
"com.sun.star.beans.Property")
838 struct.Name=
"some Property"
839 oletest.methodStruct struct
842 set struct= oletest.retMethodStruct()
843 alert(
"Property::Attributes : " & struct.Attributes & vblf &
" Property::Handle : " _
844 & struct.Handle & vblf &
" Property::Name : " & struct.Name)
847 set struct= oletest.Bridge_GetStruct(
"com.sun.star.beans.Property")
850 struct.Name=
"some Property"
851 oletest.AttrStruct= struct
853 set struct2= oletest.AttrStruct
854 alert(
"property get: " & vblf &
"Property::Attributes : " & struct2.Attributes & _
855 vblf &
" Property::Handle : " & struct2.Handle & vblf &
" Property::Name : " _
861 document.write
"array: "
863 document.write CStr(val) &
" "
867 // print a
2 dimensional Array
869 sub printArray2( arr)
870 elements1= UBound( arr,
1) - LBound( arr,
1) +
1
871 elements2= UBound( arr,
2) - LBound( arr,
2) +
1
873 For i=
0 To elements1 -
1
874 document.write(
"array " & CStr( i) &
": " )
875 For j=
0 To elements2 -
1
876 document.write CStr( arr(i,j))
878 document.write(
"<br>")
882 sub printArrayEx( pre, post, array)
891 <!-- Insert HTML here -->
894 Tests Array/Sequence conversion.
<br>
895 All methods receive a Sequence as Parameter. The element type of the Sequence is written on the buttons.
897 <button onclick='callOleTest(
1)'
>byte
</Button>
898 <button onclick='callOleTest(
14)'
>float
</Button>
899 <button onclick='callOleTest(
2)'
>double
</Button>
900 <button onclick='callOleTest(
3)'
>boolean
</Button>
901 <button onclick='callOleTest(
4)'
>short
</Button>
902 <button onclick='callOleTest(
5)'
>unsigned short
</Button>
903 <button onclick='callOleTest(
6)'
>long
</Button>
904 <button onclick='callOleTest(
7)'
>unsigned long
</Button>
905 <button onclick='callOleTest(
8)'
>char
</Button>
906 <button onclick='callOleTest(
9)'
>string
</Button>
907 <button onclick='callOleTest(
10)'
>any
</Button>
908 <button onclick='callOleTest(
11)'
>sequence
<long
> </Button>
909 <button onclick='callOleTest(
12)'
>sequence
<sequence
<long
> > </Button>
910 <button onclick='callOleTest(
13)' id=button2 name=button2
>XInterface
</Button>
911 <button onclick='callOleTest(
15)'
>XEventListener
</Button>
912 <button onclick='callOleTest(
16)'
>sequence
<XEventListener
></Button>
917 <button onclick='callOleTest(
2000)'
>byte
</Button>
918 <button onclick='callOleTest(
2016)'
>float
</Button>
919 <button onclick='callOleTest(
2001)'
>double
</Button>
920 <button onclick='callOleTest(
2002)'
>boolean
</Button>
921 <button onclick='callOleTest(
2003)'
>short
</Button>
922 <button onclick='callOleTest(
2004)'
>unsigned short
</Button>
923 <button onclick='callOleTest(
2005)'
>long
</Button>
924 <button onclick='callOleTest(
2006)'
>unsigned long
</Button>
925 <button onclick='callOleTest(
2007)'
>char
</Button>
926 <button onclick='callOleTest(
2008)'
>string
</Button>
927 <button onclick='callOleTest(
2009)'
>any
</Button>
928 <button onclick='callOleTest(
2010)'
>sequence<long>
</Button>
929 <button onclick='callOleTest(
2011)'
>sequence<sequence<long> >
</Button>
930 <button onclick='callOleTest(
2012)'
>2 out
</Button>
931 <button onclick='callOleTest(
2013)'
>3 out
</Button>
932 <button onclick='callOleTest(
2014)'
>1 in &
1 out
</Button>
933 <button onclick='callOleTest(
2015)'
>XInterface
</Button>
934 <button onclick='callOleTest(
2017)'
>mixed out and in
</Button>
938 In Out Parameter
<br>
939 <button onclick='callOleTest(
500)'
>byte
</Button>
940 <button onclick='callOleTest(
513)'
>float
</Button>
941 <button onclick='callOleTest(
501)'
>double
</Button>
942 <button onclick='callOleTest(
502)'
>boolean
</Button>
943 <button onclick='callOleTest(
503)'
>short
</Button>
944 <button onclick='callOleTest(
504)'
>unsigned short
</Button>
945 <button onclick='callOleTest(
505)'
>long
</Button>
946 <button onclick='callOleTest(
506)'
>unsigned long
</Button>
947 <button onclick='callOleTest(
507)'
>char
</Button>
948 <button onclick='callOleTest(
508)'
>string
</Button>
949 <button onclick='callOleTest(
509)'
>any
</Button>
950 <button onclick='callOleTest(
510)'
>sequence<long>
</Button>
951 <button onclick='callOleTest(
511)'
>sequence<sequence<long> >
</Button>
952 <button onclick='callOleTest(
512)'
>XInterface
</Button>
955 Tests Array/Sequence conversion with Attributes. All params are of type Sequence and
956 the element type of the Sequence is written on the buttons.
<br>
957 <button onclick='callOleTest(
200)'
>byte
</Button>
958 <button onclick='callOleTest(
212)'
>float
</Button>
959 <button onclick='callOleTest(
201)'
>double
</Button>
960 <button onclick='callOleTest(
202)'
>boolean
</Button>
961 <button onclick='callOleTest(
203)'
>short
</Button>
962 <button onclick='callOleTest(
204)'
>unsigned short
</Button>
963 <button onclick='callOleTest(
205)'
>long
</Button>
964 <button onclick='callOleTest(
206)'
>unsigned long
</Button>
965 <button onclick='callOleTest(
207)'
>char
</Button>
966 <button onclick='callOleTest(
208)'
>string
</Button>
967 <button onclick='callOleTest(
209)'
>any
</Button>
968 <button onclick='callOleTest(
210)'
>sequence<long>
</Button>
969 <button onclick='callOleTest(
211)'
>sequence<sequence<long> >
</Button>
972 Test of Any parameter in a method. Any contains:
<br>
973 <button onclick='callOleTest(
1000)'
>integer
</Button>
974 <button onclick='callOleTest(
1001)'
>double
</Button>
975 <button onclick='callOleTest(
1002)'
>string
</Button>
976 <button onclick='callOleTest(
1003)'
>array
</Button>
977 <button onclick='callOleTest(
1004)'
>object
</Button>
979 Test of Any parameter in a property. Any contains:
<br>
980 <button onclick='callOleTest(
1010)'
>integer
</Button>
981 <button onclick='callOleTest(
1011)'
>double
</Button>
982 <button onclick='callOleTest(
1012)'
>string
</Button>
983 <button onclick='callOleTest(
1013)'
>array
</Button>
984 <button onclick='callOleTest(
1014)'
>object
</Button>
986 Test of Struct conversions
<br>
987 <button onclick='callOleTest(
1020)'
>methodStruct
</Button>
988 <button onclick='callOleTest(
1021)'
>return struct
</Button>
989 <button onclick='callOleTest(
1022)'
>struct attribute
</Button>
997 <h2> Visual Basic Tests
</h2>
998 Test array /Sequence conversion and return value
<br>
999 Template:
<b> Sequence < type > method( Sequence< type > )
</b> <br>
1000 <!--<font color= red>Multi dimensional arrays are not processed by VBSript</font> <br> -->
1001 <button onclick='callBasic(
0)'
>byte
</button>
1002 <button onclick='callBasic(
1)'
>double
</button>
1003 <button onclick='callBasic(
2)'
>boolean
</button>
1004 <button onclick='callBasic(
3)'
>short
</button>
1005 <button onclick='callBasic(
4)'
>u short
</button>
1006 <button onclick='callBasic(
5)'
>long
</button>
1007 <button onclick='callBasic(
6)'
>u long
</button>
1008 <button onclick='callBasic(
7)'
>string
</button>
1009 <button onclick='callBasic(
8)'
>char
</button>
1010 <button onclick='callBasic(
9)'
>any
</button> <br>
1011 <button onclick='callBasic(
10)'
>Seq < int >
</button> <br>
1014 IN/Out parameter
<br>
1015 Template:
<b> void method(type )
</b> <br>
1016 <button onclick='callBasic(
100)'
>byte
</button>
1017 <button onclick='callBasic(
101)'
>double
</button>
1018 <button onclick='callBasic(
102)'
>boolean
</button>
1019 <button onclick='callBasic(
103)'
>short
</button>
1020 <button onclick='callBasic(
104)'
>u short
</button>
1021 <button onclick='callBasic(
105)'
>long
</button>
1022 <button onclick='callBasic(
106)'
>u long
</button>
1023 <button onclick='callBasic(
107)'
>string
</button>
1024 <button onclick='callBasic(
108)'
>char
</button>
1025 <button onclick='callBasic(
109)'
>any
</button> <br>
1027 Simple out parameter
<br>
1028 <button onclick='callBasic(
150)'
>byte
</button>
1029 <!--<button onclick='callBasic(151)'>double</button>
1030 <button onclick='callBasic(152)'>boolean</button>
1031 <button onclick='callBasic(153)'>short</button>
1032 <button onclick='callBasic(155)'>long</button>
1033 <button onclick='callBasic(157)'>string</button>
1034 <button onclick='callBasic(158)'>char</button>
1035 <button onclick='callBasic(159)'>any</button> <br>
1040 Tests Array/Sequence conversion with
<b>Attributes
</b>. All params are of type Sequence and
1041 the element type of the Sequence is written on the buttons.
<br>
1042 <button onclick='callBasic(
200)'
>byte
</Button>
1043 <button onclick='callBasic(
201)'
>double
</Button>
1044 <button onclick='callBasic(
202)'
>boolean
</Button>
1045 <button onclick='callBasic(
203)'
>short
</Button>
1046 <button onclick='callBasic(
204)'
>unsigned short
</Button>
1047 <button onclick='callBasic(
205)'
>long
</Button>
1048 <button onclick='callBasic(
206)'
>unsigned long
</Button>
1049 <button onclick='callBasic(
207)'
>string
</Button>
1050 <button onclick='callBasic(
208)'
>char
</Button>
1051 <button onclick='callBasic(
209)'
>any
</Button>
1052 <button onclick='callBasic(
210)'
>sequence<long>
</Button> <br>
1054 In Out parameter
<br>
1055 <button onclick='callBasic(
300)'
>byte
</Button>
1058 <button onclick='callBasic(
400)'
>methodStruct
</button>
1059 <button onclick='callBasic(
401)'
>return Struct
</button>
1060 <button onclick='callBasic(
402)'
>struct attribute
</button>