1*cdf0e10cSrcweir<HTML> 2*cdf0e10cSrcweir<HEAD> 3*cdf0e10cSrcweir<META NAME="GENERATOR" Content="Microsoft Developer Studio"> 4*cdf0e10cSrcweir<META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1"> 5*cdf0e10cSrcweir<TITLE>Document Title</TITLE> 6*cdf0e10cSrcweir</HEAD> 7*cdf0e10cSrcweir<BODY id=theBody> 8*cdf0e10cSrcweir 9*cdf0e10cSrcweir<script language="JScript"> 10*cdf0e10cSrcweir 11*cdf0e10cSrcweirfunction runJScriptTest( Log) 12*cdf0e10cSrcweir{ 13*cdf0e10cSrcweirdocument.writeln("================================================================================<br>"); 14*cdf0e10cSrcweirdocument.writeln("JScript<br>"); 15*cdf0e10cSrcweirdocument.writeln("================================================================================<p>"); 16*cdf0e10cSrcweir 17*cdf0e10cSrcweir//var name : String = "Fred"; 18*cdf0e10cSrcweir//print(name); 19*cdf0e10cSrcweirvar arr= new Array( 1, 2, 3, 4, 0); 20*cdf0e10cSrcweirvar arrInt= new Array( 1,2,3,4,5); 21*cdf0e10cSrcweirvar arrDouble= new Array( 1.2345, 12.345, 123.45, 1234.5, 12345); 22*cdf0e10cSrcweirvar arrBool= new Array( true, false, true, false, true); 23*cdf0e10cSrcweirvar arrChar= new Array( '1', 'A'," ", 55); 24*cdf0e10cSrcweir 25*cdf0e10cSrcweirvar arrString= new Array("hamburger","cheeseburger", "chicken nuggets", "chicken wings" , "pizza"); 26*cdf0e10cSrcweirvar arrAny= new Array( 100, 100.1235,"hallo"); 27*cdf0e10cSrcweirvar arrSeq= new Array( arr, arr, arr); 28*cdf0e10cSrcweirvar arrSeq2= new Array( ); 29*cdf0e10cSrcweir 30*cdf0e10cSrcweirvar arEventListener= new Array( new XEventListener_Impl(), new XEventListener_Impl(), 31*cdf0e10cSrcweir new XEventListener_Impl()); 32*cdf0e10cSrcweirvar arEventListener2= new Array( new XEventListener_Impl(), new XEventListener_Impl(), 33*cdf0e10cSrcweir new XEventListener_Impl()); 34*cdf0e10cSrcweirvar arArEventListener= new Array( arEventListener, arEventListener2); 35*cdf0e10cSrcweir 36*cdf0e10cSrcweirvar arObj= new Array(); 37*cdf0e10cSrcweirfor( i=0; i< 3; i++) 38*cdf0e10cSrcweir{ 39*cdf0e10cSrcweir arObj[i]= new Object(); 40*cdf0e10cSrcweir} 41*cdf0e10cSrcweirvar outVal= new Array(); 42*cdf0e10cSrcweirvar outVal2= new Array(); 43*cdf0e10cSrcweirvar outVal3= new Array(); 44*cdf0e10cSrcweir 45*cdf0e10cSrcweirfor( i=0; i < 3; i++) 46*cdf0e10cSrcweir{ 47*cdf0e10cSrcweir arrSeq2[i]= new Array(); 48*cdf0e10cSrcweir for( j= 0; j < 3; j++) 49*cdf0e10cSrcweir { 50*cdf0e10cSrcweir arrSeq2[i][j]= new Array(); 51*cdf0e10cSrcweir for( k= 0; k < 5; k++) 52*cdf0e10cSrcweir { 53*cdf0e10cSrcweir arrSeq2[i][j][k]= (i * 3 * 5) + (j * 5) + k; 54*cdf0e10cSrcweir// document.write(arrSeq2[i][j][k] + " "); 55*cdf0e10cSrcweir } 56*cdf0e10cSrcweir// document.write("<br>"); 57*cdf0e10cSrcweir } 58*cdf0e10cSrcweir} 59*cdf0e10cSrcweir 60*cdf0e10cSrcweir 61*cdf0e10cSrcweirret= oletest.methodByte( arr); 62*cdf0e10cSrcweir_ret= new VBArray( ret).toArray(); 63*cdf0e10cSrcweirLog.print( isEqualAr( arr, _ret), "methodByte"); 64*cdf0e10cSrcweir 65*cdf0e10cSrcweirret= oletest.methodFloat( arrDouble); 66*cdf0e10cSrcweir_ret= new VBArray( ret).toArray(); 67*cdf0e10cSrcweirbOk= false; 68*cdf0e10cSrcweirif( (arrDouble.length == _ret.length) 69*cdf0e10cSrcweir && (_ret[0] > 1.2344 && _ret[0] < 1.2346) 70*cdf0e10cSrcweir && (_ret[1] > 12.344 && _ret[1] < 12.346) 71*cdf0e10cSrcweir && (_ret[2] > 123.44 && _ret[2] < 123.46) 72*cdf0e10cSrcweir && (_ret[3] > 1234.4 && _ret[3] < 1234.6) 73*cdf0e10cSrcweir && (_ret[4] > 12344 && _ret[4] < 12346)) 74*cdf0e10cSrcweir bOk= true; 75*cdf0e10cSrcweirLog.print( bOk, "methodFloat"); 76*cdf0e10cSrcweir 77*cdf0e10cSrcweirret= oletest.methodDouble( arrDouble); 78*cdf0e10cSrcweir_ret= new VBArray( ret).toArray(); 79*cdf0e10cSrcweirLog.print( isEqualAr( arrDouble, _ret), "methodDouble"); 80*cdf0e10cSrcweir 81*cdf0e10cSrcweirret= oletest.methodBool( arrBool); 82*cdf0e10cSrcweir_ret= new VBArray( ret).toArray(); 83*cdf0e10cSrcweirLog.print( isEqualAr( arrBool, _ret), "methodBool"); 84*cdf0e10cSrcweir 85*cdf0e10cSrcweirret= oletest.methodShort( arr); 86*cdf0e10cSrcweir_ret= new VBArray( ret).toArray(); 87*cdf0e10cSrcweirLog.print( isEqualAr( arr, _ret), "methodShort"); 88*cdf0e10cSrcweir 89*cdf0e10cSrcweirret= oletest.methodUShort( arr); 90*cdf0e10cSrcweir_ret= new VBArray( ret).toArray(); 91*cdf0e10cSrcweirLog.print( isEqualAr( arr, _ret), "methodUShort"); 92*cdf0e10cSrcweir 93*cdf0e10cSrcweirret= oletest.methodLong( arr); 94*cdf0e10cSrcweir_ret= new VBArray( ret).toArray(); 95*cdf0e10cSrcweirLog.print( isEqualAr( arr, _ret), "methodLong"); 96*cdf0e10cSrcweir 97*cdf0e10cSrcweirret= oletest.methodULong( arr); 98*cdf0e10cSrcweir_ret= new VBArray( ret).toArray(); 99*cdf0e10cSrcweirLog.print( isEqualAr( arr, _ret), "methodULong"); 100*cdf0e10cSrcweir 101*cdf0e10cSrcweirret= oletest.methodChar( arrChar); 102*cdf0e10cSrcweir_ret= new VBArray( ret).toArray(); 103*cdf0e10cSrcweirbOk= false; 104*cdf0e10cSrcweirif( _ret.length == arrChar.length && _ret[0] == 49 && _ret[1] == 65 && _ret[2] == 32 && _ret[3] == 55) 105*cdf0e10cSrcweir bOk= true; 106*cdf0e10cSrcweirLog.print( bOk, "methodChar"); 107*cdf0e10cSrcweir 108*cdf0e10cSrcweirret= oletest.methodString( arrString); 109*cdf0e10cSrcweir_ret= new VBArray( ret).toArray(); 110*cdf0e10cSrcweirLog.print( isEqualAr( arrString, _ret), "methodString"); 111*cdf0e10cSrcweir 112*cdf0e10cSrcweirret= oletest.methodAny( arrAny); 113*cdf0e10cSrcweir_ret= new VBArray( ret).toArray(); 114*cdf0e10cSrcweirLog.print( isEqualAr( arrAny, _ret), "methodAny"); 115*cdf0e10cSrcweir 116*cdf0e10cSrcweirret= oletest.methodSequence( arrSeq); 117*cdf0e10cSrcweir_ret= new VBArray( ret).toArray(); 118*cdf0e10cSrcweirfor( i=0; i < _ret.length; i++) 119*cdf0e10cSrcweir{ 120*cdf0e10cSrcweir sfarray2= new VBArray( _ret[i]); 121*cdf0e10cSrcweir var arr2= sfarray2.toArray(); 122*cdf0e10cSrcweir if( ! isEqualAr(arrSeq[i], arr2)) 123*cdf0e10cSrcweir { 124*cdf0e10cSrcweir bOk= false; 125*cdf0e10cSrcweir break; 126*cdf0e10cSrcweir } 127*cdf0e10cSrcweir} 128*cdf0e10cSrcweirLog.print( bOk, "methodSequence"); 129*cdf0e10cSrcweir 130*cdf0e10cSrcweirret= oletest.methodSequence2( arrSeq2); 131*cdf0e10cSrcweirarr1= new VBArray( ret).toArray(); 132*cdf0e10cSrcweirfor( i=0; i < arr1.length; i++) 133*cdf0e10cSrcweir{ 134*cdf0e10cSrcweir var ar2Dim= arrSeq2[i]; 135*cdf0e10cSrcweir sfarray2= new VBArray( arr1[i]); 136*cdf0e10cSrcweir arr2= sfarray2.toArray(); 137*cdf0e10cSrcweir for ( j=0; j < arr2.length; j++) 138*cdf0e10cSrcweir { 139*cdf0e10cSrcweir var ar1Dim= ar2Dim[j]; 140*cdf0e10cSrcweir sfarray3= new VBArray( arr2[j]); 141*cdf0e10cSrcweir arr3= sfarray3.toArray(); 142*cdf0e10cSrcweir// document.write(arr3[j].toString()); 143*cdf0e10cSrcweir if( ! isEqualAr( arrSeq2[i][j], arr3)) 144*cdf0e10cSrcweir { 145*cdf0e10cSrcweir bOk= false; 146*cdf0e10cSrcweir break; 147*cdf0e10cSrcweir } 148*cdf0e10cSrcweir } 149*cdf0e10cSrcweir} 150*cdf0e10cSrcweirLog.print( bOk, "methodSequence2"); 151*cdf0e10cSrcweir 152*cdf0e10cSrcweirret= oletest.methodXInterface( arObj); 153*cdf0e10cSrcweir_ret= new VBArray( ret).toArray(); 154*cdf0e10cSrcweirbOk= true; 155*cdf0e10cSrcweirfor(i in _ret) 156*cdf0e10cSrcweir{ 157*cdf0e10cSrcweir if( _ret[i] !== arObj[i]) 158*cdf0e10cSrcweir { 159*cdf0e10cSrcweir bOk= false; 160*cdf0e10cSrcweir break; 161*cdf0e10cSrcweir } 162*cdf0e10cSrcweir} 163*cdf0e10cSrcweirLog.print( bOk, "methodXInterface"); 164*cdf0e10cSrcweir 165*cdf0e10cSrcweir 166*cdf0e10cSrcweirret= oletest.methodXEventListeners( arEventListener); 167*cdf0e10cSrcweir_ret= new VBArray(ret).toArray(); 168*cdf0e10cSrcweirbOk= true; 169*cdf0e10cSrcweirfor ( key in _ret) 170*cdf0e10cSrcweir{ 171*cdf0e10cSrcweir if( ! _ret[key].disposingCalled()) 172*cdf0e10cSrcweir { 173*cdf0e10cSrcweir bOk= false; 174*cdf0e10cSrcweir break; 175*cdf0e10cSrcweir } 176*cdf0e10cSrcweir} 177*cdf0e10cSrcweirLog.print( bOk, "methodXEventListeners"); 178*cdf0e10cSrcweir 179*cdf0e10cSrcweirret= oletest.methodXEventListenersMul( arArEventListener); 180*cdf0e10cSrcweir_ret= new VBArray(ret).toArray(); 181*cdf0e10cSrcweirbOk= true; 182*cdf0e10cSrcweirfor( key in _ret) 183*cdf0e10cSrcweir{ 184*cdf0e10cSrcweir _ret2= new VBArray(_ret[key]).toArray(); 185*cdf0e10cSrcweir for( key2 in _ret2) 186*cdf0e10cSrcweir { 187*cdf0e10cSrcweir if( ! _ret2[key2].disposingCalled()) 188*cdf0e10cSrcweir { 189*cdf0e10cSrcweir bOk= false; 190*cdf0e10cSrcweir break; 191*cdf0e10cSrcweir } 192*cdf0e10cSrcweir } 193*cdf0e10cSrcweir} 194*cdf0e10cSrcweirLog.print( bOk, "methodXEventListenersMul"); 195*cdf0e10cSrcweir 196*cdf0e10cSrcweirdocument.writeln("<br>"); 197*cdf0e10cSrcweiroletest.AttrByte = arr; 198*cdf0e10cSrcweirret= oletest.AttrByte; 199*cdf0e10cSrcweir_ret= new VBArray( ret).toArray(); 200*cdf0e10cSrcweirLog.print( isEqualAr( arr, _ret), "AttrByte"); 201*cdf0e10cSrcweir 202*cdf0e10cSrcweiroletest.AttrFloat= arrDouble; 203*cdf0e10cSrcweirret= oletest.AttrFloat; 204*cdf0e10cSrcweir_ret= new VBArray( ret).toArray(); 205*cdf0e10cSrcweirbOk= false; 206*cdf0e10cSrcweirif( (arrDouble.length == _ret.length) 207*cdf0e10cSrcweir && (_ret[0] > 1.2344 && _ret[0] < 1.2346) 208*cdf0e10cSrcweir && (_ret[1] > 12.344 && _ret[1] < 12.346) 209*cdf0e10cSrcweir && (_ret[2] > 123.44 && _ret[2] < 123.46) 210*cdf0e10cSrcweir && (_ret[3] > 1234.4 && _ret[3] < 1234.6) 211*cdf0e10cSrcweir && (_ret[4] > 12344 && _ret[4] < 12346)) 212*cdf0e10cSrcweir bOk= true; 213*cdf0e10cSrcweirLog.print( bOk, "AttrFloat"); 214*cdf0e10cSrcweir 215*cdf0e10cSrcweiroletest.AttrDouble= arrDouble; 216*cdf0e10cSrcweirret= oletest.AttrDouble; 217*cdf0e10cSrcweir_ret= new VBArray( ret).toArray(); 218*cdf0e10cSrcweirLog.print( isEqualAr( arrDouble, _ret), "AttrDouble"); 219*cdf0e10cSrcweir 220*cdf0e10cSrcweiroletest.AttrBool= arrBool; 221*cdf0e10cSrcweirret= oletest.AttrBool; 222*cdf0e10cSrcweir_ret= new VBArray( ret).toArray(); 223*cdf0e10cSrcweirLog.print( isEqualAr( arrBool, _ret), "AttrBool"); 224*cdf0e10cSrcweir 225*cdf0e10cSrcweiroletest.AttrShort= arr; 226*cdf0e10cSrcweirret= oletest.AttrShort; 227*cdf0e10cSrcweir_ret= new VBArray( ret).toArray(); 228*cdf0e10cSrcweirLog.print( isEqualAr( arr, _ret), "AttrShort"); 229*cdf0e10cSrcweir 230*cdf0e10cSrcweiroletest.AttrUShort= arr; 231*cdf0e10cSrcweirret= oletest.AttrUShort; 232*cdf0e10cSrcweir_ret= new VBArray( ret).toArray(); 233*cdf0e10cSrcweirLog.print( isEqualAr( arr, _ret), "AttrUShort"); 234*cdf0e10cSrcweir 235*cdf0e10cSrcweiroletest.AttrLong= arr; 236*cdf0e10cSrcweirret= oletest.AttrLong; 237*cdf0e10cSrcweir_ret= new VBArray( ret).toArray(); 238*cdf0e10cSrcweirLog.print( isEqualAr( arr, _ret), "AttrLong"); 239*cdf0e10cSrcweir 240*cdf0e10cSrcweiroletest.AttrULong= arr; 241*cdf0e10cSrcweirret= oletest.AttrULong; 242*cdf0e10cSrcweir_ret= new VBArray( ret).toArray(); 243*cdf0e10cSrcweirLog.print( isEqualAr( arr, _ret), "AttrULong"); 244*cdf0e10cSrcweir 245*cdf0e10cSrcweiroletest.AttrChar= arrChar; 246*cdf0e10cSrcweirret= oletest.AttrChar; 247*cdf0e10cSrcweir_ret= new VBArray(ret).toArray(); 248*cdf0e10cSrcweirbOk= false; 249*cdf0e10cSrcweirif( _ret.length == arrChar.length && _ret[0] == 49 && _ret[1] == 65 && _ret[2] == 32 && _ret[3] == 55) 250*cdf0e10cSrcweir bOk= true; 251*cdf0e10cSrcweirLog.print( bOk, "AttrChar"); 252*cdf0e10cSrcweir 253*cdf0e10cSrcweiroletest.AttrString= arrString; 254*cdf0e10cSrcweirret= oletest.AttrString; 255*cdf0e10cSrcweir_ret= new VBArray( ret).toArray(); 256*cdf0e10cSrcweirLog.print( isEqualAr( arrString, _ret), "AttrString"); 257*cdf0e10cSrcweir 258*cdf0e10cSrcweiroletest.AttrAny= arrAny; 259*cdf0e10cSrcweirret= oletest.AttrAny; 260*cdf0e10cSrcweir_ret= new VBArray( ret).toArray(); 261*cdf0e10cSrcweirLog.print( isEqualAr( arrAny, _ret), "AttrAny"); 262*cdf0e10cSrcweir 263*cdf0e10cSrcweiroletest.AttrSequence= arrSeq; 264*cdf0e10cSrcweirret= oletest.AttrSequence; 265*cdf0e10cSrcweir_ret= new VBArray( ret).toArray(); 266*cdf0e10cSrcweirfor( i=0; i < _ret.length; i++) 267*cdf0e10cSrcweir{ 268*cdf0e10cSrcweir sfarray2= new VBArray( _ret[i]); 269*cdf0e10cSrcweir var arr2= sfarray2.toArray(); 270*cdf0e10cSrcweir if( ! isEqualAr(arrSeq[i], arr2)) 271*cdf0e10cSrcweir { 272*cdf0e10cSrcweir bOk= false; 273*cdf0e10cSrcweir break; 274*cdf0e10cSrcweir } 275*cdf0e10cSrcweir} 276*cdf0e10cSrcweirLog.print( bOk, "AttrSequence"); 277*cdf0e10cSrcweir 278*cdf0e10cSrcweiroletest.AttrSequence2= arrSeq2; 279*cdf0e10cSrcweirret= oletest.AttrSequence2; 280*cdf0e10cSrcweirarr1= new VBArray( ret).toArray(); 281*cdf0e10cSrcweirfor( i=0; i < arr1.length; i++) 282*cdf0e10cSrcweir{ 283*cdf0e10cSrcweir var ar2Dim= arrSeq2[i]; 284*cdf0e10cSrcweir sfarray2= new VBArray( arr1[i]); 285*cdf0e10cSrcweir arr2= sfarray2.toArray(); 286*cdf0e10cSrcweir for ( j=0; j < arr2.length; j++) 287*cdf0e10cSrcweir { 288*cdf0e10cSrcweir var ar1Dim= ar2Dim[j]; 289*cdf0e10cSrcweir sfarray3= new VBArray( arr2[j]); 290*cdf0e10cSrcweir arr3= sfarray3.toArray(); 291*cdf0e10cSrcweir if( ! isEqualAr( arrSeq2[i][j], arr3)) 292*cdf0e10cSrcweir { 293*cdf0e10cSrcweir bOk= false; 294*cdf0e10cSrcweir break; 295*cdf0e10cSrcweir } 296*cdf0e10cSrcweir } 297*cdf0e10cSrcweir} 298*cdf0e10cSrcweirLog.print( bOk, "AttrSequence2"); 299*cdf0e10cSrcweir 300*cdf0e10cSrcweiroletest.AttrXInterface= arObj; 301*cdf0e10cSrcweirret= oletest.AttrXInterface; 302*cdf0e10cSrcweir_ret= new VBArray( ret).toArray(); 303*cdf0e10cSrcweirbOk= true; 304*cdf0e10cSrcweirfor(i in _ret) 305*cdf0e10cSrcweir{ 306*cdf0e10cSrcweir if( _ret[i] !== arObj[i]) 307*cdf0e10cSrcweir { 308*cdf0e10cSrcweir bOk= false; 309*cdf0e10cSrcweir break; 310*cdf0e10cSrcweir } 311*cdf0e10cSrcweir} 312*cdf0e10cSrcweirLog.print( bOk, "AttrXInterface"); 313*cdf0e10cSrcweir 314*cdf0e10cSrcweirret= oletest.methodXInterface( arObj); 315*cdf0e10cSrcweir_ret= new VBArray( ret); 316*cdf0e10cSrcweir_ret= _ret.toArray(); 317*cdf0e10cSrcweirbOk= true; 318*cdf0e10cSrcweirfor(i in _ret) 319*cdf0e10cSrcweir{ 320*cdf0e10cSrcweir if( _ret[i] !== arObj[i]) 321*cdf0e10cSrcweir { 322*cdf0e10cSrcweir bOk= false; 323*cdf0e10cSrcweir break; 324*cdf0e10cSrcweir } 325*cdf0e10cSrcweir} 326*cdf0e10cSrcweirLog.print( bOk, "methodXInterface"); 327*cdf0e10cSrcweir//====================================================================================== 328*cdf0e10cSrcweirdocument.writeln("<br>"); 329*cdf0e10cSrcweirvar inVal, outVal, retVal; 330*cdf0e10cSrcweiroutVal = new Array(); 331*cdf0e10cSrcweir 332*cdf0e10cSrcweirinVal = 77; 333*cdf0e10cSrcweirretVal = oletest.in_methodByte(inVal) 334*cdf0e10cSrcweiroletest.testout_methodByte( outVal ); 335*cdf0e10cSrcweirLog.print( retVal == inVal, "in_methodByte"); 336*cdf0e10cSrcweirLog.print( outVal[0] == inVal, "testout_methodByte"); 337*cdf0e10cSrcweir 338*cdf0e10cSrcweirinVal = 3.14 339*cdf0e10cSrcweirretVal = oletest.in_methodFloat(inVal); 340*cdf0e10cSrcweiroletest.testout_methodFloat( outVal ); 341*cdf0e10cSrcweirLog.print( retVal > 3.14 && retVal < 3.15, "in_methodFloat"); 342*cdf0e10cSrcweirLog.print( outVal[0] > 3.13 && outVal[0] < 3.15, "testout_methodFloat"); 343*cdf0e10cSrcweir//Log.print( outVal[0] == inVal, "testout_methodFloat"); 344*cdf0e10cSrcweir 345*cdf0e10cSrcweirretVal = oletest.in_methodDouble(inVal) 346*cdf0e10cSrcweiroletest.testout_methodDouble( outVal ); 347*cdf0e10cSrcweirLog.print( retVal == inVal, "in_methodDouble"); 348*cdf0e10cSrcweirLog.print( outVal[0] == 3.14, "testout_methodDouble" ); 349*cdf0e10cSrcweir 350*cdf0e10cSrcweirinVal = true; 351*cdf0e10cSrcweirretVal = oletest.in_methodBool(inVal); 352*cdf0e10cSrcweiroletest.testout_methodBool( outVal ); 353*cdf0e10cSrcweirLog.print(retVal == inVal, "in_methodBool"); 354*cdf0e10cSrcweirLog.print( outVal[0] == true, "testout_methodBool"); 355*cdf0e10cSrcweir 356*cdf0e10cSrcweirinVal = 111 357*cdf0e10cSrcweirretVal = oletest.in_methodShort(inVal); 358*cdf0e10cSrcweiroletest.testout_methodShort( outVal ); 359*cdf0e10cSrcweirLog.print(retVal == inVal, "in_methodShort"); 360*cdf0e10cSrcweirLog.print( outVal[0] == inVal, "testout_methodShort"); 361*cdf0e10cSrcweir 362*cdf0e10cSrcweirretVal = oletest.in_methodUShort(inVal); 363*cdf0e10cSrcweiroletest.testout_methodUShort( outVal ); 364*cdf0e10cSrcweirLog.print(retVal == inVal, "in_methodUShort"); 365*cdf0e10cSrcweirLog.print( outVal[0] == inVal, "testout_methodUShort"); 366*cdf0e10cSrcweir 367*cdf0e10cSrcweirretVal = oletest.in_methodLong(inVal); 368*cdf0e10cSrcweiroletest.testout_methodLong( outVal ); 369*cdf0e10cSrcweirLog.print(retVal == inVal, "in_methodLong"); 370*cdf0e10cSrcweirLog.print( outVal[0] == inVal, "testout_methodLong"); 371*cdf0e10cSrcweir 372*cdf0e10cSrcweirretVal = oletest.in_methodULong(inVal); 373*cdf0e10cSrcweiroletest.testout_methodULong( outVal ); 374*cdf0e10cSrcweirLog.print(retVal == inVal, "in_methodULong"); 375*cdf0e10cSrcweirLog.print( outVal[0] == inVal, "testout_methodULong"); 376*cdf0e10cSrcweir 377*cdf0e10cSrcweirretVal = oletest.in_methodChar(inVal); 378*cdf0e10cSrcweiroletest.testout_methodChar( outVal ); 379*cdf0e10cSrcweirLog.print(retVal == inVal, "in_methodChar"); 380*cdf0e10cSrcweirLog.print( outVal[0] == inVal, "testout_methodChar"); 381*cdf0e10cSrcweir 382*cdf0e10cSrcweirinVal = "Hello World"; 383*cdf0e10cSrcweirretVal = oletest.in_methodString(inVal); 384*cdf0e10cSrcweiroletest.testout_methodString( outVal ); 385*cdf0e10cSrcweirLog.print(retVal == inVal, "in_methodString"); 386*cdf0e10cSrcweirLog.print( outVal[0] == inVal, "testout_methodString"); 387*cdf0e10cSrcweir 388*cdf0e10cSrcweirretVal = oletest.in_methodAny(inVal); 389*cdf0e10cSrcweiroletest.testout_methodAny( outVal ); 390*cdf0e10cSrcweirLog.print(retVal == inVal, "in_methodAny"); 391*cdf0e10cSrcweirLog.print( outVal[0] == inVal, "testout_methodAny"); 392*cdf0e10cSrcweir 393*cdf0e10cSrcweirinVal = new Object(); 394*cdf0e10cSrcweirretVal = oletest.in_methodXInterface(inVal); 395*cdf0e10cSrcweiroletest.testout_methodXInterface(outVal); 396*cdf0e10cSrcweirLog.print(retVal === inVal, "in_methodXInterface"); 397*cdf0e10cSrcweirLog.print(outVal[0] === inVal, "testout_methodXInterface"); 398*cdf0e10cSrcweir 399*cdf0e10cSrcweirinVal = oletest; 400*cdf0e10cSrcweirretVal = oletest.in_methodXInterface(inVal); 401*cdf0e10cSrcweiroletest.testout_methodXInterface(outVal); 402*cdf0e10cSrcweirLog.print(retVal === inVal, "in_methodXInterface"); 403*cdf0e10cSrcweirLog.print(outVal[0] === inVal, "testout_methodXInterface"); 404*cdf0e10cSrcweir 405*cdf0e10cSrcweir 406*cdf0e10cSrcweiroletest.testout_methodSequence( outVal ); 407*cdf0e10cSrcweirvar arr= new VBArray( outVal[0]).toArray(); 408*cdf0e10cSrcweirLog.print( isEqualAr(arr, new Array( 0,1,2,3,4,5,6,7,8,9)), "testout_methodSequence"); 409*cdf0e10cSrcweir 410*cdf0e10cSrcweiroletest.testout_methodSequence2( outVal ); 411*cdf0e10cSrcweirvar arr= new VBArray( outVal[0]).toArray(); 412*cdf0e10cSrcweirbOk= true; 413*cdf0e10cSrcweirif( arr.length= 10) 414*cdf0e10cSrcweir{ 415*cdf0e10cSrcweir for( i=0; i < arr.length; i++) 416*cdf0e10cSrcweir { 417*cdf0e10cSrcweir var arr2= new VBArray( arr[i]).toArray(); 418*cdf0e10cSrcweir if( ! isEqualAr( arr2, new Array( 0,1,2,3,4,5,6,7,8,9))) 419*cdf0e10cSrcweir { 420*cdf0e10cSrcweir bOk= false; 421*cdf0e10cSrcweir break; 422*cdf0e10cSrcweir } 423*cdf0e10cSrcweir } 424*cdf0e10cSrcweir} 425*cdf0e10cSrcweirLog.print( bOk, "testout_methodSequence2"); 426*cdf0e10cSrcweir 427*cdf0e10cSrcweiroletest.testout_methodMulParams1( outVal, outVal2 ); 428*cdf0e10cSrcweirLog.print( outVal[0] == 999 && outVal2[0] == 1111, "testout_methodMulParams1"); 429*cdf0e10cSrcweir 430*cdf0e10cSrcweiroletest.testout_methodMulParams2( outVal, outVal2, outVal3 ); 431*cdf0e10cSrcweirLog.print( outVal[0] == 1111 && outVal2[0] == 1222 && outVal3[0] == " another string", 432*cdf0e10cSrcweir "testout_methodMulParams2"); 433*cdf0e10cSrcweir 434*cdf0e10cSrcweiroletest.testout_methodMulParams3( "hallo", outVal ); 435*cdf0e10cSrcweirLog.print( outVal[0] == "Out Hallo!", "testout_methodMulParams3"); 436*cdf0e10cSrcweir 437*cdf0e10cSrcweirvar in1= 3.14; 438*cdf0e10cSrcweirvar in2= 1111; 439*cdf0e10cSrcweirvar in3= -2222; 440*cdf0e10cSrcweiroletest.testout_methodMulParams4( in1, outVal, in2, outVal2, in3 ); 441*cdf0e10cSrcweirLog.print( (outVal[0] > 4.13 && outVal[0] < 4.15) && (outVal2[0] == 1112), "testout_methodMulParams4"); 442*cdf0e10cSrcweir 443*cdf0e10cSrcweirdocument.writeln("<p>"); 444*cdf0e10cSrcweir 445*cdf0e10cSrcweirinVal = 100; 446*cdf0e10cSrcweiroutVal[0]= inVal; 447*cdf0e10cSrcweiroletest.testinout_methodByte( outVal ); 448*cdf0e10cSrcweiroletest.testinout_methodByte( outVal ); 449*cdf0e10cSrcweirLog.print( outVal[0] == inVal, "testinout_methodByte"); 450*cdf0e10cSrcweir 451*cdf0e10cSrcweirinVal = 3.14; 452*cdf0e10cSrcweiroutVal[0]= inVal; 453*cdf0e10cSrcweiroletest.testinout_methodFloat( outVal ); 454*cdf0e10cSrcweiroletest.testinout_methodFloat( outVal ); 455*cdf0e10cSrcweirLog.print( outVal[0] > 3.13 && outVal[0] < 3.15, "testinout_methodFloat"); 456*cdf0e10cSrcweir 457*cdf0e10cSrcweirinVal = 3.14 458*cdf0e10cSrcweiroutVal[0]= inVal; 459*cdf0e10cSrcweiroletest.testinout_methodDouble( outVal ); 460*cdf0e10cSrcweiroletest.testinout_methodDouble( outVal ); 461*cdf0e10cSrcweirLog.print( outVal[0] == inVal, "testinout_methodDouble"); 462*cdf0e10cSrcweir 463*cdf0e10cSrcweirinVal = true; 464*cdf0e10cSrcweiroutVal[0]= inVal; 465*cdf0e10cSrcweiroletest.testinout_methodBool( outVal ); 466*cdf0e10cSrcweiroletest.testinout_methodBool( outVal ); 467*cdf0e10cSrcweirLog.print( outVal[0] == inVal, "testinout_methodBool"); 468*cdf0e10cSrcweir 469*cdf0e10cSrcweirinVal = 200; 470*cdf0e10cSrcweiroutVal[0]= inVal; 471*cdf0e10cSrcweiroletest.testinout_methodShort( outVal ); 472*cdf0e10cSrcweiroletest.testinout_methodShort( outVal ); 473*cdf0e10cSrcweirLog.print( outVal[0] == inVal, "testinout_methodShort"); 474*cdf0e10cSrcweir 475*cdf0e10cSrcweirinVal = 300; 476*cdf0e10cSrcweiroutVal[0]= inVal; 477*cdf0e10cSrcweiroletest.testinout_methodUShort( outVal ); 478*cdf0e10cSrcweiroletest.testinout_methodUShort( outVal ); 479*cdf0e10cSrcweirLog.print( outVal[0] == inVal, "testinout_methodUShort"); 480*cdf0e10cSrcweir 481*cdf0e10cSrcweirinVal = 400 482*cdf0e10cSrcweiroutVal[0]= inVal; 483*cdf0e10cSrcweiroletest.testinout_methodLong( outVal ); 484*cdf0e10cSrcweiroletest.testinout_methodLong( outVal ); 485*cdf0e10cSrcweirLog.print( outVal[0] == inVal, "testinout_methodLong"); 486*cdf0e10cSrcweir 487*cdf0e10cSrcweirinVal = 500; 488*cdf0e10cSrcweiroutVal[0]= inVal; 489*cdf0e10cSrcweiroletest.testinout_methodULong( outVal ); 490*cdf0e10cSrcweiroletest.testinout_methodULong( outVal ); 491*cdf0e10cSrcweirLog.print( outVal[0] == inVal, "testinout_methodULong"); 492*cdf0e10cSrcweir 493*cdf0e10cSrcweirinVal = "B"; 494*cdf0e10cSrcweiroutVal[0]= inVal; 495*cdf0e10cSrcweiroletest.testinout_methodChar( outVal ); 496*cdf0e10cSrcweiroletest.testinout_methodChar( outVal ); 497*cdf0e10cSrcweir 498*cdf0e10cSrcweirLog.print( outVal[0] == 66, "testinout_methodChar"); 499*cdf0e10cSrcweir 500*cdf0e10cSrcweirinVal = "Hello World 2!"; 501*cdf0e10cSrcweiroutVal[0]= inVal; 502*cdf0e10cSrcweiroletest.testinout_methodString( outVal ); 503*cdf0e10cSrcweiroletest.testinout_methodString( outVal ); 504*cdf0e10cSrcweirLog.print( outVal[0] == inVal, "testinout_methodString"); 505*cdf0e10cSrcweir 506*cdf0e10cSrcweirinVal = new Object(); 507*cdf0e10cSrcweiroutVal[0]= inVal; 508*cdf0e10cSrcweiroletest.testinout_methodAny( outVal ); 509*cdf0e10cSrcweiroletest.testinout_methodAny( outVal ); 510*cdf0e10cSrcweirLog.print( outVal[0] === inVal, "testinout_methodAny"); 511*cdf0e10cSrcweir 512*cdf0e10cSrcweirinVal = arrInt; 513*cdf0e10cSrcweiroutVal[0] = inVal; 514*cdf0e10cSrcweiroletest.testinout_methodSequence( outVal ); 515*cdf0e10cSrcweiroletest.testinout_methodSequence( outVal ); 516*cdf0e10cSrcweirretVal = new VBArray(outVal[0]).toArray(); 517*cdf0e10cSrcweir 518*cdf0e10cSrcweirLog.print( isEqualAr(retVal, new Array(3,4,5,6,7)), "testinout_methodSequence"); 519*cdf0e10cSrcweir 520*cdf0e10cSrcweir 521*cdf0e10cSrcweiroutVal[0]= arrSeq; 522*cdf0e10cSrcweiroletest.testinout_methodSequence2( outVal ); 523*cdf0e10cSrcweirvar arr= new VBArray( outVal[0]).toArray(); 524*cdf0e10cSrcweirvar i; 525*cdf0e10cSrcweirbOk= true; 526*cdf0e10cSrcweirif( arr.length == 3) 527*cdf0e10cSrcweir{ 528*cdf0e10cSrcweir var tmpArr= new Array(2,4,6,8,0); 529*cdf0e10cSrcweir for( i=0; i < arr.length; i++) 530*cdf0e10cSrcweir { 531*cdf0e10cSrcweir var arr2= new VBArray( arr[i]).toArray(); 532*cdf0e10cSrcweir if( ! isEqualAr( arr2, tmpArr)) 533*cdf0e10cSrcweir { 534*cdf0e10cSrcweir bOk= false; 535*cdf0e10cSrcweir break; 536*cdf0e10cSrcweir } 537*cdf0e10cSrcweir } 538*cdf0e10cSrcweir} 539*cdf0e10cSrcweirLog.print( bOk, "testinout_methodSequence2"); 540*cdf0e10cSrcweir 541*cdf0e10cSrcweir 542*cdf0e10cSrcweirvar ob= new Object(); 543*cdf0e10cSrcweirvar sInVal= "this is a string" 544*cdf0e10cSrcweirob.value= sInVal; 545*cdf0e10cSrcweiroutVal[0]= ob; 546*cdf0e10cSrcweiroletest.testinout_methodXInterface( outVal); 547*cdf0e10cSrcweirLog.print( outVal[0].value == "out", "testinout_methodXInterface"); 548*cdf0e10cSrcweirdocument.writeln("<p>"); 549*cdf0e10cSrcweir 550*cdf0e10cSrcweiri= 100; 551*cdf0e10cSrcweirret= oletest.methodAnyTest1( i); 552*cdf0e10cSrcweirLog.print( i == ret, "methodAnyTest1"); 553*cdf0e10cSrcweir 554*cdf0e10cSrcweiri= 3.14; 555*cdf0e10cSrcweirret= oletest.methodAnyTest1( i); 556*cdf0e10cSrcweirLog.print( i == ret, "methodAnyTest1"); 557*cdf0e10cSrcweir 558*cdf0e10cSrcweiri= "Hallo" 559*cdf0e10cSrcweirret= oletest.methodAnyTest1( i); 560*cdf0e10cSrcweirLog.print( i == ret, "methodAnyTest1"); 561*cdf0e10cSrcweir 562*cdf0e10cSrcweiri= arrInt; 563*cdf0e10cSrcweirret= oletest.methodAnyTest1( i); 564*cdf0e10cSrcweirvar arr= new VBArray( ret).toArray(); 565*cdf0e10cSrcweirLog.print( isEqualAr(arr, arrInt), "methodAnyTest1"); 566*cdf0e10cSrcweir 567*cdf0e10cSrcweirvar obj= new Object(); 568*cdf0e10cSrcweirret= oletest.methodAnyTest1( obj); 569*cdf0e10cSrcweirLog.print( obj == ret, "methodAnyTest1"); 570*cdf0e10cSrcweir 571*cdf0e10cSrcweir 572*cdf0e10cSrcweirdocument.writeln("<p>"); 573*cdf0e10cSrcweir 574*cdf0e10cSrcweiri= 100; 575*cdf0e10cSrcweiroletest.AttrAny2= i; 576*cdf0e10cSrcweirret= oletest.AttrAny2; 577*cdf0e10cSrcweirLog.print( i == ret, "AttrAny2"); 578*cdf0e10cSrcweir 579*cdf0e10cSrcweiri= 3.14; 580*cdf0e10cSrcweiroletest.AttrAny2= i; 581*cdf0e10cSrcweirret= oletest.AttrAny2; 582*cdf0e10cSrcweirLog.print( i == ret, "AttrAny2"); 583*cdf0e10cSrcweir 584*cdf0e10cSrcweiri= "Hallo" 585*cdf0e10cSrcweiroletest.AttrAny2= i; 586*cdf0e10cSrcweirret= oletest.AttrAny2; 587*cdf0e10cSrcweirLog.print( i == ret, "AttrAny2"); 588*cdf0e10cSrcweir 589*cdf0e10cSrcweiri= arrInt; 590*cdf0e10cSrcweiroletest.AttrAny2= i; 591*cdf0e10cSrcweirret= oletest.AttrAny2; 592*cdf0e10cSrcweirvar arr= new VBArray( ret).toArray(); 593*cdf0e10cSrcweirLog.print( isEqualAr(arr, arrInt), "AttrAny2"); 594*cdf0e10cSrcweir 595*cdf0e10cSrcweirvar obj= new Object(); 596*cdf0e10cSrcweiroletest.AttrAny2= obj; 597*cdf0e10cSrcweirret= oletest.AttrAny2; 598*cdf0e10cSrcweirLog.print( obj == ret, "AttrAny2"); 599*cdf0e10cSrcweir 600*cdf0e10cSrcweir 601*cdf0e10cSrcweirdocument.writeln("<p>"); 602*cdf0e10cSrcweir// Structs ---------------------------------------------- 603*cdf0e10cSrcweir 604*cdf0e10cSrcweir/* var struct= oletest._GetStruct("com.sun.star.beans.Property"); */ 605*cdf0e10cSrcweir/* struct.Attributes= 1; */ 606*cdf0e10cSrcweir/* struct.Handle= 2; */ 607*cdf0e10cSrcweir/* struct.Name= "some Property" */ 608*cdf0e10cSrcweir/* oletest.methodStruct( struct); */ 609*cdf0e10cSrcweir 610*cdf0e10cSrcweirvar ret= oletest.retMethodStruct(); 611*cdf0e10cSrcweirLog.print( ret.Attributes == 127 && ret.Handle == 255 && ret.Name == "OleTest_Property", "retMethodStruct"); 612*cdf0e10cSrcweir 613*cdf0e10cSrcweirvar astruct= oletest._GetStruct("com.sun.star.beans.Property"); 614*cdf0e10cSrcweirastruct.Attributes= 1; 615*cdf0e10cSrcweirastruct.Handle= 2; 616*cdf0e10cSrcweirastruct.Name= "some Property" 617*cdf0e10cSrcweiroletest.AttrStruct= astruct; 618*cdf0e10cSrcweir 619*cdf0e10cSrcweirvar ret= oletest.AttrStruct; 620*cdf0e10cSrcweirLog.print( ret.Attributes == 127 && ret.Handle == 255 && ret.Name == "OleTest_Property", "AttrStruct"); 621*cdf0e10cSrcweir 622*cdf0e10cSrcweir// The function returns the struct. Since structs are passed by value the returned struct 623*cdf0e10cSrcweir// will be wrapped in another IDispatch object 624*cdf0e10cSrcweirastruct.Attributes= 1; 625*cdf0e10cSrcweirastruct.Handle= 2; 626*cdf0e10cSrcweirastruct.Name= "Property"; 627*cdf0e10cSrcweirret= oletest.methodStruct2( astruct); 628*cdf0e10cSrcweirLog.print( ret.Attributes == 1 && ret.Handle == 2 && ret.Name == "Property", "methodStruct2"); 629*cdf0e10cSrcweir 630*cdf0e10cSrcweir 631*cdf0e10cSrcweirdocument.writeln("<p>"); 632*cdf0e10cSrcweir// Test Identity from COM objects in UNO 633*cdf0e10cSrcweirvar listener1= new XEventListener_Impl(); 634*cdf0e10cSrcweiroletest.setObject(listener1); 635*cdf0e10cSrcweirret= oletest.isSame(listener1); 636*cdf0e10cSrcweirLog.print2( ret, "Ok Testing identity of COM objects<br>","Failed Testing identity of COM objects<br>"); 637*cdf0e10cSrcweir 638*cdf0e10cSrcweirvar oletest2= oletest.getThis(); 639*cdf0e10cSrcweirret= oletest === oletest2; 640*cdf0e10cSrcweirLog.print2(ret, "Ok Testing identity of UNO objects<br>","Failed Testing identity of UNO objects<br>"); 641*cdf0e10cSrcweir} 642*cdf0e10cSrcweir 643*cdf0e10cSrcweir 644*cdf0e10cSrcweir 645*cdf0e10cSrcweir 646*cdf0e10cSrcweirfunction isEqualAr( ar1, ar2) 647*cdf0e10cSrcweir{ 648*cdf0e10cSrcweir var bOk= false; 649*cdf0e10cSrcweir if( ar1.length == ar2.length) 650*cdf0e10cSrcweir { 651*cdf0e10cSrcweir bOk= true; 652*cdf0e10cSrcweir for( x in ar1) 653*cdf0e10cSrcweir { 654*cdf0e10cSrcweir// document.writeln( ar1[x] + " "); 655*cdf0e10cSrcweir// document.writeln( ar2[x] + " "); 656*cdf0e10cSrcweir if( ar1[x] != ar2[x]) 657*cdf0e10cSrcweir { 658*cdf0e10cSrcweir bOk= false; 659*cdf0e10cSrcweir break; 660*cdf0e10cSrcweir } 661*cdf0e10cSrcweir } 662*cdf0e10cSrcweir } 663*cdf0e10cSrcweir return bOk; 664*cdf0e10cSrcweir} 665*cdf0e10cSrcweir 666*cdf0e10cSrcweir/* function isEqualAr2( ar1, ar2) */ 667*cdf0e10cSrcweir/* { */ 668*cdf0e10cSrcweir 669*cdf0e10cSrcweir/* var bOk= false; */ 670*cdf0e10cSrcweir/* if( ar1.length == ar2.length) */ 671*cdf0e10cSrcweir/* { */ 672*cdf0e10cSrcweir/* bOk= true; */ 673*cdf0e10cSrcweir/* for( x in ar1) */ 674*cdf0e10cSrcweir/* { */ 675*cdf0e10cSrcweir/* document.write( ar1[x]); */ 676*cdf0e10cSrcweir/* document.write( ar2[x]); */ 677*cdf0e10cSrcweir/* if( ! isEqualAr( ar1[x], ar2[x])) */ 678*cdf0e10cSrcweir/* { */ 679*cdf0e10cSrcweir/* bOk= false; */ 680*cdf0e10cSrcweir/* break; */ 681*cdf0e10cSrcweir/* } */ 682*cdf0e10cSrcweir/* } */ 683*cdf0e10cSrcweir/* } */ 684*cdf0e10cSrcweir/* return bOk; */ 685*cdf0e10cSrcweir 686*cdf0e10cSrcweir/* } */ 687*cdf0e10cSrcweir 688*cdf0e10cSrcweirfunction XEventListener_Impl() 689*cdf0e10cSrcweir{ 690*cdf0e10cSrcweir this._environment= "JScript"; 691*cdf0e10cSrcweir this._implementedInterfaces= new Array( "com.sun.star.lang.XEventListener"); 692*cdf0e10cSrcweir 693*cdf0e10cSrcweir //XEventListener 694*cdf0e10cSrcweir this.disposing= XEventListener_disposing; 695*cdf0e10cSrcweir 696*cdf0e10cSrcweir this.bdisposingCalled= false; 697*cdf0e10cSrcweir this.bQuiet= true; 698*cdf0e10cSrcweir this.resetDisposing= XEventListener_resetDisposing; 699*cdf0e10cSrcweir this.disposingCalled= XEventListener_disposingCalled; 700*cdf0e10cSrcweir} 701*cdf0e10cSrcweir 702*cdf0e10cSrcweirfunction XEventListener_disposing( source) 703*cdf0e10cSrcweir{ 704*cdf0e10cSrcweir if( !this.bQuiet) 705*cdf0e10cSrcweir alert("JScript Event Listener \n disposing is being called"); 706*cdf0e10cSrcweir this.bdisposingCalled= true; 707*cdf0e10cSrcweir} 708*cdf0e10cSrcweir 709*cdf0e10cSrcweirfunction XEventListener_resetDisposing() 710*cdf0e10cSrcweir{ 711*cdf0e10cSrcweir this.bdisposingCalled= false; 712*cdf0e10cSrcweir} 713*cdf0e10cSrcweir 714*cdf0e10cSrcweirfunction XEventListener_disposingCalled() 715*cdf0e10cSrcweir{ 716*cdf0e10cSrcweir return this.bdisposingCalled; 717*cdf0e10cSrcweir} 718*cdf0e10cSrcweir</script> 719*cdf0e10cSrcweir 720*cdf0e10cSrcweir<script language="VBScript"> 721*cdf0e10cSrcweirFunction runVBTest( Log) 722*cdf0e10cSrcweirdocument.writeln("================================================================================<br>") 723*cdf0e10cSrcweirdocument.writeln("VB Script<br>") 724*cdf0e10cSrcweirdocument.writeln("================================================================================<p>") 725*cdf0e10cSrcweir 726*cdf0e10cSrcweirDim arrInt 727*cdf0e10cSrcweirarrInt= Array(1,2,3,-4,-5, 0) 728*cdf0e10cSrcweirarrUInt= Array(1,2,3,4,5) 729*cdf0e10cSrcweirarrDouble= Array( 1.2345, 12.345, 123.45, 1234.5, 12345) 730*cdf0e10cSrcweirarrBool= Array( true, false, true, false, true) 731*cdf0e10cSrcweirarrChar= Array("A","B",67) 732*cdf0e10cSrcweirarrString= Array("hamburger","cheeseburger", "chicken nuggets", "chicken wings" , "pizza") 733*cdf0e10cSrcweirarrAny= Array( 100, 100.1235,"hallo") 734*cdf0e10cSrcweir 735*cdf0e10cSrcweir 736*cdf0e10cSrcweirDim arrDim2Int(2,1) 737*cdf0e10cSrcweirDim i,j,k 738*cdf0e10cSrcweirFor i= 0 To 1 739*cdf0e10cSrcweir For j= 0 To 2 740*cdf0e10cSrcweir arrDim2Int(j,i) = i*3 + j 741*cdf0e10cSrcweir Next 742*cdf0e10cSrcweirNext 743*cdf0e10cSrcweir 744*cdf0e10cSrcweir 745*cdf0e10cSrcweirDim arrDim3Int(3,2,1) 746*cdf0e10cSrcweirFor i= 0 To 1 747*cdf0e10cSrcweir For j= 0 To 2 748*cdf0e10cSrcweir For k= 0 To 3 749*cdf0e10cSrcweir arrDim3Int(k,j,i)= i* 3 + j* 4 + k 750*cdf0e10cSrcweir Next 751*cdf0e10cSrcweir Next 752*cdf0e10cSrcweirNext 753*cdf0e10cSrcweir 754*cdf0e10cSrcweirDim arrXEvent(2) 755*cdf0e10cSrcweirFor i= 0 To 2 756*cdf0e10cSrcweir Set arrXEvent(i)= new VBEventListener 757*cdf0e10cSrcweirNext 758*cdf0e10cSrcweir 759*cdf0e10cSrcweirDim arrXEvent2(2,1) 760*cdf0e10cSrcweirFor i= 0 To 1 761*cdf0e10cSrcweir For j= 0 To 2 762*cdf0e10cSrcweir Set arrXEvent2(j,i)= new VBEventListener 763*cdf0e10cSrcweir Next 764*cdf0e10cSrcweirNext 765*cdf0e10cSrcweir 766*cdf0e10cSrcweir 767*cdf0e10cSrcweir 768*cdf0e10cSrcweirret= oletest.methodByte( arrUInt) 769*cdf0e10cSrcweirLog.print isEqualVBAr( ret, arrUInt), "methodByte" 770*cdf0e10cSrcweir 771*cdf0e10cSrcweirret= oletest.methodFloat( arrDouble) 772*cdf0e10cSrcweirLog.print isEqualVBAr( ret, arrDouble), "methodFloat" 773*cdf0e10cSrcweir 774*cdf0e10cSrcweirret= oletest.methodDouble( arrDouble) 775*cdf0e10cSrcweirLog.print isEqualVBAr( ret, arrDouble), "methodDouble" 776*cdf0e10cSrcweir 777*cdf0e10cSrcweirret= oletest.methodBool( arrBool) 778*cdf0e10cSrcweirLog.print isEqualVBAr( ret, arrBool), "methodBool" 779*cdf0e10cSrcweir 780*cdf0e10cSrcweirret= oletest.methodShort( arrInt) 781*cdf0e10cSrcweirLog.print isEqualVBAr( ret, arrInt), "methodShort" 782*cdf0e10cSrcweir 783*cdf0e10cSrcweirret= oletest.methodUShort( arrUInt) 784*cdf0e10cSrcweirLog.print isEqualVBAr( ret, arrUInt), "methodUShort" 785*cdf0e10cSrcweir 786*cdf0e10cSrcweirret= oletest.methodLong( arrInt) 787*cdf0e10cSrcweirLog.print isEqualVBAr( ret, arrInt), "methodLong" 788*cdf0e10cSrcweir 789*cdf0e10cSrcweirret= oletest.methodULong( arrUInt) 790*cdf0e10cSrcweirLog.print isEqualVBAr( ret, arrUInt), "methodULong" 791*cdf0e10cSrcweir 792*cdf0e10cSrcweirret= oletest.methodChar( arrChar) 793*cdf0e10cSrcweirbOk= false 794*cdf0e10cSrcweirif ret(0) = 65 AND ret(1) = 66 AND ret(2) = 67 then 795*cdf0e10cSrcweir bOk= true 796*cdf0e10cSrcweirend if 797*cdf0e10cSrcweirLog.print bOk, "methodChar" 798*cdf0e10cSrcweir 799*cdf0e10cSrcweirret= oletest.methodString( arrString) 800*cdf0e10cSrcweirLog.print isEqualVBAr( ret, arrString), "methodString" 801*cdf0e10cSrcweir 802*cdf0e10cSrcweirret= oletest.methodAny( arrAny) 803*cdf0e10cSrcweirLog.print isEqualVBAr( ret, arrAny), "methodAny" 804*cdf0e10cSrcweir 805*cdf0e10cSrcweir 806*cdf0e10cSrcweirret= oletest.methodSequence( arrDim2Int) 807*cdf0e10cSrcweirbOk= true 808*cdf0e10cSrcweir 809*cdf0e10cSrcweirFor i= 0 To 1 810*cdf0e10cSrcweir Dim arr1 811*cdf0e10cSrcweir arr1= ret(i) 812*cdf0e10cSrcweir For j= 0 To 2 813*cdf0e10cSrcweir if arr1(j) <> arrDim2Int(j,i) then 814*cdf0e10cSrcweir bOk= false 815*cdf0e10cSrcweir exit for 816*cdf0e10cSrcweir end if 817*cdf0e10cSrcweir Next 818*cdf0e10cSrcweirNext 819*cdf0e10cSrcweirLog.print bOk, "methodSequence" 820*cdf0e10cSrcweir 821*cdf0e10cSrcweirret= oletest.methodSequence2( arrDim3Int) 822*cdf0e10cSrcweir'arrDim3Int(3,2,1) 823*cdf0e10cSrcweirbOk= true 824*cdf0e10cSrcweirFor i= 0 To 1 825*cdf0e10cSrcweir arr1= ret(i) 826*cdf0e10cSrcweir For j= 0 To 2 827*cdf0e10cSrcweir arr2= arr1(j) 828*cdf0e10cSrcweir For k= 0 To 3 829*cdf0e10cSrcweir If arr2(k) <> arrDim3Int(k,j,i) then 830*cdf0e10cSrcweir bOk= false 831*cdf0e10cSrcweir exit for 832*cdf0e10cSrcweir End If 833*cdf0e10cSrcweir Next 834*cdf0e10cSrcweir Next 835*cdf0e10cSrcweirNext 836*cdf0e10cSrcweirLog.print bOk, "methodSequence2" 837*cdf0e10cSrcweir 838*cdf0e10cSrcweirret= oletest.methodXInterface(arrXEvent) 839*cdf0e10cSrcweirbOk= true 840*cdf0e10cSrcweirnumArg= UBound( arrXEvent) - LBound( arrXEvent) + 1 841*cdf0e10cSrcweirnumRet= UBound( ret) - LBound( ret) + 1 842*cdf0e10cSrcweirIf numArg = numRet then 843*cdf0e10cSrcweir For i= 0 To numArg - 1 844*cdf0e10cSrcweir If NOT (arrXEvent(i) Is ret(i)) then 845*cdf0e10cSrcweir bOk= false 846*cdf0e10cSrcweir Exit For 847*cdf0e10cSrcweir End if 848*cdf0e10cSrcweir Next 849*cdf0e10cSrcweirEnd If 850*cdf0e10cSrcweirLog.print bOk, "methodXInterface" 851*cdf0e10cSrcweir 852*cdf0e10cSrcweirret= oletest.methodXEventListeners( arrXEvent) 853*cdf0e10cSrcweirbOk= true 854*cdf0e10cSrcweirFor i= 0 To 2 855*cdf0e10cSrcweir If arrXEvent(i).disposingCalled = false then 856*cdf0e10cSrcweir bOk= false 857*cdf0e10cSrcweir Exit For 858*cdf0e10cSrcweir End If 859*cdf0e10cSrcweirNext 860*cdf0e10cSrcweirLog.print bOk, "methodXEventListeners" 861*cdf0e10cSrcweir 862*cdf0e10cSrcweirret= oletest.methodXEventListenersMul(arrXEvent2) 863*cdf0e10cSrcweirbOk= true 864*cdf0e10cSrcweirFor i= 0 To 1 865*cdf0e10cSrcweir For j= 0 To 2 866*cdf0e10cSrcweir If arrXEvent2(j,i).disposingCalled = false then 867*cdf0e10cSrcweir bOk= false 868*cdf0e10cSrcweir Exit For 869*cdf0e10cSrcweir End If 870*cdf0e10cSrcweir Next 871*cdf0e10cSrcweirNext 872*cdf0e10cSrcweirLog.print bOk, "methodXEventListenersMul" 873*cdf0e10cSrcweir 874*cdf0e10cSrcweir' Attributes ------------------------------------------------------ 875*cdf0e10cSrcweirdocument.writeln( "<br>" ) 876*cdf0e10cSrcweiroletest.AttrByte= arrUInt 877*cdf0e10cSrcweirret= oletest.AttrByte 878*cdf0e10cSrcweirLog.print isEqualVBAr( arrUInt, ret), "AttrByte" 879*cdf0e10cSrcweir 880*cdf0e10cSrcweiroletest.AttrFloat= arrDouble 881*cdf0e10cSrcweirret= oletest.AttrFloat 882*cdf0e10cSrcweirLog.print isEqualVBAr( arrDouble, ret), "AttrFloat" 883*cdf0e10cSrcweir 884*cdf0e10cSrcweiroletest.AttrDouble= arrDouble 885*cdf0e10cSrcweirret= oletest.AttrDouble 886*cdf0e10cSrcweirLog.print isEqualVBAr( arrDouble, ret), "AttrDouble" 887*cdf0e10cSrcweir 888*cdf0e10cSrcweiroletest.AttrBool= arrBool 889*cdf0e10cSrcweirret= oletest.AttrBool 890*cdf0e10cSrcweirLog.print isEqualVBAr( arrBool, ret), "AttrBool" 891*cdf0e10cSrcweir 892*cdf0e10cSrcweiroletest.AttrShort= arrInt 893*cdf0e10cSrcweirret= oletest.AttrShort 894*cdf0e10cSrcweirLog.print isEqualVBAr( arrInt, ret), "AttrShort" 895*cdf0e10cSrcweir 896*cdf0e10cSrcweiroletest.AttrUShort= arrUInt 897*cdf0e10cSrcweirret= oletest.AttrUShort 898*cdf0e10cSrcweirLog.print isEqualVBAr( arrUInt, ret), "AttrUShort" 899*cdf0e10cSrcweir 900*cdf0e10cSrcweiroletest.AttrLong= arrInt 901*cdf0e10cSrcweirret= oletest.AttrLong 902*cdf0e10cSrcweirLog.print isEqualVBAr( arrInt, ret), "AttrLong" 903*cdf0e10cSrcweir 904*cdf0e10cSrcweiroletest.AttrULong= arrUInt 905*cdf0e10cSrcweirret= oletest.AttrULong 906*cdf0e10cSrcweirLog.print isEqualVBAr( arrUInt, ret), "AttrULong" 907*cdf0e10cSrcweir 908*cdf0e10cSrcweiroletest.AttrChar= arrChar 909*cdf0e10cSrcweirret= oletest.AttrChar 910*cdf0e10cSrcweirbOk= false 911*cdf0e10cSrcweirif ret(0) = 65 AND ret(1) = 66 AND ret(2) = 67 then 912*cdf0e10cSrcweir bOk= true 913*cdf0e10cSrcweirend if 914*cdf0e10cSrcweirLog.print bOk, "AttrChar" 915*cdf0e10cSrcweir 916*cdf0e10cSrcweiroletest.AttrString= arrString 917*cdf0e10cSrcweirret= oletest.AttrString 918*cdf0e10cSrcweirLog.print isEqualVBAr( arrString, ret), "AttrString" 919*cdf0e10cSrcweir 920*cdf0e10cSrcweiroletest.AttrSequence= arrDim2Int 921*cdf0e10cSrcweirret= oletest.AttrSequence 922*cdf0e10cSrcweirbOk= true 923*cdf0e10cSrcweirFor i= 0 To 1 924*cdf0e10cSrcweir arr1= ret(i) 925*cdf0e10cSrcweir For j= 0 To 2 926*cdf0e10cSrcweir if arr1(j) <> arrDim2Int(j,i) then 927*cdf0e10cSrcweir bOk= false 928*cdf0e10cSrcweir exit for 929*cdf0e10cSrcweir end if 930*cdf0e10cSrcweir Next 931*cdf0e10cSrcweirNext 932*cdf0e10cSrcweirLog.print bOk, "AttrSequence" 933*cdf0e10cSrcweir 934*cdf0e10cSrcweiroletest.AttrSequence2= arrDim3Int 935*cdf0e10cSrcweirret= oletest.AttrSequence2 936*cdf0e10cSrcweir'arrDim3Int(3,2,1) 937*cdf0e10cSrcweirbOk= true 938*cdf0e10cSrcweirFor i= 0 To 1 939*cdf0e10cSrcweir arr1= ret(i) 940*cdf0e10cSrcweir For j= 0 To 2 941*cdf0e10cSrcweir arr2= arr1(j) 942*cdf0e10cSrcweir For k= 0 To 3 943*cdf0e10cSrcweir If arr2(k) <> arrDim3Int(k,j,i) then 944*cdf0e10cSrcweir bOk= false 945*cdf0e10cSrcweir exit for 946*cdf0e10cSrcweir End If 947*cdf0e10cSrcweir Next 948*cdf0e10cSrcweir Next 949*cdf0e10cSrcweirNext 950*cdf0e10cSrcweirLog.print bOk, "AttrSequence2" 951*cdf0e10cSrcweir 952*cdf0e10cSrcweiroletest.AttrXInterface= arrXEvent 953*cdf0e10cSrcweirret= oletest.AttrXInterface 954*cdf0e10cSrcweirbOk= true 955*cdf0e10cSrcweirnumArg= UBound( arrXEvent) - LBound( arrXEvent) + 1 956*cdf0e10cSrcweirnumRet= UBound( ret) - LBound( ret) + 1 957*cdf0e10cSrcweirIf numArg = numRet then 958*cdf0e10cSrcweir For i= 0 To numArg - 1 959*cdf0e10cSrcweir If NOT (arrXEvent(i) Is ret(i)) then 960*cdf0e10cSrcweir bOk= false 961*cdf0e10cSrcweir Exit For 962*cdf0e10cSrcweir End if 963*cdf0e10cSrcweir Next 964*cdf0e10cSrcweirEnd If 965*cdf0e10cSrcweirLog.print bOk, "AttrXInterface" 966*cdf0e10cSrcweir 967*cdf0e10cSrcweir'out params ================================================================================ 968*cdf0e10cSrcweirdocument.writeln("<p>") 969*cdf0e10cSrcweirDim inVal, outVal, retVal 970*cdf0e10cSrcweir 971*cdf0e10cSrcweirinVal = 111 972*cdf0e10cSrcweirretVal = oletest.in_methodByte(inVal) 973*cdf0e10cSrcweiroletest.testout_methodByte outVal 974*cdf0e10cSrcweirLog.print inVal = retVal, "in_methodByte" 975*cdf0e10cSrcweirLog.print outVal = inVal, "testout_methodByte" 976*cdf0e10cSrcweir 977*cdf0e10cSrcweirinVal = 3.14 978*cdf0e10cSrcweirretVal = oletest.in_methodFloat(inVal) 979*cdf0e10cSrcweiroletest.testout_methodFloat outVal 980*cdf0e10cSrcweirLog.print inVal = retVal, "in_methodFloat" 981*cdf0e10cSrcweirLog.print outVal > 3.13 AND outVal < 3.15, "testout_methodFloat" 982*cdf0e10cSrcweir 983*cdf0e10cSrcweirinVal = 3.14 984*cdf0e10cSrcweirretVal = oletest.in_methodDouble(inVal) 985*cdf0e10cSrcweiroletest.testout_methodDouble outVal 986*cdf0e10cSrcweirLog.print inVal = retVal, "in_methodDouble" 987*cdf0e10cSrcweirLog.print outVal = 3.14, "testout_methodDouble" 988*cdf0e10cSrcweir 989*cdf0e10cSrcweirinVal = true 990*cdf0e10cSrcweirretVal = oletest.in_methodBool(inVal) 991*cdf0e10cSrcweiroletest.testout_methodBool outVal 992*cdf0e10cSrcweirLog.print inVal = retVal, "in_methodBool" 993*cdf0e10cSrcweirLog.print outVal = inVal, "testout_methodBool" 994*cdf0e10cSrcweir 995*cdf0e10cSrcweirinVal = 222 996*cdf0e10cSrcweirretVal = oletest.in_methodShort(inVal) 997*cdf0e10cSrcweiroletest.testout_methodShort outVal 998*cdf0e10cSrcweirLog.print inVal = retVal, "in_methodShort" 999*cdf0e10cSrcweirLog.print outVal = inVAl, "testout_methodShort" 1000*cdf0e10cSrcweir 1001*cdf0e10cSrcweirinVal = 333 1002*cdf0e10cSrcweirretVal = oletest.in_methodUShort(inVal) 1003*cdf0e10cSrcweiroletest.testout_methodUShort outVal 1004*cdf0e10cSrcweirLog.print inVal = retVal, "in_methodUShort" 1005*cdf0e10cSrcweirLog.print outVal = inVal, "testout_methodUShort" 1006*cdf0e10cSrcweir 1007*cdf0e10cSrcweirinVal = 4444 1008*cdf0e10cSrcweirretVal = oletest.in_methodLong(inVal) 1009*cdf0e10cSrcweiroletest.testout_methodLong outVal 1010*cdf0e10cSrcweirLog.print inVal = retVal, "in_methodLong" 1011*cdf0e10cSrcweirLog.print outVal = inVal, "testout_methodLong" 1012*cdf0e10cSrcweir 1013*cdf0e10cSrcweirinVal = 5555 1014*cdf0e10cSrcweirretVal = oletest.in_methodULong(inVal) 1015*cdf0e10cSrcweiroletest.testout_methodULong outVal 1016*cdf0e10cSrcweirLog.print inVal = retVal, "in_methodULong" 1017*cdf0e10cSrcweirLog.print outVal = inVal, "testout_methodULong" 1018*cdf0e10cSrcweir 1019*cdf0e10cSrcweirinVal = 65 1020*cdf0e10cSrcweirretVal = oletest.in_methodChar(inVal) 1021*cdf0e10cSrcweiroletest.testout_methodChar outVal 1022*cdf0e10cSrcweirLog.print inVal = retVal, "in_methodChar" 1023*cdf0e10cSrcweirLog.print outVal = 65, "testout_methodChar" 1024*cdf0e10cSrcweir 1025*cdf0e10cSrcweirinVal = "Hello World 3!" 1026*cdf0e10cSrcweirretVal = oletest.in_methodString(inVal) 1027*cdf0e10cSrcweiroletest.testout_methodString outVal 1028*cdf0e10cSrcweirLog.print inVal = retVal, "in_methodString" 1029*cdf0e10cSrcweirLog.print outVal = inVal, "testout_methodString" 1030*cdf0e10cSrcweir 1031*cdf0e10cSrcweirinVal = "Hello World 4!" 1032*cdf0e10cSrcweirretVal = oletest.in_methodAny(inVal) 1033*cdf0e10cSrcweiroletest.testout_methodAny outVal 1034*cdf0e10cSrcweirLog.print outVal = inVal, "testout_methodAny" 1035*cdf0e10cSrcweir 1036*cdf0e10cSrcweiroletest.testout_methodSequence outVal 1037*cdf0e10cSrcweirLog.print isEqualVBAr(outVal, Array( 0,1,2,3,4,5,6,7,8,9)), "testout_methodSequence" 1038*cdf0e10cSrcweir 1039*cdf0e10cSrcweiroletest.testout_methodSequence2 outVal 1040*cdf0e10cSrcweircount= UBound( outVal) - LBound( outVal) + 1 1041*cdf0e10cSrcweirret= False 1042*cdf0e10cSrcweirIf count = 10 Then 1043*cdf0e10cSrcweir For Each ar In outVal 1044*cdf0e10cSrcweir ret= isEqualVBAr(ar, Array( 0,1,2,3,4,5,6,7,8,9)) 1045*cdf0e10cSrcweir If ret = false Then 1046*cdf0e10cSrcweir Exit For 1047*cdf0e10cSrcweir End If 1048*cdf0e10cSrcweir Next 1049*cdf0e10cSrcweirEnd If 1050*cdf0e10cSrcweirLog.print ret, "testout_methodSequence2" 1051*cdf0e10cSrcweir 1052*cdf0e10cSrcweiroutVal= Empty 1053*cdf0e10cSrcweiroutVal2= Empty 1054*cdf0e10cSrcweiroletest.testout_methodMulParams1 outVal, outVal2 1055*cdf0e10cSrcweirret= false 1056*cdf0e10cSrcweirIf outVal = 999 AND outVal2 = 1111 Then 1057*cdf0e10cSrcweir ret= true 1058*cdf0e10cSrcweirEnd If 1059*cdf0e10cSrcweirLog.print ret, "testout_methodMulParams1" 1060*cdf0e10cSrcweir 1061*cdf0e10cSrcweiroutVal= Empty 1062*cdf0e10cSrcweiroutVal2= Empty 1063*cdf0e10cSrcweiroutVal3= Empty 1064*cdf0e10cSrcweiroletest.testout_methodMulParams2 outVal, outVal2, outVal3 1065*cdf0e10cSrcweirret = false 1066*cdf0e10cSrcweirIf outVal = 1111 AND outVal2 = 1222 AND outVal3 = " another string" Then 1067*cdf0e10cSrcweir ret= true 1068*cdf0e10cSrcweirEnd If 1069*cdf0e10cSrcweirLog.print ret, "testout_methodMulParams2" 1070*cdf0e10cSrcweir 1071*cdf0e10cSrcweirdocument.writeln("missing: testout_methodMulParams3 <br>") 1072*cdf0e10cSrcweirdocument.writeln("missing: testout_methodMulParams4 <br>") 1073*cdf0e10cSrcweir 1074*cdf0e10cSrcweiroutVal= Empty 1075*cdf0e10cSrcweiroletest.testout_methodXInterface outVal 1076*cdf0e10cSrcweirret= false 1077*cdf0e10cSrcweirIf outVal Is oletest Then 1078*cdf0e10cSrcweir ret= true 1079*cdf0e10cSrcweirEnd If 1080*cdf0e10cSrcweirLog.print ret, "testout_methodXInterface" 1081*cdf0e10cSrcweir 1082*cdf0e10cSrcweirSet outVal= Nothing 1083*cdf0e10cSrcweirdocument.writeln("missing: testout_methodXInterface <br>") 1084*cdf0e10cSrcweir 1085*cdf0e10cSrcweirinVal = 1 1086*cdf0e10cSrcweiroutVal= inVal 1087*cdf0e10cSrcweiroletest.testinout_methodByte outVal 1088*cdf0e10cSrcweiroletest.testinout_methodByte outVal 1089*cdf0e10cSrcweirLog.print inVal = outVal, "testinout_methodByte" 1090*cdf0e10cSrcweir 1091*cdf0e10cSrcweir 1092*cdf0e10cSrcweirdocument.writeln("missing: testinout_methodFloat <br>") 1093*cdf0e10cSrcweirdocument.writeln("missing: testinout_methodDouble <br>") 1094*cdf0e10cSrcweirdocument.writeln("missing: testinout_methodBool <br>") 1095*cdf0e10cSrcweirdocument.writeln("missing: testinout_methodShort <br>") 1096*cdf0e10cSrcweirdocument.writeln("missing: testinout_methodUShort <br>") 1097*cdf0e10cSrcweirdocument.writeln("missing: testinout_methodLong <br>") 1098*cdf0e10cSrcweirdocument.writeln("missing: testinout_methodULong <br>") 1099*cdf0e10cSrcweirdocument.writeln("missing: testinout_methodChar <br>") 1100*cdf0e10cSrcweirdocument.writeln("missing: testinout_methodString <br>") 1101*cdf0e10cSrcweirdocument.writeln("missing: testinout_methodAny <br>") 1102*cdf0e10cSrcweirdocument.writeln("missing: testinout_methodSequence <br>") 1103*cdf0e10cSrcweirdocument.writeln("missing: testinout_methodSequence2 <br>") 1104*cdf0e10cSrcweirdocument.writeln("missing: testinout_methodXInterface <br>") 1105*cdf0e10cSrcweirdocument.writeln("missing: methodAnyTest1 <br>") 1106*cdf0e10cSrcweirdocument.writeln("missing: methodAnyTest1 <br>") 1107*cdf0e10cSrcweirdocument.writeln("missing: methodAnyTest1 <br>") 1108*cdf0e10cSrcweirdocument.writeln("missing: methodAnyTest1 <br>") 1109*cdf0e10cSrcweirdocument.writeln("missing: methodAnyTest1 <br>") 1110*cdf0e10cSrcweirdocument.writeln("missing: AttrAny2 <br>") 1111*cdf0e10cSrcweirdocument.writeln("missing: methodAnyTest1 <br>") 1112*cdf0e10cSrcweirdocument.writeln("missing: methodAnyTest1 <br>") 1113*cdf0e10cSrcweirdocument.writeln("missing: methodAnyTest1 <br>") 1114*cdf0e10cSrcweirdocument.writeln("missing: methodAnyTest1 <br>") 1115*cdf0e10cSrcweirdocument.writeln("missing: methodAnyTest1 <br>") 1116*cdf0e10cSrcweirdocument.writeln("missing: retMethodStruct <br>") 1117*cdf0e10cSrcweirdocument.writeln("missing: AttrStruct <br>") 1118*cdf0e10cSrcweirdocument.writeln("missing: methodStruct2 <br>") 1119*cdf0e10cSrcweir 1120*cdf0e10cSrcweir' Test Identity from COM objects in UNO 1121*cdf0e10cSrcweirDim listener1 1122*cdf0e10cSrcweirSet listener1= new VBEventListener 1123*cdf0e10cSrcweircall oletest.setObject( listener1) 1124*cdf0e10cSrcweirret= oletest.isSame(listener1) 1125*cdf0e10cSrcweirLog.print2 ret, "Ok Testing identity of COM objects <br>","Failed Testing identity of COM objects<br>" 1126*cdf0e10cSrcweir' Test identity of UNO objects 1127*cdf0e10cSrcweir 1128*cdf0e10cSrcweirset oletest2= oletest.getThis() 1129*cdf0e10cSrcweirret= oletest Is oletest2 1130*cdf0e10cSrcweirLog.print2 ret, "Ok Testing identity of UNO objects<br>","Failed Testing identity of UNO objects<br>" 1131*cdf0e10cSrcweir 1132*cdf0e10cSrcweirEnd Function 1133*cdf0e10cSrcweir 1134*cdf0e10cSrcweir 1135*cdf0e10cSrcweirFunction isEqualVBAr( arr1, arr2) 1136*cdf0e10cSrcweir ret = false 1137*cdf0e10cSrcweir s1= UBound( arr1) - LBound( arr1) + 1 1138*cdf0e10cSrcweir s2= UBound( arr2) - LBound( arr2) + 1 1139*cdf0e10cSrcweir 1140*cdf0e10cSrcweir if s1 = s2 then 1141*cdf0e10cSrcweir ret= true 1142*cdf0e10cSrcweir Dim i 1143*cdf0e10cSrcweir for i= 0 To s1 - 1 1144*cdf0e10cSrcweir if arr1(i) <> arr2(i) then 1145*cdf0e10cSrcweir ret= false 1146*cdf0e10cSrcweir exit for 1147*cdf0e10cSrcweir end if 1148*cdf0e10cSrcweir next 1149*cdf0e10cSrcweir end if 1150*cdf0e10cSrcweir isEqualVBar= ret 1151*cdf0e10cSrcweirEnd Function 1152*cdf0e10cSrcweir 1153*cdf0e10cSrcweir 1154*cdf0e10cSrcweir'The listener object 1155*cdf0e10cSrcweir 1156*cdf0e10cSrcweirClass VBEventListener 1157*cdf0e10cSrcweir Dim Bridge_ImplementedInterfaces(0) 1158*cdf0e10cSrcweir Dim bDisposingCalled 1159*cdf0e10cSrcweir 1160*cdf0e10cSrcweir'XEventListener::disposing 1161*cdf0e10cSrcweir Function disposing( source) 1162*cdf0e10cSrcweir bDisposingCalled= true 1163*cdf0e10cSrcweir End Function 1164*cdf0e10cSrcweir 1165*cdf0e10cSrcweir Sub Class_Initialize() 1166*cdf0e10cSrcweir bDisposingCalled= false 1167*cdf0e10cSrcweir Bridge_ImplementedInterfaces(0)= "com.sun.star.lang.XEventListener" 1168*cdf0e10cSrcweir End Sub 1169*cdf0e10cSrcweir 1170*cdf0e10cSrcweir Function resetDisposing() 1171*cdf0e10cSrcweir bDisposingCalled= false 1172*cdf0e10cSrcweir End Function 1173*cdf0e10cSrcweir 1174*cdf0e10cSrcweir Function disposingCalled() 1175*cdf0e10cSrcweir disposingCalled= bDisposingCalled 1176*cdf0e10cSrcweir End Function 1177*cdf0e10cSrcweirEnd Class 1178*cdf0e10cSrcweir 1179*cdf0e10cSrcweir 1180*cdf0e10cSrcweirsub callBasic(id) 1181*cdf0e10cSrcweir 1182*cdf0e10cSrcweir Dim factory 1183*cdf0e10cSrcweir Set factory= GetObject("", "com.sun.star.ServiceManager") 1184*cdf0e10cSrcweir 1185*cdf0e10cSrcweir Set oletest= factory.createInstance("oletest.OleTest") 1186*cdf0e10cSrcweir 1187*cdf0e10cSrcweir 1188*cdf0e10cSrcweir arrInt= Array(1,2,3,4,5) 1189*cdf0e10cSrcweir arrInt2= Array( -1, -2, 127, 128, 0) 1190*cdf0e10cSrcweir arrDouble= Array(1.1, 2.2, 3.3, 4.4, 5.5) 1191*cdf0e10cSrcweir arrBool= Array(0,1,0,2,0) 1192*cdf0e10cSrcweir arrLong= Array( &Hff, &Hffff, &Hffffff, &Hffffffff) 1193*cdf0e10cSrcweir arrString= Array("Chicken Wings", "Cheeseburger", "Hamburger") 1194*cdf0e10cSrcweir arrChar= Array("a",65, "M") 1195*cdf0e10cSrcweir arrAny= Array("Mickey", 3.14, 100, "A") 1196*cdf0e10cSrcweir 1197*cdf0e10cSrcweir Dim arrDim2Int(1,2) 1198*cdf0e10cSrcweir For i= 0 To 1 1199*cdf0e10cSrcweir For j= 0 To 1 1200*cdf0e10cSrcweir arrDim2Int(i,j) = i*2 + j 1201*cdf0e10cSrcweir Next 1202*cdf0e10cSrcweir Next 1203*cdf0e10cSrcweir 1204*cdf0e10cSrcweir Dim arrDim3Int(1,1,1) 1205*cdf0e10cSrcweir For i= 0 To 1 1206*cdf0e10cSrcweir For j= 0 To 1 1207*cdf0e10cSrcweir For k=0 To 1 1208*cdf0e10cSrcweir arrDim3Int(i,j,k) = i*2 + j*2 + k 1209*cdf0e10cSrcweir Next 1210*cdf0e10cSrcweir Next 1211*cdf0e10cSrcweir Next 1212*cdf0e10cSrcweir 1213*cdf0e10cSrcweir 1214*cdf0e10cSrcweir select case id 1215*cdf0e10cSrcweir 1216*cdf0e10cSrcweir // Out Parameter 1217*cdf0e10cSrcweir 1218*cdf0e10cSrcweir 1219*cdf0e10cSrcweir 1220*cdf0e10cSrcweir // In Out Parameter -------------------------------------------------- 1221*cdf0e10cSrcweir case 100 1222*cdf0e10cSrcweir a= 100 1223*cdf0e10cSrcweir document.write "param: " & CStr( a) & "<br>" 1224*cdf0e10cSrcweir oletest.testinout_methodByte a 1225*cdf0e10cSrcweir document.write a 1226*cdf0e10cSrcweir case 101 1227*cdf0e10cSrcweir a= 1.11 1228*cdf0e10cSrcweir document.write "param: " & CStr( a) & "<br>" 1229*cdf0e10cSrcweir oletest.testinout_methodDouble a 1230*cdf0e10cSrcweir document.write a 1231*cdf0e10cSrcweir case 102 1232*cdf0e10cSrcweir a= 5 1233*cdf0e10cSrcweir document.write "param: "& CStr( a) & "<br>" 1234*cdf0e10cSrcweir oletest.testinout_methodBool a 1235*cdf0e10cSrcweir document.write a 1236*cdf0e10cSrcweir case 103 1237*cdf0e10cSrcweir a= -10 1238*cdf0e10cSrcweir document.write "param: "& CStr( a) & "<br>" 1239*cdf0e10cSrcweir oletest.testinout_methodShort a 1240*cdf0e10cSrcweir document.write a 1241*cdf0e10cSrcweir case 104 1242*cdf0e10cSrcweir a= 128 1243*cdf0e10cSrcweir document.write "param: "& CStr( a) & "<br>" 1244*cdf0e10cSrcweir oletest.testinout_methodUShort a 1245*cdf0e10cSrcweir document.write a 1246*cdf0e10cSrcweir case 105 1247*cdf0e10cSrcweir a= 65556 1248*cdf0e10cSrcweir document.write "param: "& CStr( a) & "<br>" 1249*cdf0e10cSrcweir oletest.testinout_methodLong a 1250*cdf0e10cSrcweir document.write a 1251*cdf0e10cSrcweir case 106 1252*cdf0e10cSrcweir a= 65556 1253*cdf0e10cSrcweir document.write "param: "& CStr( a) & "<br>" 1254*cdf0e10cSrcweir oletest.testinout_methodULong a 1255*cdf0e10cSrcweir document.write a 1256*cdf0e10cSrcweir case 107 1257*cdf0e10cSrcweir a= "ein test string" 1258*cdf0e10cSrcweir document.write "param: "& CStr( a) & "<br>" 1259*cdf0e10cSrcweir oletest.testinout_methodString a 1260*cdf0e10cSrcweir document.write a 1261*cdf0e10cSrcweir case 108 1262*cdf0e10cSrcweir a= "W" 1263*cdf0e10cSrcweir document.write "param: "& CStr( a) & "<br>" 1264*cdf0e10cSrcweir oletest.testinout_methodChar a 1265*cdf0e10cSrcweir document.write a 1266*cdf0e10cSrcweir case 109 1267*cdf0e10cSrcweir a= "Ein String im Any" 1268*cdf0e10cSrcweir document.write "param: "& CStr( a) & "<br>" 1269*cdf0e10cSrcweir oletest.other_methodAnyIn a 1270*cdf0e10cSrcweir document.write a 1271*cdf0e10cSrcweir 1272*cdf0e10cSrcweir case 150 1273*cdf0e10cSrcweir dim a 1274*cdf0e10cSrcweir document.write "param: "& CStr( a) & "<br>" 1275*cdf0e10cSrcweir oletest.testout_methodByte( a) 1276*cdf0e10cSrcweir document.write a 1277*cdf0e10cSrcweir// Attributes ----------------------------------------------------------------- 1278*cdf0e10cSrcweir case 200 1279*cdf0e10cSrcweir document.write "set: " 1280*cdf0e10cSrcweir printArray arrInt 1281*cdf0e10cSrcweir oletest.AttrByte= arrInt 1282*cdf0e10cSrcweir b= oletest.AttrByte 1283*cdf0e10cSrcweir call printArrayEx( "<br> get: ", "<br>", b) 1284*cdf0e10cSrcweir case 201 1285*cdf0e10cSrcweir document.write "set: " 1286*cdf0e10cSrcweir printArray arrDouble 1287*cdf0e10cSrcweir oletest.AttrDouble= arrDouble 1288*cdf0e10cSrcweir b= oletest.AttrDouble 1289*cdf0e10cSrcweir call printArrayEx( "<br> get: ", "<br>", b) 1290*cdf0e10cSrcweir case 202 1291*cdf0e10cSrcweir document.write "set: " 1292*cdf0e10cSrcweir printArray arrBool : 1293*cdf0e10cSrcweir oletest.AttrBool= arrBool 1294*cdf0e10cSrcweir b= oletest.AttrBool 1295*cdf0e10cSrcweir call printArrayEx( "<br> get: ", "<br>", b) 1296*cdf0e10cSrcweir case 203 1297*cdf0e10cSrcweir document.write "set: " 1298*cdf0e10cSrcweir printArray arrInt2 : 1299*cdf0e10cSrcweir oletest.AttrShort= arrInt2 1300*cdf0e10cSrcweir b= oletest.AttrShort 1301*cdf0e10cSrcweir call printArrayEx( "<br> get: ", "<br>", b) 1302*cdf0e10cSrcweir case 204 1303*cdf0e10cSrcweir document.write "set: " 1304*cdf0e10cSrcweir printArray arrInt 1305*cdf0e10cSrcweir oletest.AttrUShort= arrInt 1306*cdf0e10cSrcweir b= oletest.AttrUShort 1307*cdf0e10cSrcweir call printArrayEx( "<br> get: ", "<br>", b) 1308*cdf0e10cSrcweir case 205 1309*cdf0e10cSrcweir document.write "set: " 1310*cdf0e10cSrcweir printArray arrInt2 1311*cdf0e10cSrcweir oletest.AttrLong= arrInt2 1312*cdf0e10cSrcweir b= oletest.AttrLong 1313*cdf0e10cSrcweir call printArrayEx( "<br> get: ", "<br>", b) 1314*cdf0e10cSrcweir case 206 1315*cdf0e10cSrcweir document.write "set: " 1316*cdf0e10cSrcweir printArray arrInt 1317*cdf0e10cSrcweir oletest.AttrULong= arrInt 1318*cdf0e10cSrcweir b= oletest.AttrULong 1319*cdf0e10cSrcweir call printArrayEx( "<br> get: ", "<br>", b) 1320*cdf0e10cSrcweir case 207 1321*cdf0e10cSrcweir document.write "set: " 1322*cdf0e10cSrcweir printArray arrString 1323*cdf0e10cSrcweir oletest.AttrString= arrString 1324*cdf0e10cSrcweir b= oletest.AttrString 1325*cdf0e10cSrcweir call printArrayEx( "<br> get: ", "<br>", b) 1326*cdf0e10cSrcweir case 208 1327*cdf0e10cSrcweir document.write "set: " 1328*cdf0e10cSrcweir printArray arrChar 1329*cdf0e10cSrcweir oletest.AttrChar= arrChar 1330*cdf0e10cSrcweir b= oletest.AttrChar 1331*cdf0e10cSrcweir call printArrayEx( "<br> get: ", "<br>", b) 1332*cdf0e10cSrcweir case 209 1333*cdf0e10cSrcweir document.write "set: " 1334*cdf0e10cSrcweir printArray arrAny 1335*cdf0e10cSrcweir oletest.AttrAny= arrAny 1336*cdf0e10cSrcweir b= oletest.AttrAny 1337*cdf0e10cSrcweir call printArrayEx( "<br> get: ", "<br>", b) 1338*cdf0e10cSrcweir 1339*cdf0e10cSrcweir case 210 1340*cdf0e10cSrcweir document.write "set: <br>" 1341*cdf0e10cSrcweir printArray2 arrDim2Int : 1342*cdf0e10cSrcweir oletest.AttrSequence= arrDim2Int 1343*cdf0e10cSrcweir ret= oletest.AttrSequence 1344*cdf0e10cSrcweir document.write "get: " 1345*cdf0e10cSrcweir for each val in ret 1346*cdf0e10cSrcweir document.write "<br> array: " 1347*cdf0e10cSrcweir for each val2 in val 1348*cdf0e10cSrcweir document.write val2 1349*cdf0e10cSrcweir next 1350*cdf0e10cSrcweir next 1351*cdf0e10cSrcweir 1352*cdf0e10cSrcweir case 300 1353*cdf0e10cSrcweir dim aByte 1354*cdf0e10cSrcweir aByte= 100 1355*cdf0e10cSrcweir call oletest.testinout_methodByte( aByte) 1356*cdf0e10cSrcweir MsgBox aByte 1357*cdf0e10cSrcweir 1358*cdf0e10cSrcweir 1359*cdf0e10cSrcweir case 400 1360*cdf0e10cSrcweir 1361*cdf0e10cSrcweir set struct= oletest.Bridge_GetStruct("com.sun.star.beans.Property") 1362*cdf0e10cSrcweir struct.Attributes= 1 1363*cdf0e10cSrcweir struct.Handle= 2 1364*cdf0e10cSrcweir struct.Name= "some Property" 1365*cdf0e10cSrcweir oletest.methodStruct struct 1366*cdf0e10cSrcweir 1367*cdf0e10cSrcweir case 401 1368*cdf0e10cSrcweir set struct= oletest.retMethodStruct() 1369*cdf0e10cSrcweir alert( "Property::Attributes : " & struct.Attributes & vblf & " Property::Handle : " _ 1370*cdf0e10cSrcweir & struct.Handle & vblf & " Property::Name : " & struct.Name) 1371*cdf0e10cSrcweir 1372*cdf0e10cSrcweir case 402 1373*cdf0e10cSrcweir set struct= oletest.Bridge_GetStruct("com.sun.star.beans.Property") 1374*cdf0e10cSrcweir struct.Attributes= 1 1375*cdf0e10cSrcweir struct.Handle= 2 1376*cdf0e10cSrcweir struct.Name= "some Property" 1377*cdf0e10cSrcweir oletest.AttrStruct= struct 1378*cdf0e10cSrcweir 1379*cdf0e10cSrcweir set struct2= oletest.AttrStruct 1380*cdf0e10cSrcweir alert( "property get: " & vblf & "Property::Attributes : " & struct2.Attributes & _ 1381*cdf0e10cSrcweir vblf & " Property::Handle : " & struct2.Handle & vblf & " Property::Name : " _ 1382*cdf0e10cSrcweir & struct2.Name) 1383*cdf0e10cSrcweir end select 1384*cdf0e10cSrcweirend sub 1385*cdf0e10cSrcweir 1386*cdf0e10cSrcweirsub printArray( arr) 1387*cdf0e10cSrcweir document.write "array: " 1388*cdf0e10cSrcweir For Each val In arr 1389*cdf0e10cSrcweir document.write CStr(val) & " " 1390*cdf0e10cSrcweir Next 1391*cdf0e10cSrcweirend sub 1392*cdf0e10cSrcweir 1393*cdf0e10cSrcweir// print a 2 dimensional Array 1394*cdf0e10cSrcweir 1395*cdf0e10cSrcweirsub printArray2( arr) 1396*cdf0e10cSrcweir elements1= UBound( arr, 1) - LBound( arr, 1) +1 1397*cdf0e10cSrcweir elements2= UBound( arr, 2) - LBound( arr, 2) +1 1398*cdf0e10cSrcweir 1399*cdf0e10cSrcweir For i=0 To elements1 -1 1400*cdf0e10cSrcweir document.write( "array " & CStr( i) & ": " ) 1401*cdf0e10cSrcweir For j=0 To elements2 -1 1402*cdf0e10cSrcweir document.write CStr( arr(i,j)) 1403*cdf0e10cSrcweir Next 1404*cdf0e10cSrcweir document.write( "<br>") 1405*cdf0e10cSrcweir Next 1406*cdf0e10cSrcweirend sub 1407*cdf0e10cSrcweir 1408*cdf0e10cSrcweirsub printArrayEx( pre, post, array) 1409*cdf0e10cSrcweir document.write pre 1410*cdf0e10cSrcweir printArray array 1411*cdf0e10cSrcweir document.write post 1412*cdf0e10cSrcweirend sub 1413*cdf0e10cSrcweir</script> 1414*cdf0e10cSrcweir 1415*cdf0e10cSrcweir<script language="JScript"> 1416*cdf0e10cSrcweirvar arFunctions= new Array(); 1417*cdf0e10cSrcweirarFunctions["methodByte"]= "sequence<byte> methodByte( [in] sequence<byte> aSeq )"; 1418*cdf0e10cSrcweirarFunctions["methodFloat"]= "sequence<float> methodFloat( [in] sequence<float> aSeq)"; 1419*cdf0e10cSrcweirarFunctions["methodDouble"]= "sequence<double> methodDouble( [in] sequence<double> aSeq)"; 1420*cdf0e10cSrcweirarFunctions["methodBool"]= "sequence<boolean> methodBool( [in] sequence<boolean> aSeq)"; 1421*cdf0e10cSrcweirarFunctions["methodShort"]= "sequence<short> methodShort( [in] sequence<short> aSeq)"; 1422*cdf0e10cSrcweirarFunctions["methodUShort"]= "sequence<unsigned short> methodUShort( [in] sequence<unsigned short> aSeq)"; 1423*cdf0e10cSrcweirarFunctions["methodLong"]= "sequence<long> methodLong( [in] sequence<long> aSeq)"; 1424*cdf0e10cSrcweirarFunctions["methodULong"]= "sequence<unsigned long> methodULong( [in] sequence<unsigned long> aSeq)"; 1425*cdf0e10cSrcweirarFunctions["methodString"]= "sequence<string> methodString( [in] sequence<string> aSeq)"; 1426*cdf0e10cSrcweirarFunctions["methodChar"]= "sequence<char> methodChar( [in] sequence<char> aSeq)"; 1427*cdf0e10cSrcweirarFunctions["methodAny"]= "sequence<any> methodAny ( [in] sequence<any> aSeq)"; 1428*cdf0e10cSrcweirarFunctions["methodXInterface"]= "sequence<XInterface> methodXInterface ( [in] sequence<XInterface> aSeq)"; 1429*cdf0e10cSrcweirarFunctions["methodSequence"]= "sequence< sequence <long> > methodSequence( [in] sequence< sequence< long > > aSeq)"; 1430*cdf0e10cSrcweirarFunctions["methodSequence2"]= "sequence< sequence <sequence <long> > > methodSequence2( [in] sequence< sequence< sequence<long> > > aSeq)"; 1431*cdf0e10cSrcweirarFunctions["methodXEventListeners"]= "sequence< com::sun::star::lang::XEventListener > methodXEventListeners( [in] sequence<com::sun::star::lang::XEventListener> aSeq)"; 1432*cdf0e10cSrcweirarFunctions["methodXEventListenersMul"]= "sequence< sequence< com::sun::star::lang::XEventListener > > methodXEventListenersMul( [in] sequence< sequence< com::sun::star::lang::XEventListener> > aSeq)"; 1433*cdf0e10cSrcweirarFunctions["AttrByte"]="[attribute] sequence<byte> AttrByte"; 1434*cdf0e10cSrcweirarFunctions["AttrFloat"]="[attribute] sequence<float> AttrFloat"; 1435*cdf0e10cSrcweirarFunctions["AttrDouble"]="[attribute] sequence<double> AttrDouble"; 1436*cdf0e10cSrcweirarFunctions["AttrBool"]="[attribute] sequence<boolean> AttrBool"; 1437*cdf0e10cSrcweirarFunctions["AttrShort"]="[attribute] sequence<short> AttrShort"; 1438*cdf0e10cSrcweirarFunctions["AttrUShort"]="[attribute] sequence<unsigned short> AttrUShort"; 1439*cdf0e10cSrcweirarFunctions["AttrLong"]="[attribute] sequence<long> AttrLong"; 1440*cdf0e10cSrcweirarFunctions["AttrULong"]="[attribute] sequence<unsigned long> AttrULong"; 1441*cdf0e10cSrcweirarFunctions["AttrString"]="[attribute] sequence<string> AttrString"; 1442*cdf0e10cSrcweirarFunctions["AttrChar"]="[attribute] sequence<char> AttrChar"; 1443*cdf0e10cSrcweirarFunctions["AttrAny"]="[attribute] sequence<any> AttrAny"; 1444*cdf0e10cSrcweirarFunctions["AttrSequence"]="[attribute] sequence< sequence<long> > AttrSequence"; 1445*cdf0e10cSrcweirarFunctions["AttrSequence2"]="[attribute] sequence< sequence< sequence <long> > > AttrSequence2"; 1446*cdf0e10cSrcweirarFunctions["AttrXInterface"]="[attribute] sequence< com::sun::star::uno::XInterface > AttrXInterface"; 1447*cdf0e10cSrcweir 1448*cdf0e10cSrcweirarFunctions["testout_methodByte"]= " void testout_methodByte( [out] byte rOut )"; 1449*cdf0e10cSrcweirarFunctions["testout_methodFloat"]= "void testout_methodFloat( [out] float rOut)"; 1450*cdf0e10cSrcweirarFunctions["testout_methodDouble"]= "void testout_methodDouble( [out] double rOut)"; 1451*cdf0e10cSrcweirarFunctions["testout_methodBool"]= "void testout_methodBool( [out] boolean rOut)"; 1452*cdf0e10cSrcweirarFunctions["testout_methodShort"]= "void testout_methodShort( [out] short rOut)"; 1453*cdf0e10cSrcweirarFunctions["testout_methodUShort"]= "void testout_methodUShort( [out] unsigned short rOut)"; 1454*cdf0e10cSrcweirarFunctions["testout_methodLong"]= "void testout_methodLong( [out] long rOut)"; 1455*cdf0e10cSrcweirarFunctions["testout_methodULong"]= "void testout_methodULong( [out] unsigned long rOut)"; 1456*cdf0e10cSrcweirarFunctions["testout_methodString"]= "void testout_methodString( [out] string rOut)"; 1457*cdf0e10cSrcweirarFunctions["testout_methodChar"]= "void testout_methodChar( [out] char rOut)"; 1458*cdf0e10cSrcweirarFunctions["testout_methodAny"]= "void testout_methodAny( [out] any rOut)"; 1459*cdf0e10cSrcweirarFunctions["testout_methodSequence"]= "void testout_methodSequence( [out] sequence< long > rOut)"; 1460*cdf0e10cSrcweirarFunctions["testout_methodSequence2"]= "void testout_methodSequence2( [out] sequence < sequence< long > > rOut)"; 1461*cdf0e10cSrcweirarFunctions["testout_methodXInterface"]= "void testout_methodXInterface( [out] com::sun::star::uno::XInterface rOut)"; 1462*cdf0e10cSrcweirarFunctions["testout_methodMulParams1"]= "void testout_methodMulParams1( [out] long rout1, [out] long rout2)"; 1463*cdf0e10cSrcweirarFunctions["testout_methodMulParams2"]= "void testout_methodMulParams2( [out] long rout1, [out] long rout2, [out] string rout3)"; 1464*cdf0e10cSrcweirarFunctions["testout_methodMulParams3"]= "void testout_methodMulParams3( [in] string sin, [out] string sout)"; 1465*cdf0e10cSrcweirarFunctions["testout_methodMulParams4"]= "void testout_methodMulParams4( [in] float in1, [out] float out1, [in] long in2, [out] long out2, [in] long in3)"; 1466*cdf0e10cSrcweirarFunctions["testinout_methodByte"]="void testinout_methodByte( [inout] byte rOut )"; 1467*cdf0e10cSrcweirarFunctions["testinout_methodFloat"]="void testinout_methodFloat( [inout] float rOut)"; 1468*cdf0e10cSrcweirarFunctions["testinout_methodDouble"]="void testinout_methodDouble( [inout] double rOut)"; 1469*cdf0e10cSrcweirarFunctions["testinout_methodBool"]="void testinout_methodBool( [inout] boolean rOut)"; 1470*cdf0e10cSrcweirarFunctions["testinout_methodShort"]="void testinout_methodShort( [inout] short rOut)"; 1471*cdf0e10cSrcweirarFunctions["testinout_methodUShort"]="void testinout_methodUShort( [inout] unsigned short rOut)"; 1472*cdf0e10cSrcweirarFunctions["testinout_methodLong"]="void testinout_methodLong( [inout] long rOut)"; 1473*cdf0e10cSrcweirarFunctions["testinout_methodULong"]="void testinout_methodULong( [inout] unsigned long rOut)"; 1474*cdf0e10cSrcweirarFunctions["testinout_methodString"]="void testinout_methodString( [inout] string rOut)"; 1475*cdf0e10cSrcweirarFunctions["testinout_methodChar"]="void testinout_methodChar( [inout] char rOut)"; 1476*cdf0e10cSrcweirarFunctions["testinout_methodAny"]="void testinout_methodAny( [inout] any rOut)"; 1477*cdf0e10cSrcweirarFunctions["testinout_methodSequence"]="void testinout_methodSequence( [inout] sequence< long > rOut)"; 1478*cdf0e10cSrcweirarFunctions["testinout_methodSequence2"]="void testinout_methodSequence2( [inout] sequence < sequence< long > > rOut)"; 1479*cdf0e10cSrcweirarFunctions["testinout_methodXInterface"]="void testinout_methodXInterface( [inout] com::sun::star::script::XInvocation rOut)"; 1480*cdf0e10cSrcweirarFunctions["testinout_methodXInterface2"]="void testinout_methodXInterface2( [inout] com::sun::star::uno::XInterface rOut)"; 1481*cdf0e10cSrcweir 1482*cdf0e10cSrcweirarFunctions["in_methodByte"]= "byte in_methodByte( [in] byte rIn )"; 1483*cdf0e10cSrcweirarFunctions["in_methodFloat"]= "float in_methodFloat( [in] float rIn);" 1484*cdf0e10cSrcweirarFunctions["in_methodDouble"]= "double in_methodDouble( [in] double rIn)"; 1485*cdf0e10cSrcweirarFunctions["in_methodBool"]= "boolean in_methodBool( [in] boolean rIn)"; 1486*cdf0e10cSrcweirarFunctions["in_methodShort"]= "short in_methodShort( [in] short rIn)"; 1487*cdf0e10cSrcweirarFunctions["in_methodUShort"]= "unsigned short in_methodUShort( [in] unsigned short rIn)"; 1488*cdf0e10cSrcweirarFunctions["in_methodLong"]= "long in_methodLong( [in] long rIn)"; 1489*cdf0e10cSrcweirarFunctions["in_methodULong"]= "unsigned long in_methodULong( [in] unsigned long rIn)"; 1490*cdf0e10cSrcweirarFunctions["in_methodHyper"]= "hyper in_methodHyper( [in] hyper rIn)"; 1491*cdf0e10cSrcweirarFunctions["in_methodUHyper"]= "unsigned hyper in_methodHyper( [in] unsigned hyper rIn)"; 1492*cdf0e10cSrcweirarFunctions["in_methodString"]= "string in_methodString( [in] string rIn)"; 1493*cdf0e10cSrcweirarFunctions["in_methodChar"]= "char in_methodChar( [in] char rIn)"; 1494*cdf0e10cSrcweirarFunctions["in_methodAny"]= "any in_methodAny ( [in] any rIn)"; 1495*cdf0e10cSrcweirarFunctions["in_methodXInterface"]= "XInterface in_methodXInterface([in] XInterface rIn)"; 1496*cdf0e10cSrcweir 1497*cdf0e10cSrcweir 1498*cdf0e10cSrcweirarFunctions["methodAnyTest1"]="any methodAnyTest1( [in] any rIn)"; 1499*cdf0e10cSrcweirarFunctions["AttrAny2"]= "[attribute] any AttrAny2"; 1500*cdf0e10cSrcweirarFunctions["retMethodStruct"]= "com::sun::star::beans::Property retMethodStruct()"; 1501*cdf0e10cSrcweirarFunctions["AttrStruct"]= "[attribute] com::sun::star::beans::Property AttrStruct"; 1502*cdf0e10cSrcweirarFunctions["methodStruct2"]= "com::sun::star::beans::Property methodStruct2( [in] com::sun::star::beans::Property aProp)"; 1503*cdf0e10cSrcweir 1504*cdf0e10cSrcweir 1505*cdf0e10cSrcweirvar factory= new ActiveXObject("com.sun.star.ServiceManager"); 1506*cdf0e10cSrcweirvar oletest= factory.createInstance("oletest.OleTest"); 1507*cdf0e10cSrcweir 1508*cdf0e10cSrcweirLog= new Logger(); 1509*cdf0e10cSrcweir 1510*cdf0e10cSrcweir 1511*cdf0e10cSrcweirrunJScriptTest(Log); 1512*cdf0e10cSrcweirrunVBTest(Log); 1513*cdf0e10cSrcweirLog.summarize(); 1514*cdf0e10cSrcweir 1515*cdf0e10cSrcweir 1516*cdf0e10cSrcweirfunction Logger() 1517*cdf0e10cSrcweir{ 1518*cdf0e10cSrcweir this.print= logger_print; 1519*cdf0e10cSrcweir this.print2= logger_print2; 1520*cdf0e10cSrcweir this.summarize= logger_summarize; 1521*cdf0e10cSrcweir this.bAllOk= true; 1522*cdf0e10cSrcweir} 1523*cdf0e10cSrcweirfunction logger_print( bool, method) 1524*cdf0e10cSrcweir{ 1525*cdf0e10cSrcweir this.print2(bool, "Ok " + arFunctions[method] + "<br>", 1526*cdf0e10cSrcweir "Failed " + arFunctions[method] + "<br>"); 1527*cdf0e10cSrcweir} 1528*cdf0e10cSrcweir 1529*cdf0e10cSrcweirfunction logger_print2( bool, okString, failedString) 1530*cdf0e10cSrcweir{ 1531*cdf0e10cSrcweir if( bool) 1532*cdf0e10cSrcweir document.writeln( okString); 1533*cdf0e10cSrcweir else 1534*cdf0e10cSrcweir { 1535*cdf0e10cSrcweir document.writeln( failedString); 1536*cdf0e10cSrcweir this.bAllOk= this.bAllOk && false; 1537*cdf0e10cSrcweir } 1538*cdf0e10cSrcweir} 1539*cdf0e10cSrcweir 1540*cdf0e10cSrcweirfunction logger_summarize() 1541*cdf0e10cSrcweir{ 1542*cdf0e10cSrcweir document.writeln("<p> ==============================================================================<br>"); 1543*cdf0e10cSrcweir if(this.bAllOk) 1544*cdf0e10cSrcweir document.writeln("No errors <br>"); 1545*cdf0e10cSrcweir else 1546*cdf0e10cSrcweir document.writeln("Error ! The test failed! <br>"); 1547*cdf0e10cSrcweir} 1548*cdf0e10cSrcweir 1549*cdf0e10cSrcweir 1550*cdf0e10cSrcweir</script> 1551*cdf0e10cSrcweir 1552*cdf0e10cSrcweir</body> 1553*cdf0e10cSrcweir</html> 1554*cdf0e10cSrcweir 1555*cdf0e10cSrcweir 1556