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