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