Re: What is wrong with this method invocation?
Giovanni Dicanio <email@example.com> wrote:
"Igor Tandetnik" <firstname.lastname@example.org> ha scritto nel messaggio
VBScript only supports VARIANT* for [in, out] parameters [...]
Unlike VB, which can handle any automation type.
So, as a summary, is the following correct?
1. With Visual Basic 6 and VBA:
we can use any automation type, both as [in] and as [in, out]
parameters; we can use any automation type also as [out, retval]
2. With VBScript:
we can use any automation type as [in] parameters and [out, retval]
parameter; we must use VARIANT* for [in, out] parameters.
parameters at all ([out, retval] works for any type).
If this summary is correct, is any technical reason for this
limitation of VBScript?
From the horse's mouth:
IMHO, I think that we should use VARIANT as less as possible, because
this prevents IntelliSense. Is this correct?
There's no IntelliSense for VBScript, as far as I can tell. VBScript
does not read type libraries and does not know method signatures at
design time (nor really at run time - it just throws the values over to
IDispatch::Invoke and hopes for the best).
With best wishes,
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925