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 function callOleTest( id)
29 var factory= new ActiveXObject(
"com.sun.star.ServiceManager");
30 var oletest= factory.createInstance(
"oletest.OleTest");
33 var arr= new Array(
1,
2,
3,
4,
0);
34 var arrDouble= new Array(
1.2345,
12.345,
123,
45,
1234.5,
12345);
35 var arrBool= new Array(
1,
0,
2,
0,
3);
36 var arrChar= new Array( '
1', 'A',
"1",
"A", ' ',
55,
56);
37 var arrString= new Array(
"hamburger",
"cheeseburger",
"chicken nuggets",
"chicken wings" ,
"pizza");
38 var arrAny= new Array(
100,
100.1235,
"hallo");
39 var arrSeq= new Array( arr, arr, arr);
40 var arrSeq2= new Array( arrSeq, arrSeq, arrSeq)
42 // var ob= new Object();
43 // ob.value=
"A JScript object";
44 // var arrObject= new Array( ob, ob, ob);
47 var arrout1= new Array();
48 var arrout2= new Array();
49 var arrout3= new Array();
52 var sfarray, sfarray1, sfarray2, sfarray3;
53 var value= oletest._GetValueObject();
54 var outValue= oletest._GetValueObject();
55 outValue.InitOutParam();
56 var outValue2= oletest._GetValueObject();
57 outValue2.InitOutParam();
58 var outValue3= oletest._GetValueObject();
59 outValue3.InitOutParam();
61 var inoutValue= oletest._GetValueObject();
62 // inoutValue.InitInOutParam();
68 value.Set(
"[]byte", arr)
69 ret= oletest.methodByte( value);
70 sfarray= new VBArray( ret);
71 document.writeln(
"Param: " + arr.toString() +
"<br>");
72 document.writeln(
"Returns a Sequence< BYTE > <br>" + sfarray.toArray()) ; break;
75 value.Set(
"[]double", arrDouble)
76 ret= oletest.methodDouble( value);
77 sfarray= new VBArray( ret);
78 document.writeln(
"Param: " + arrDouble.toString() +
"<br>");
79 document.writeln(
"Returns a Sequence< double > <br>" + sfarray.toArray()) ; break;
82 value.Set(
"[]boolean", arrBool)
83 ret= oletest.methodBool( value);
84 sfarray= new VBArray( ret);
85 document.writeln(
"Param: " + arrBool.toString() +
"<br>");
86 document.writeln(
"Returns a Sequence< BOOL > <br>" + sfarray.toArray()) ; break;
89 value.Set(
"[]short", arr)
90 ret= oletest.methodShort( value);
91 sfarray= new VBArray( ret);
92 document.writeln(
"Param: " + arr.toString() +
"<br>");
93 document.writeln(
"Returns a Sequence< SHORT > <br>" + sfarray.toArray()) ; break;
96 value.Set(
"[]unsigned short", arr)
97 ret= oletest.methodUShort( value);
98 sfarray= new VBArray( ret);
99 document.writeln(
"Param: " + arr.toString() +
"<br>");
100 document.writeln(
"Returns a Sequence< unsigned SHORT > <br>" + sfarray.toArray()) ; break;
103 value.Set(
"[]long", arr)
104 ret= oletest.methodLong( value);
105 sfarray= new VBArray( ret);
106 document.writeln(
"Param: " + arr.toString() +
"<br>");
107 document.writeln(
"Returns a Sequence< LONG > <br>" + sfarray.toArray()) ; break;
110 value.Set(
"[]unsigned long", arr)
111 ret= oletest.methodULong( value);
112 sfarray= new VBArray( ret);
113 document.writeln(
"Param: " + arr.toString() +
"<br>");
114 document.writeln(
"Returns a Sequence< unsigned LONG > <br>" + sfarray.toArray()) ; break;
117 value.Set(
"[]char", arrChar)
118 ret= oletest.methodChar( value);
119 sfarray= new VBArray( ret);
120 document.writeln(
"Param: " + arrChar.toString() +
"<br>");
121 document.writeln(
"Returns a Sequence< wchar_t > <br>" + sfarray.toArray()) ; break;
124 value.Set(
"[]string", arrString)
125 ret= oletest.methodString( value);
126 sfarray= new VBArray( ret);
127 document.writeln(
"Param: " + arrString.toString() +
"<br>");
128 document.writeln(
"Returns a Sequence< UString > <br>" + sfarray.toArray()) ; break;
131 value.Set(
"[]any", arrAny)
132 ret= oletest.methodAny( value);
133 sfarray= new VBArray( ret);
134 document.writeln(
"Param: " + arrAny.toString() +
"<br>");
135 document.writeln(
"Returns a Sequence< UsrAny > <br>" + sfarray.toArray() ) ; break;
138 var allArray= new Array();
139 for(var i=
0; i
<3; i++)
141 var value1= oletest._GetValueObject();
142 value1.Set(
"[]long", arr);
146 value.Set(
"[][]long", allArray);
148 ret= oletest.methodSequence( value);
149 sfarray= new VBArray( ret);
150 document.writeln(
"Param: " + arrSeq.toString() +
"<br>");
151 document.writeln(
"Returns a Sequence< Sequence < long >> <br>") ;
152 var arr1= new Array();
153 arr1= sfarray.toArray();
154 for( i=
0; i < arr1.length; i++)
156 sfarray2= new VBArray( arr1[i]);
157 var arr2= new Array();
158 arr2= sfarray2.toArray();
159 document.writeln( arr2.toString() +
"<br>" );
164 var array1= new Array();
165 for(var i=
0; i
<3; i++)
167 var array2 = new Array();
168 for( var j=
0; j <
3; j++)
170 var value2= oletest._GetValueObject();
171 value2.Set(
"[]long", arr);
175 var value1= oletest._GetValueObject();
176 value1.Set(
"[][]long", array2)
179 var valueAll= oletest._GetValueObject();
180 valueAll.Set(
"[][][]long",array1);
182 ret= oletest.methodSequence2( valueAll);
183 document.writeln(
"Param: " + arrSeq2.toString() +
"<br>");
184 sfarray1= new VBArray( ret);
185 arr1= sfarray1.toArray();
186 for( i=
0; i < arr1.length; i++)
188 sfarray2= new VBArray( arr1[i]);
189 arr2= sfarray2.toArray();
191 for ( j=
0; j < arr2.length; j++)
193 sfarray3= new VBArray( arr2[j]);
194 arr3= sfarray3.toArray();
195 document.write( i+
" ");
196 document.writeln(j +
": "+ arr3.toString() +
"<br>" );
207 var ob= new Object();
208 var valueObject= oletest._GetValueObject();
209 ob.value=
"A JScript object!";
210 valueObject.Set(
"com.sun.star.uno.XInterface", ob);
211 // valueObject.Set(
"long",
5);
214 value.Set(
"[]com.sun.star.uno.XInterface", ar);
215 // value.Set(
"[]long", ar);
217 ret = oletest.methodXInterface( value);
218 sfarray= new VBArray( ret);
219 var arRet= sfarray.toArray();
221 document.writeln(
"Params : Array containing objects ")
224 document.writeln(
"object " + index +
": " + ar[index].Get().value +
" ");
226 document.writeln(
"<br>" ) ;
227 document.writeln(
"Return: <br>");
230 document.writeln(
"object " + index +
": " + arRet[index].value +
" ");
237 // Properties: setting and getting values
239 value.Set(
"[]byte", arr)
240 oletest.AttrByte = value;
241 ret= oletest.AttrByte;
242 sfarray= new VBArray( ret);
243 document.writeln(
"Setting AttrByte: " + arr.toString() +
"<p>");
244 document.writeln(
"Getting AttrByte: " + sfarray.toArray()); break;
247 value.Set(
"[]double", arrDouble)
248 oletest.AttrDouble= value;
249 ret= oletest.AttrDouble;
250 sfarray= new VBArray( ret);
251 document.writeln(
"Setting AttrDouble: " + arrDouble.toString() +
"<p>");
252 document.writeln(
"Getting AttrDouble: " + sfarray.toArray()); break;
255 value.Set(
"[]boolean", arrBool)
256 oletest.AttrBool= value;
257 ret= oletest.AttrBool;
258 sfarray= new VBArray( ret);
259 document.writeln(
"Setting AttrBool: " + arrBool.toString() +
"<p>");
260 document.writeln(
"Getting AttrBool: " + sfarray.toArray()); break;
263 value.Set(
"[]short", arr)
264 oletest.AttrShort= value;
265 ret= oletest.AttrShort;
266 sfarray= new VBArray( ret);
267 document.writeln(
"Setting AttrShort: " + arr.toString() +
"<p>");
268 document.writeln(
"Getting AttrShort: " + sfarray.toArray()); break;
271 value.Set(
"[]unsigned short", arr)
272 oletest.AttrUShort= value;
273 ret= oletest.AttrUShort;
274 sfarray= new VBArray( ret);
275 document.writeln(
"Setting AttrUShort: " + arr.toString() +
"<p>");
276 document.writeln(
"Getting AttrUShort: " + sfarray.toArray()); break;
279 value.Set(
"[]long", arr)
280 oletest.AttrLong= value;
281 ret= oletest.AttrLong;
282 sfarray= new VBArray( ret);
283 document.writeln(
"Setting AttrLong: " + arr.toString() +
"<p>");
284 document.writeln(
"Getting AttrLong: " + sfarray.toArray()); break;
287 value.Set(
"[]unsigned long", arr)
288 oletest.AttrULong= value;
289 ret= oletest.AttrULong;
290 sfarray= new VBArray( ret);
291 document.writeln(
"Setting AttrULong: " + arr.toString() +
"<p>");
292 document.writeln(
"Getting AttrULong: " + sfarray.toArray()); break;
295 value.Set(
"[]char", arrChar)
296 oletest.AttrChar= value;
297 ret= oletest.AttrChar;
298 sfarray= new VBArray( ret);
299 document.writeln(
"Setting AttrChar: " + arrChar.toString() +
"<p>");
300 document.writeln(
"Getting AttrChar: " + sfarray.toArray()); break;
303 value.Set(
"[]string", arrString)
304 oletest.AttrString= value;
305 ret= oletest.AttrString;
306 sfarray= new VBArray( ret);
307 document.writeln(
"Setting AttrString: " + arrString.toString() +
"<p>");
308 document.writeln(
"Getting AttrString: " + sfarray.toArray()); break;
311 value.Set(
"[]any", arrAny)
312 oletest.AttrAny= value;
313 ret= oletest.AttrAny;
314 sfarray= new VBArray( ret);
315 document.writeln(
"Setting AttrAny: " + arrAny.toString() +
"<p>");
316 document.writeln(
"Getting AttrAny: " + sfarray.toArray()); break;
319 var allArray= new Array();
320 for(var i=
0; i
<3; i++)
322 var value1= oletest._GetValueObject();
323 value1.Set(
"[]long", arr);
327 value.Set(
"[][]long", allArray);
329 oletest.AttrSequence= value;
330 ret= oletest.AttrSequence;
331 sfarray= new VBArray( ret);
333 document.writeln(
"Param: " + arrSeq.toString() +
"<br>");
334 document.writeln(
"Returns a Sequence< Sequence < long >> <br>") ;
335 var arr1= new Array();
336 arr1= sfarray.toArray();
337 for( i=
0; i < arr1.length; i++)
339 sfarray2= new VBArray( arr1[i]);
340 var arr2= new Array();
341 arr2= sfarray2.toArray();
342 document.writeln( arr2.toString() +
"<br>" );
347 var array1= new Array();
348 for(var i=
0; i
<3; i++)
350 var array2 = new Array();
351 for( var j=
0; j <
3; j++)
353 var value2= oletest._GetValueObject();
354 value2.Set(
"[]long", arr);
358 var value1= oletest._GetValueObject();
359 value1.Set(
"[][]long", array2)
362 var valueAll= oletest._GetValueObject();
363 valueAll.Set(
"[][][]long",array1);
365 oletest.AttrSequence2= valueAll;
366 ret= oletest.AttrSequence2;
367 sfarray1= new VBArray( ret);
368 arr1= sfarray1.toArray();
369 for( i=
0; i < arr1.length; i++)
371 sfarray2= new VBArray( arr1[i]);
372 arr2= sfarray2.toArray();
374 for ( j=
0; j < arr2.length; j++)
376 sfarray3= new VBArray( arr2[j]);
377 arr3= sfarray3.toArray();
378 document.write( i+
" ");
379 document.writeln(j +
": "+ arr3.toString() +
"<br>" );
389 var ob= new Object();
390 var valueObject= oletest._GetValueObject();
391 ob.value=
"A JScript object!";
392 valueObject.Set(
"com.sun.star.uno.XInterface", ob);
395 value.Set(
"[]com.sun.star.uno.XInterface", ar);
397 oletest.AttrXInterface= value;
398 ret= oletest.AttrXInterface;
399 sfarray= new VBArray( ret);
400 var arRet= sfarray.toArray();
402 document.writeln(
"Params : Array containing objects ")
405 document.writeln(
"object " + index +
": " + ar[index].Get().value +
" ");
407 document.writeln(
"<br>" ) ;
408 document.writeln(
"Return: <br>");
411 document.writeln(
"object " + index +
": " + arRet[index].value +
" ");
416 // Out-parameter ------------------------------------------------------------
419 oletest.testout_methodByte( outValue );
420 alert(
"byte: " + outValue.Get() ); break;
422 oletest.testout_methodDouble( outValue );
423 alert(
"double: " + outValue.Get() ); break;
425 oletest.testout_methodBool( outValue );
426 alert(
"boolean: " + outValue.Get() ); break;
428 oletest.testout_methodShort( outValue );
429 alert(
"short: " + outValue.Get() ); break;
431 oletest.testout_methodUShort( outValue );
432 alert(
"unsigned short: " + outValue.Get() ); break;
434 oletest.testout_methodLong( outValue );
435 alert(
"long: " + outValue.Get() ); break;
437 oletest.testout_methodULong( outValue );
438 alert(
"unsigned long: " + outValue.Get() ); break;
440 oletest.testout_methodChar( outValue );
441 alert(
"char: " + outValue.Get() ); break;
443 oletest.testout_methodString( outValue );
444 alert(
"string: " + outValue.Get()); break;
446 oletest.testout_methodAny( outValue );
447 alert(
"any: " + outValue.Get() ); break;
449 oletest.testout_methodSequence( outValue );
450 var sfarray= new VBArray( outValue.Get());
451 arr= sfarray.toArray();
452 document.writeln(
"use the browser's back arrow to go to the previous page <p>");
453 document.writeln( arr.toString());
456 oletest.testout_methodSequence2( outValue );
457 var sfarray= new VBArray( outValue.Get());
458 arr= sfarray.toArray();
460 for( i=
0; i < arr.length; i++)
462 var sfarray= new VBArray( arr[i]);
463 var arr2= new Array();
464 arr2= sfarray.toArray();
465 document.writeln( arr2.toString() +
"<br>" );
469 oletest.testout_methodMulParams1( outValue, outValue2 );
470 document.writeln(
"int : " + outValue.Get() +
" int :" + outValue2.Get()); break;
472 oletest.testout_methodMulParams2( outValue, outValue2, outValue3 );
473 document.writeln(
"int: " + outValue.Get() +
" int: " + outValue2.Get() +
" string: " + outValue3.Get() ); break;
475 oletest.testout_methodMulParams3(
"hallo", outValue );
476 document.writeln(
"string: " + outValue.Get() ); break;
478 oletest.testout_methodXInterface( outValue );
479 var out= outValue.Get();
480 document.writeln(
"string: " + out.AttrAny2); break;
482 // INOUT - Parameter -------------------------------------------------------------------------------
483 // The in value has to be placed on index
0 of the passed in array
485 inoutValue.InitInOutParam(
"byte",
100);
486 oletest.testinout_methodByte( inoutValue );
487 alert(
"byte: " + inoutValue.Get() ); break;
489 inoutValue.InitInOutParam(
"double",
3.14);
490 oletest.testinout_methodDouble( inoutValue );
491 alert(
"double: " + inoutValue.Get() ); break;
493 inoutValue.InitInOutParam(
"boolean", false);
494 oletest.testinout_methodBool( inoutValue );
495 alert(
"boolean: " + inoutValue.Get() ); break;
497 inoutValue.InitInOutParam(
"short",
200);
498 oletest.testinout_methodShort( inoutValue );
499 alert(
"short: " + inoutValue.Get() ); break;
501 inoutValue.InitInOutParam(
"unsigned short",
300);
502 oletest.testinout_methodUShort( inoutValue );
503 alert(
"unsigned short: " + inoutValue.Get() ); break;
505 inoutValue.InitInOutParam(
"long",
400);
506 oletest.testinout_methodLong( inoutValue );
507 alert(
"long: " + inoutValue.Get() ); break;
509 inoutValue.InitInOutParam(
"unsigned long",
500);
510 oletest.testinout_methodULong( inoutValue );
511 alert(
"unsigned long: " + inoutValue.Get() ); break;
513 inoutValue.InitInOutParam(
"char",
"A");
514 oletest.testinout_methodChar( inoutValue );
515 alert(
"char: " + inoutValue.Get() ); break;
517 inoutValue.InitInOutParam(
"string",
"I am a string");
518 oletest.testinout_methodString( inoutValue );
519 alert(
"string: " + inoutValue.Get() ); break;
521 inoutValue.InitInOutParam(
"[]long", arr);
522 oletest.testinout_methodAny( inoutValue ); // the method simply returns the argument
523 sfarray= new VBArray( inoutValue.Get());
524 arr= sfarray.toArray();
525 alert(
"any: " + arr.toString() ); break;
527 inoutValue.InitInOutParam(
"[]long", arr);
528 oletest.testinout_methodSequence( inoutValue );
529 var sfarray= new VBArray( inoutValue.Get());
530 arr= sfarray.toArray();
531 document.writeln(
"use the browser's back arrow to go to the previous page <p>");
532 document.writeln( arr.toString());
535 inoutValue.InitInOutParam(
"[][]long", arrSeq);
536 oletest.testinout_methodSequence2( inoutValue );
537 var sfarray= new VBArray( inoutValue.Get());
538 arr= sfarray.toArray();
540 for( i=
0; i < arr.length; i++)
542 var sfarray= new VBArray( arr[i]);
543 var arr2= new Array();
544 arr2= sfarray.toArray();
545 document.writeln( arr2.toString() +
"<br>" );
549 var ob= new Object();
550 ob.value=
"this is a string";
551 inoutValue.InitInOutParam(
"com.sun.star.script.XInvocation", ob);
552 oletest.testinout_methodXInterface( inoutValue);
553 document.write(
"Out value: " + inoutValue.Get().value );
564 ret= oletest.methodAnyTest1( i);
565 document.writeln(
"in: " + i +
" ret: " + ret);
569 ret= oletest.methodAnyTest1( i);
570 document.writeln(
"in: " + i +
" ret: " + ret);
574 ret= oletest.methodAnyTest1( i);
575 document.writeln(
"in: " + i +
" ret: " + ret);
579 ret= oletest.methodAnyTest1( i);
580 sfarray= new VBArray( ret);
581 document.writeln(
"in: " + i +
" ret: " + sfarray.toArray());
584 var obj= new Object();
585 obj[
1]=
"This is index 0";
586 ret= oletest.methodAnyTest1( obj);
587 document.writeln(
"in: " + obj +
" ret: " + ret);
595 ret= oletest.AttrAny2;
596 document.writeln(
"set: " + i +
" get: " + ret);
601 ret= oletest.AttrAny2;
602 document.writeln(
"set: " + i +
" get: " + ret);
607 ret= oletest.AttrAny2;
608 document.writeln(
"set: " + i +
" get: " + ret);
613 ret= oletest.AttrAny2;
614 sfarray= new VBArray( ret);
615 document.writeln(
"set: " + i +
" get: " + sfarray.toArray());
618 var obj= new Object();
619 obj[
1]=
"This is index 0";
620 oletest.AttrAny2= obj;
621 ret= oletest.AttrAny2;
622 document.writeln(
"set: " + obj +
" get: " + ret);
628 var ret= oletest.retMethodByte();
629 var sfarray= VBArray( ret);
630 document.writeln( sfarray.toArray() );
635 // oletest.other_methodAnyIn(
"hallo");
643 function funcOut( out)
650 <script language=
"VBScript">
655 Set factory= GetObject(
"",
"com.sun.star.ServiceManager")
657 Set oletest= factory.createInstance(
"oletest.OleTest")
660 arrInt= Array(
1,
2,
3,
4,
5)
661 arrInt2= Array( -
1, -
2,
127,
128,
0)
662 arrDouble= Array(
1.1,
2.2,
3.3,
4.4,
5.5)
663 arrBool= Array(
0,
1,
0,
2,
0)
664 arrLong= Array( &Hff, &Hffff, &Hffffff, &Hffffffff)
665 arrString= Array(
"Chicken Wings",
"Cheeseburger",
"Hamburger")
666 arrChar= Array(
"a",
65,
"M")
667 arrAny= Array(
"Mickey",
3.14,
100,
"A")
672 arrDim2Int(i,j) = i*
2 + j
676 Dim arrDim3Int(
1,
1,
1)
680 arrDim3Int(i,j,k) = i*
2 + j*
2 + k
686 set outValue= factory.Bridge_GetValueObject()
687 outValue.InitOutParam
688 set value= factory.Bridge_GetValueObject()
691 value.Set
"[]byte", arrInt
692 ret= oletest.methodByte(value)
693 document.writeln
"<br> return value: "
696 document.writeln
"param: "
698 ret= oletest.methodDouble(arrDouble)
699 document.writeln
"<br> return value: "
702 document.writeln
"param: "
704 ret= oletest.methodBool(arrBool)
705 document.writeln
"<br> return value: "
708 document.writeln
"param: "
710 ret= oletest.methodShort(arrInt2)
711 document.writeln
"<br> return value: "
714 document.writeln
"param: "
716 ret= oletest.methodUShort(arrInt)
717 document.writeln
"<br> return value: "
720 document.writeln
"param: "
722 ret= oletest.methodLong(arrLong)
723 document.writeln
"<br> return value: "
726 document.writeln
"param: "
728 ret= oletest.methodULong(arrInt)
729 document.writeln
"<br> return value: "
732 document.writeln
"param: "
734 ret= oletest.methodString(arrString)
735 document.writeln
"<br> return value: "
738 document.writeln
"param: "
740 ret= oletest.methodChar(arrChar)
741 document.writeln
"<br> return value: "
744 document.writeln
"param: "
746 ret= oletest.methodAny(arrAny)
747 document.writeln
"<br> return value: "
750 document.writeln
"param: "
751 printArray2 arrDim2Int
752 ret= oletest.methodSequence(arrDim2Int)
753 document.writeln
"<br> return value: "
755 document.write
"<br> array: "
761 // In Out Parameter --------------------------------------------------
764 document.write
"param: " & CStr( a) &
"<br>"
765 oletest.testinout_methodByte a
769 document.write
"param: " & CStr( a) &
"<br>"
770 oletest.testinout_methodDouble a
774 document.write
"param: "& CStr( a) &
"<br>"
775 oletest.testinout_methodBool a
779 document.write
"param: "& CStr( a) &
"<br>"
780 oletest.testinout_methodShort a
784 document.write
"param: "& CStr( a) &
"<br>"
785 oletest.testinout_methodUShort a
789 document.write
"param: "& CStr( a) &
"<br>"
790 oletest.testinout_methodLong a
794 document.write
"param: "& CStr( a) &
"<br>"
795 oletest.testinout_methodULong a
799 document.write
"param: "& CStr( a) &
"<br>"
800 oletest.testinout_methodString a
804 document.write
"param: "& CStr( a) &
"<br>"
805 oletest.testinout_methodChar a
808 a=
"Ein String im Any"
809 document.write
"param: "& CStr( a) &
"<br>"
810 oletest.other_methodAnyIn a
812 // Attributes -----------------------------------------------------------------
814 document.write
"set: "
816 oletest.AttrByte= arrInt
818 call printArrayEx(
"<br> get: ",
"<br>", b)
820 document.write
"set: "
822 oletest.AttrDouble= arrDouble
823 b= oletest.AttrDouble
824 call printArrayEx(
"<br> get: ",
"<br>", b)
826 document.write
"set: "
828 oletest.AttrBool= arrBool
830 call printArrayEx(
"<br> get: ",
"<br>", b)
832 document.write
"set: "
834 oletest.AttrShort= arrInt2
836 call printArrayEx(
"<br> get: ",
"<br>", b)
838 document.write
"set: "
840 oletest.AttrUShort= arrInt
841 b= oletest.AttrUShort
842 call printArrayEx(
"<br> get: ",
"<br>", b)
844 document.write
"set: "
846 oletest.AttrLong= arrInt2
848 call printArrayEx(
"<br> get: ",
"<br>", b)
850 document.write
"set: "
852 oletest.AttrULong= arrInt
854 call printArrayEx(
"<br> get: ",
"<br>", b)
856 document.write
"set: "
858 oletest.AttrString= arrString
859 b= oletest.AttrString
860 call printArrayEx(
"<br> get: ",
"<br>", b)
862 document.write
"set: "
864 oletest.AttrChar= arrChar
866 call printArrayEx(
"<br> get: ",
"<br>", b)
868 document.write
"set: "
870 oletest.AttrAny= arrAny
872 call printArrayEx(
"<br> get: ",
"<br>", b)
875 document.write
"set: <br>"
876 printArray2 arrDim2Int :
877 oletest.AttrSequence= arrDim2Int
878 ret= oletest.AttrSequence
879 document.write
"get: "
881 document.write
"<br> array: "
889 oletest.testout_methodByte( outValue )
890 alert(
"byte: " & outValue.Get() )
896 document.write
"array: "
898 document.write CStr(val) &
" "
902 // print a
2 dimensional Array
904 sub printArray2( arr)
905 elements1= UBound( arr,
1) - LBound( arr,
1) +
1
906 elements2= UBound( arr,
2) - LBound( arr,
2) +
1
908 For i=
0 To elements1 -
1
909 document.write(
"array " & CStr( i) &
": " )
910 For j=
0 To elements2 -
1
911 document.write CStr( arr(i,j))
913 document.write(
"<br>")
917 sub printArrayEx( pre, post, array)
926 <!-- Insert HTML here -->
928 <h2> JScript with _GetValueObject
</h2>
929 Tests Array/Sequence conversion.
<br>
930 All methods receive a Sequence as Parameter. The element type of the Sequence is written on the buttons.
932 <button onclick='callOleTest(
1)'
>byte
</Button>
933 <button onclick='callOleTest(
2)'
>double
</Button>
934 <button onclick='callOleTest(
3)'
>boolean
</Button>
935 <button onclick='callOleTest(
4)'
>short
</Button>
936 <button onclick='callOleTest(
5)'
>unsigned short
</Button>
937 <button onclick='callOleTest(
6)'
>long
</Button>
938 <button onclick='callOleTest(
7)'
>unsigned long
</Button>
939 <button onclick='callOleTest(
8)'
>char
</Button>
940 <button onclick='callOleTest(
10)'
>any
</Button>
941 <button onclick='callOleTest(
11)'
>sequence<long>
</Button>
942 <button onclick='callOleTest(
12)'
>sequence<sequence<long> >
</Button>
943 <button onclick='callOleTest(
13)'
>XInterface
</Button>
948 <button onclick='callOleTest(
2000)'
>byte
</Button>
949 <button onclick='callOleTest(
2001)'
>double
</Button>
950 <button onclick='callOleTest(
2002)'
>boolean
</Button>
951 <button onclick='callOleTest(
2003)'
>short
</Button>
952 <button onclick='callOleTest(
2004)'
>unsigned short
</Button>
953 <button onclick='callOleTest(
2005)'
>long
</Button>
954 <button onclick='callOleTest(
2006)'
>unsigned long
</Button>
955 <button onclick='callOleTest(
2007)'
>char
</Button>
956 <button onclick='callOleTest(
2008)'
>string
</Button>
957 <button onclick='callOleTest(
2009)'
>any
</Button>
958 <button onclick='callOleTest(
2010)'
>sequence<long>
</Button>
959 <button onclick='callOleTest(
2011)'
>sequence<sequence<long> >
</Button>
960 <button onclick='callOleTest(
2012)'
>2 out
</Button>
961 <button onclick='callOleTest(
2013)'
>3 out
</Button>
962 <button onclick='callOleTest(
2014)'
>1 in &
1 out
</Button>
963 <button onclick='callOleTest(
2015)'
>XInterface
</Button>
966 In Out Parameter
<br>
967 <button onclick='callOleTest(
500)'
>byte
</Button>
968 <button onclick='callOleTest(
501)'
>double
</Button>
969 <button onclick='callOleTest(
502)'
>boolean
</Button>
970 <button onclick='callOleTest(
503)'
>short
</Button>
971 <button onclick='callOleTest(
504)'
>unsigned short
</Button>
972 <button onclick='callOleTest(
505)'
>long
</Button>
973 <button onclick='callOleTest(
506)'
>unsigned long
</Button>
974 <button onclick='callOleTest(
507)'
>char
</Button>
975 <button onclick='callOleTest(
508)'
>string
</Button>
976 <button onclick='callOleTest(
509)'
>any
</Button>
977 <button onclick='callOleTest(
510)'
>sequence<long>
</Button>
978 <button onclick='callOleTest(
511)'
>sequence<sequence<long> >
</Button>
979 <button onclick='callOleTest(
512)'
>XInterface
</Button>
982 Tests Array/Sequence conversion with Attributes. All params are of type Sequence and
983 the element type of the Sequence is written on the buttons.
<br>
984 <button onclick='callOleTest(
200)'
>byte
</Button>
985 <button onclick='callOleTest(
201)'
>double
</Button>
986 <button onclick='callOleTest(
202)'
>boolean
</Button>
987 <button onclick='callOleTest(
203)'
>short
</Button>
988 <button onclick='callOleTest(
204)'
>unsigned short
</Button>
989 <button onclick='callOleTest(
205)'
>long
</Button>
990 <button onclick='callOleTest(
206)'
>unsigned long
</Button>
991 <button onclick='callOleTest(
207)'
>char
</Button>
992 <button onclick='callOleTest(
208)'
>string
</Button>
993 <button onclick='callOleTest(
209)'
>any
</Button>
994 <button onclick='callOleTest(
210)'
>sequence<long>
</Button>
995 <button onclick='callOleTest(
211)'
>sequence<sequence<long> >
</Button>
996 <button onclick='callOleTest(
212)'
>XInterface
</Button>
1000 Test of Any parameter in a method. Any contains:<br>
1001 <button onclick='callOleTest( 1000)'>integer </Button>
1002 <button onclick='callOleTest( 1001)'>double </Button>
1003 <button onclick='callOleTest( 1002)'>string</Button>
1004 <button onclick='callOleTest( 1003)'>array</Button>
1005 <button onclick='callOleTest( 1004)'>object</Button>
1007 Test of Any parameter in a property. Any contains:<br>
1008 <button onclick='callOleTest( 1010)'>integer </Button>
1009 <button onclick='callOleTest( 1011)'>double </Button>
1010 <button onclick='callOleTest( 1012)'>string</Button>
1011 <button onclick='callOleTest( 1013)'>array</Button>
1012 <button onclick='callOleTest( 1014)'>object</Button>
1017 <h2> Visual Basic Tests
</h2>
1018 Test array /Sequence conversion and return value
<br>
1019 Template:
<b> Sequence < type > method( Sequence< type > )
</b>
1023 <button onclick='callBasic(
0)'
>byte
</button>
1025 <button onclick='callBasic(1)'>double</button>
1026 <button onclick='callBasic(2)'>boolean</button>
1027 <button onclick='callBasic(3)'>short</button>
1028 <button onclick='callBasic(4)'>u short</button>
1029 <button onclick='callBasic(5)'>long</button>
1030 <button onclick='callBasic(6)'>u long</button>
1031 <button onclick='callBasic(7)'>string</button>
1032 <button onclick='callBasic(8)'>char</button>
1033 <button onclick='callBasic(9)'>any</button> <br>
1034 <button onclick='callBasic(10)'>Seq < int ></button>
1040 Template:
<b> void method( Sequence < type > )
</b> <br>
1041 <button onclick='callBasic(
300)'
>byte
</button>
1043 <button onclick='callBasic(101)'>double</button>
1044 <button onclick='callBasic(102)'>boolean</button>
1045 <button onclick='callBasic(103)'>short</button>
1046 <button onclick='callBasic(104)'>u short</button>
1047 <button onclick='callBasic(105)'>long</button>
1048 <button onclick='callBasic(106)'>u long</button>
1049 <button onclick='callBasic(107)'>string</button>
1050 <button onclick='callBasic(108)'>char</button>
1051 <button onclick='callBasic(109)'>any</button> <br>
1055 Tests Array/Sequence conversion with <b>Attributes</b>. All params are of type Sequence and
1056 the element type of the Sequence is written on the buttons. <br>
1057 <button onclick='callBasic( 200)'>byte </Button>
1058 <button onclick='callBasic( 201)'>double</Button>
1059 <button onclick='callBasic( 202)'>boolean</Button>
1060 <button onclick='callBasic( 203)'>short</Button>
1061 <button onclick='callBasic( 204)'>unsigned short</Button>
1062 <button onclick='callBasic( 205)'>long</Button>
1063 <button onclick='callBasic( 206)'>unsigned long</Button>
1064 <button onclick='callBasic( 207)'>string</Button>
1065 <button onclick='callBasic( 208)'>char</Button>
1066 <button onclick='callBasic( 209)'>any</Button>
1067 <button onclick='callBasic( 210)'>sequence<long> </Button>