Microsoft KB Archive/177379

= PRB: No Error when Non-Array is Passed to Sub That Requires One =

Article ID: 177379

Article Last Modified on 12/1/2003

-

APPLIES TO

 Microsoft Internet Explorer 3.01, when used with:  Microsoft Windows NT 4.0

 Microsoft Windows 95  Microsoft Internet Explorer 3.02, when used with:  Microsoft Windows NT 4.0

 Microsoft Windows 95</li></ul> </li> Microsoft Internet Explorer 4.0 128-Bit Edition, when used with:  Microsoft Windows NT 4.0</li></ul>

 Microsoft Windows 95</li></ul> </li> Microsoft Internet Information Server 2.0</li> Microsoft Internet Information Server 3.0</li> Microsoft Internet Information Server 4.0</li></ul>

-

<div class="notice_section">

This article was previously published under Q177379

<div class="symptoms_section">

SYMPTOMS
In VBScript, when a function that is expecting an array as an argument is passed an argument that is not an array, but the function does not do any array-specific processing, no error is displayed and the function works normally.

<div class="status_section">

STATUS
This behavior is by design.

<div class="moreinformation_section">

Steps to Reproduce Behavior
The following code will not produce an error saying that an array was expected, on the statement "ArrayFunction 3." <HTML> <HEAD> <TITLE> Page1 </TITLE> </HEAD>

<BODY>

<SCRIPT LANGUAGE="VBScript">

call main

sub ArrayFunction(a) document.writeln("text") end sub

sub main ArrayFunction array(1,2) ArrayFunction 3 ' this would cause an error in VBA end sub

</SCRIPT>

</BODY>

</HTML> In VBScript, this just runs, with no error. In Visual Basic for Applications, however, you get a compile error on the line "ArrayFunction 3" saying an array was expected.

Additional query words: Error missing lacking array function

Keywords: kbprb KB177379

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.