Huh. Good to know. Thanks for testing that out.
Steve
On 5/11/2010 12:09 PM, Jamal Mazrui wrote:
A reasonable hypothesis, but unlike VB.NET, VBScript does not support
overloads of functions with the same name but different parameter
signatures. I just tried defining two functions called Test, the
first with one parameter and the second with two parameters. A "wrong
number of parameters" error results if the first one is called, so
evidently only the last function defined is available to code.
Jamal
On Tue, 11 May 2010, Stephen Clower wrote:
Date: Tue, 11 May 2010 11:54:28 -0400
From: Stephen Clower <[email protected]>
Reply-To: [email protected]
To: [email protected]
Subject: Re: xml listview dialog
VBScript may think you're trying to overload the dialog proc which is
why it isn't throwing the error.
Steve
On 5/11/2010 10:11 AM, Jamal Mazrui wrote:
One would think that the "Option Explicit" statement raises an error
from a duplicate function name. It does not seem to do so, however,
e.g., with the code below. Instead, the last function defined is
the one run. On the other hand, a duplicate "Dim" statement results
in a "name redefined" error even without "Option Explicit." The
suggestion is still a good one though.
Jamal
Option Explicit
Function Test()
WScript.Echo "Function 1"
End Function
Function Test()
WScript.Echo "Function 2"
End Function
Test
-----Original Message-----
From: Aaron Smith [mailto:[email protected]]
Sent: Monday, May 10, 2010 10:04 PM
To: [email protected]
Subject: Re: xml listview dialog
On 5/10/2010 3:08 PM, Jeff Weiss wrote:
Function DialogEventHandler(dObj, dEvent, dId, dControl)
Just at first glance, you have this function defined twice. I would
strongly recommend adding:
Option Explicit
at the top of your code to weed out these kinds of errors.
Aaron
--
Aaron Smith
Product Support Specialist * Web Development GW Micro, Inc. * 725
Airport North Office Park, Fort Wayne, IN 46825
260-489-3671 * gwmicro.com
To insure that you receive proper support, please include all past
correspondence (where applicable), and any relevant information
pertinent to your situation when submitting a problem report to the
GW Micro Technical Support Team.