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