469,315 Members | 2,238 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,315 developers. It's quick & easy.

Bugs in VBScript GetRef()

Does anyone know if there are bugs in VBScript's GetRef()? I'm using
VBScript Version 5.6.8515 on Win2003Server w/ASP.

Sometimes it returns an object that VarType() says is a vbObject. Other
times it returns VarType() is vbEmpty. This is driving me mad!

Also, does anyone know what the properties and methods are for the object
returned by GetRef()?

TIA.

-Mike
Jul 19 '05 #1
16 8956
Hi Mike,

Thank you for using the community. From your description, the function
GetRef() returns incorrect result vbEmpty randomly and you suspect this may
be bug. I search in the database, but I haven't found this is a known bug,
and there isn't a similar one also. As we know function GetRef() will
return a reference to a function based a name string. When it return
vbEmpty, it mean it failed to find the function. I suggest you may double
check the parameter string you passed into GetRef(), to see if there is
such a function in current module.

If you found a solid way to reproduce the problem, please let me know. With
these information, we can perform deep research on the issue to see if it
is bug.

Regards,

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Jul 19 '05 #2
Mike Schinkel wrote:
Does anyone know if there are bugs in VBScript's GetRef()? I'm using
VBScript Version 5.6.8515 on Win2003Server w/ASP.

Sometimes it returns an object that VarType() says is a vbObject.
Other times it returns VarType() is vbEmpty. This is driving me mad!

Show us how to reproduce the problem. This has never happened to me.
Also, does anyone know what the properties and methods are for the
object returned by GetRef()?

Does GetRef even work in server-side code? You may want to pose this
question in m.p.scripting.vbscript. It's a little OT for this newsgroup.
You'll be more likely to find the vbscript experts over there.

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 19 '05 #3
Luke:
I figured it out. GetRef() is one screwed up function! Assume the following ASP file (it is documented for what happens. After the file I'll explain in english):

<%
'------------------------------------------------------------------------------------
'The following code outputs the following:
'In FooBar
'0
'Object
'9
'Object
'HowDy
'In FooBar#2
Dim subref

Set subref= GetRef( "FooBar" )
Response.Write VarType(subref)& "<br>" '-- Executes FooBar writing "In FooBar", then writes "0"
'-- vbEmpty is 0
Response.Write TypeName(subref)& "<br>" '-- Writes "Object"

Set subref= GetRef( "FooBar2" )
Response.Write VarType(subref)& "<br>" '-- Writes "9" -- vbObject is 9
Response.Write TypeName(subref)& "<br>" '-- Writes "Object"
subref("Howdy") '-- Executes FooBar2, writes "Howdy" then "In FooBar#2"
Sub FooBar()
Response.Write "In FooBar<br>"
End Sub

Sub FooBar2(x)
Response.Write x & "<br>"
Response.Write "In FooBar#2<br>"
End Sub
'------------------------------------------------------------------------------------
%>

Basically, if you assign subref= GetRef("NoParamSub") to where NoParamSub is a Sub with no parameters, then accessing it by passing it to VarType() executes the sub, and the return value of the sub returns is interpretted as zero, which is why VarType(subref) returns 0.

Basically, if you assing subref= GetRef("HasParamsSub") to whereHasParamsSub is a Sub with one or more parameters, then passing it is passed to VarType() as an object and VarType(subref) returns 9 (9 is the value of vbObject).

Passing subref for both NoParamSub and HasParamsSub to TypeName() returns "Object", which is what I'll have to use. I'd like to see VarType() fixed to return 9 for VarType(GetRef("NoParamSub")), but I won't hold my breath.

BASICALLY, what I REALLY need is the following set of routines in vbscript:

IsSub() '-- Tells me if a sub exists in global namespace
IsFunction() '-- Tells me if a function exists in global namespace
IsMethod() '-- Tells me if a sub or function exists for an object
IsProperty() '-- Tells me if a property exists for an object
ParameterCount() '-- Tells me how many parameters a sub or function has defined
Parameters() '-- Returns list of parameter names for given sub or function
IsFunction() '-- Tells me if a function exists in global namespace
CallByName() '-- Lets me execute a sub or function by name with optional parameters
CallStack() '-- Returns array objects where the objects have Source File and Line Number of calling programs

How can I get each of these features? Are any in VBScript and I just don't know how?

Also, what does the object returned by GetRef look like? Does it have properties or methods?

TIA.

-Mike
P.S. If you can forward this to Eric Lippert, it would be greatly appreciated.

"[MSFT]" <lu******@online.microsoft.com> wrote in message news:eK**************@cpmsftngxa06.phx.gbl...
Hi Mike,

Thank you for using the community. From your description, the function
GetRef() returns incorrect result vbEmpty randomly and you suspect this may
be bug. I search in the database, but I haven't found this is a known bug,
and there isn't a similar one also. As we know function GetRef() will
return a reference to a function based a name string. When it return
vbEmpty, it mean it failed to find the function. I suggest you may double
check the parameter string you passed into GetRef(), to see if there is
such a function in current module.

If you found a solid way to reproduce the problem, please let me know. With
these information, we can perform deep research on the issue to see if it
is bug.

Regards,

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Jul 19 '05 #4
Bob:

Thanks for the reply. Forgive my density, but what does "OT" mean?
Also, can you please review my reply to Luke on this thread? Let me know if
you have any insight. Thanks in advance.

-Mike
"Bob Barrows" <re******@NOyahoo.SPAMcom> wrote in message
news:eB**************@TK2MSFTNGP10.phx.gbl...
Mike Schinkel wrote:
Does anyone know if there are bugs in VBScript's GetRef()? I'm using
VBScript Version 5.6.8515 on Win2003Server w/ASP.

Sometimes it returns an object that VarType() says is a vbObject.
Other times it returns VarType() is vbEmpty. This is driving me mad!


Show us how to reproduce the problem. This has never happened to me.
Also, does anyone know what the properties and methods are for the
object returned by GetRef()?

Does GetRef even work in server-side code? You may want to pose this
question in m.p.scripting.vbscript. It's a little OT for this newsgroup.
You'll be more likely to find the vbscript experts over there.

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Jul 19 '05 #5
Mike Schinkel wrote:
Bob:

Thanks for the reply. Forgive my density, but what does "OT" mean?
OT = Off Topic
ASP is server-side technology. GetRef is a function I've only used in
client-side code so I don't even know if it does anything if run on the
server ... although I guess there's no reason it wouldn't work in
server-side code. Nevertheless, this is a question the experts in
..scripting.vbscript will be better able to answer.

Also, can you please review my reply to Luke on this thread? Let me
know if you have any insight. Thanks in advance.

Let's continue this in the thread you started in .scripting.vbscript. I will
look at it tomorrow in case nobody has answered you before then. FWIW, the
only use I have made of this function is to bind subs and functions to
objects' event properties.

Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 19 '05 #6
Thanks for the reply.

I would say it actually isn't off topic as I need the functionality
specifically for ASP and have absolutely zero percent interest in using it
within IE.
I did post a similar message other there in case someone w/expertise had
some knowledge of GetRef().

Basically I have VBScript classes, each with a name property, and want to be
able to optionally execute "events" (applying a standard term in my own
context). I can do the following within a method:

On Error Resume Next
Execute (Me.Name & "_" & strEventName )
On Error Goto 0

But the huge problem with that is if I have a code error in my event it
doesn't throw an error making debugging next to impossible. I want to be
able to do the following

If IsRequired And Not IsSub(strEventName) Then
ThrowError "Event [" & strEventName & "] was expected but not
found."
DumpCallStack
ElseIf IsSub(strEventName) Then
Execute (strEventName)
End If

As is, I'm having a really difficult time doing what I need to do. W/o
these capabilities it is very hard do implement reusable classes in
VBScript. I know I could do in ASP.NET, but for many reasons that isn't
viable for us right now.

-Mike

"Bob Barrows" <re******@NOyahoo.SPAMcom> wrote in message
news:us**************@TK2MSFTNGP11.phx.gbl...
Mike Schinkel wrote:
Bob:

Thanks for the reply. Forgive my density, but what does "OT" mean?
OT = Off Topic
ASP is server-side technology. GetRef is a function I've only used in
client-side code so I don't even know if it does anything if run on the
server ... although I guess there's no reason it wouldn't work in
server-side code. Nevertheless, this is a question the experts in
.scripting.vbscript will be better able to answer.

Also, can you please review my reply to Luke on this thread? Let me
know if you have any insight. Thanks in advance.

Let's continue this in the thread you started in .scripting.vbscript. I

will look at it tomorrow in case nobody has answered you before then. FWIW, the
only use I have made of this function is to bind subs and functions to
objects' event properties.

Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Jul 19 '05 #7
Hi Mike,

The features you listed didn't included in VBscript currently. If you
really need them, you take a look at script hosting technology or consider
migrating to .NET and achieve them with Reflection.

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Jul 19 '05 #8
Thanks.
The plan is ultimately to move to .NET, but our team just isn't ready yet
for many reasons.
Not the least is Whidbey is much better than current, and we want to wait
for that.

Will VBScript be updated at all? Any chance those functions might find
their way into VBScript (I know you can't answer, but you could pass on to
the people who could.)

-Mike
"[MSFT]" <lu******@online.microsoft.com> wrote in message
news:fh*************@cpmsftngxa06.phx.gbl...
Hi Mike,

The features you listed didn't included in VBscript currently. If you
really need them, you take a look at script hosting technology or consider
migrating to .NET and achieve them with Reflection.

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Jul 19 '05 #9
Mike Schinkel wrote:
Thanks for the reply.

I would say it actually isn't off topic as I need the functionality
specifically for ASP
:-)
Everyone says this. " ... I'm creating a .asp page so my question must be on
topic for this asp newsgroup ... " The issue of course is: there are a great
number of things that can happen on a .asp page that have absolutely nothing
to do with ASP.

The litmus test for topicality is: are you asking about server-side or
client-side code? Server-side code questions will always be on topic.
Client-side code questions may be on topic if they are related to the
submission of forms to an ASP server-side page (border-line: this code can
be written and run in a .htm page - but creation of querystrings in
client-side code will usually be dealt with here).
and have absolutely zero percent interest in
using it within IE.


If by this, you mean you are asking about using server-side code, then of
course your question is on-topic. :-)

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 19 '05 #10
Yes, I specifically want to use GetRef() in a server context, NOT a client
context. Since GetRef() is documented for IE but seems to work (somewhat)
for ASP, here seemed the logical place to discuss it...

-Mike

"Bob Barrows" <re******@NOyahoo.SPAMcom> wrote in message
news:em*************@TK2MSFTNGP12.phx.gbl...
Mike Schinkel wrote:
Thanks for the reply.

I would say it actually isn't off topic as I need the functionality
specifically for ASP
:-)
Everyone says this. " ... I'm creating a .asp page so my question must be

on topic for this asp newsgroup ... " The issue of course is: there are a great number of things that can happen on a .asp page that have absolutely nothing to do with ASP.

The litmus test for topicality is: are you asking about server-side or
client-side code? Server-side code questions will always be on topic.
Client-side code questions may be on topic if they are related to the
submission of forms to an ASP server-side page (border-line: this code can
be written and run in a .htm page - but creation of querystrings in
client-side code will usually be dealt with here).
and have absolutely zero percent interest in
using it within IE.


If by this, you mean you are asking about using server-side code, then of
course your question is on-topic. :-)

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Jul 19 '05 #11
Mike Schinkel wrote:
Yes, I specifically want to use GetRef() in a server context, NOT a
client context. Since GetRef() is documented for IE but seems to
work (somewhat) for ASP, here seemed the logical place to discuss
it...

You were right. However, being an ASP "expert" is not the same as being a
vbscript "expert", which is why I suggested the scripting group. It seems
you've gotten some more definitive answers in the scripting group. Joe and
Al know their stuff. I'm sure if they've left anything out, Michael Harris
will chime in.

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 19 '05 #12
With Joe's inspiration, I figured out one of my problems. I'll bet I might
be the first to have figured this out and posted it online (as I searched
exhaustively for references to GetRef() and found almost nothing.) I am
totally psyched to have figured this out!:

(Yes I know that both IsFunction() and IsSub() are identical.):

<%

Response.Write IsFunction( "MyFunc0" ) & "<br>" '-- Prints True
Response.Write IsFunction( "MyFunc1" ) & "<br>" '-- Prints True
Response.Write IsSub( "MySub0" )& "<br>" '-- Prints True
Response.Write IsSub( "MySub0" )& "<br>" '-- Prints True

Response.Write IsFunction( "NotAFunction" ) & "<br>" '-- Prints False
Response.Write IsSub( "NotASub" ) & "<br>" '-- Prints False
Function IsFunction( funcname )
On Error Resume Next
IsFunction= IsObject(GetRef( funcname ))
If Err.Number<>0 Then
IsFunction= False
End If
On Error Goto 0
End Function

Function IsSub( subname )
On Error Resume Next
IsSub= IsObject(GetRef( subname ))
If Err.Number<>0 Then
IsSub= False
End If
On Error Goto 0
End Function

Function MyFunc0()
Response.Write "In MyFunc0<br>"
MyFunc0= 10
End Function

Function MyFunc1(x)
Response.Write "In MyFunc1<br>"
MyFunc1= x
End Function

Sub MySub0()
Response.Write "MySub0<br>"
End Sub

Sub MySub1(x)
Response.Write x & "<br>"
Response.Write "In MySub1<br>"
End Sub

%>

Maybe it is worth a reference in ASPFAQ?

-Mike

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:uH**************@tk2msftngp13.phx.gbl...
Mike Schinkel wrote:
Yes, I specifically want to use GetRef() in a server context, NOT a
client context. Since GetRef() is documented for IE but seems to
work (somewhat) for ASP, here seemed the logical place to discuss
it...

You were right. However, being an ASP "expert" is not the same as being a
vbscript "expert", which is why I suggested the scripting group. It seems
you've gotten some more definitive answers in the scripting group. Joe and
Al know their stuff. I'm sure if they've left anything out, Michael Harris
will chime in.

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Jul 19 '05 #13
Hi Mike,

I will record your suggestions. And you also can submit your suggestions
via:

http://register.microsoft.com/mswish/suggestion.asp

Regards,

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Jul 19 '05 #14
Mike Schinkel wrote:
With Joe's inspiration, I figured out one of my problems. I'll bet I
might be the first to have figured this out and posted it online (as
I searched exhaustively for references to GetRef() and found almost
nothing.) I am totally psyched to have figured this out!:

(Yes I know that both IsFunction() and IsSub() are identical.):

<%

Response.Write IsFunction( "MyFunc0" ) & "<br>" '-- Prints True
Response.Write IsFunction( "MyFunc1" ) & "<br>" '-- Prints True
Response.Write IsSub( "MySub0" )& "<br>" '-- Prints True
Response.Write IsSub( "MySub0" )& "<br>" '-- Prints True

Response.Write IsFunction( "NotAFunction" ) & "<br>" '-- Prints False
Response.Write IsSub( "NotASub" ) & "<br>" '-- Prints False
Function IsFunction( funcname )
On Error Resume Next
IsFunction= IsObject(GetRef( funcname ))
If Err.Number<>0 Then
IsFunction= False
End If
On Error Goto 0
End Function

Function IsSub( subname )
On Error Resume Next
IsSub= IsObject(GetRef( subname ))
If Err.Number<>0 Then
IsSub= False
End If
On Error Goto 0
End Function

Function MyFunc0()
Response.Write "In MyFunc0<br>"
MyFunc0= 10
End Function

Function MyFunc1(x)
Response.Write "In MyFunc1<br>"
MyFunc1= x
End Function

Sub MySub0()
Response.Write "MySub0<br>"
End Sub

Sub MySub1(x)
Response.Write x & "<br>"
Response.Write "In MySub1<br>"
End Sub

%>

Maybe it is worth a reference in ASPFAQ?

-Mike

Very cool!

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 19 '05 #15
"Mike Schinkel" <mi***@xtras.com> wrote in message
news:uA**************@tk2msftngp13.phx.gbl...
With Joe's inspiration, I figured out one of my problems. I'll bet I might be the first to have figured this out and posted it online (as I searched exhaustively for references to GetRef() and found almost nothing.) I am totally psyched to have figured this out!:

(Yes I know that both IsFunction() and IsSub() are identical.):

<%

Response.Write IsFunction( "MyFunc0" ) & "<br>" '-- Prints True
Response.Write IsFunction( "MyFunc1" ) & "<br>" '-- Prints True
Response.Write IsSub( "MySub0" )& "<br>" '-- Prints True
Response.Write IsSub( "MySub0" )& "<br>" '-- Prints True

Response.Write IsFunction( "NotAFunction" ) & "<br>" '-- Prints False
Response.Write IsSub( "NotASub" ) & "<br>" '-- Prints False
Function IsFunction( funcname )
On Error Resume Next
IsFunction= IsObject(GetRef( funcname ))
If Err.Number<>0 Then
IsFunction= False
End If
On Error Goto 0
End Function

Function IsSub( subname )
On Error Resume Next
IsSub= IsObject(GetRef( subname ))
If Err.Number<>0 Then
IsSub= False
End If
On Error Goto 0
End Function

Function MyFunc0()
Response.Write "In MyFunc0<br>"
MyFunc0= 10
End Function

Function MyFunc1(x)
Response.Write "In MyFunc1<br>"
MyFunc1= x
End Function

Sub MySub0()
Response.Write "MySub0<br>"
End Sub

Sub MySub1(x)
Response.Write x & "<br>"
Response.Write "In MySub1<br>"
End Sub

%>


Mike-

Have you considered looking to JScript to achieve some of the reflective
features your looking for.

IsFunction = typeof function
IsProperty = object.hasOwnProperty(proName)
IsMethod = Use object.hasOwnProperty AND typeof object.property
ParameterCount = function.length
Parameters = function.arguments
CallByName = JScript supports optional parameters
CallStack = function.caller
Global Namespace = intrinsic global object

I'm not recommending that you rewrite your existing code. However, you
could create JScript wrappers for your VBScript classes so you could
make use of the above. Also, you may consider creating a generic wrapper
for all VBScript classes. Since JScript allows you to enumerate objects,
you could pass in a VBScript class instance to the generic wrapper which
would dynamically "implement" the class. Here's a proof of concept on
enumerating a VBScript class instance.

<script language="VBScript" runat="SERVER">
Class foo
Public x
Function init()
x = 123
End Function
End Class

Dim f
Set f = New foo
f.init()
enumerate(f)
</script>

<script language="JScript" runat="SERVER">
function enumerate(obj){
var i;
for(i in obj){
Response.Write(i + ":" + (typeof obj[i]) + "<br>");
}
}
</script>

The typeof call will return "Unknown" for VBScript functions/subs since
it has no idea what a VBScript function is (nor should it). You could
replace the typeof call with the VBScript functions you've developed. I
was reluctant to send this reply since I am certain there are
considerable performance issues related to burdening ASP with this
additional abstraction layer. As such, dynamically implementing the
VBScript class is left as an exercise for the reader. :) I would
strongly suggest you rethink your class execution model. I remain
convinced that attempting to carrying over the VBA event/messaging model
to VBScript is inappropriate due to the stateless nature of the ASP. In
layman's terms, ASP should not be expected to handle OnClick. Could you
provide some more specifics on the class model? Perhaps someone here
could offer an alternative that avoids the above chaos.

HTH
-Chris Hohmann

Jul 19 '05 #16
Chris:

Thanks! I had briefly thought about that, but no so absolutely little about
JScript I figured it would take too long to learn it well enough to get what
I needed. Your list below provides food for thought. However, I would
agree to be somewhat concerned about performance issues, and the fact that
JScript can't natively see VBScript functions/sub as you say makes it less
appealing.

As for performance, I've already decided we'll implement a caching system so
performance isn't an issue so much as fast implementation, maintainability,
robustness, and composability.

As for not needing events, you are thinking events to be like the are
commonly used i.e. OnClick, not have the can be used in all cases. For
example, let's assume you have a communications component; it might have an
"OnBytesReceived" event. In my case I've attached a script I wrote that
uses one event called PagePartClass. It lets someone define a simple
"PagePart" for our website (you can see this code live in action on our home
page at http://www.xtras.net)

The PagePart is a class with properties like Name, Title, HeadClass,
ImageUrl, Text, etc. If "Text" is not empty, it displays the value in the
Text property. If Text IS empty, it concatonates the value in Name to
"_ShowText" and calls that Sub (i.e. Sub ppLeadingVendors_ShowText). And it
works GREAT.

The problems I was trying to solve was not in the example but in some much
more complex code where I have events like "_BeforeRecordAdd" and
"_AfterRecordAdd" that I only want to run if they exist. If they don't
exist, I don't want them to run, but if they do exist I want to run with w/o
ON ERROR RESUME NEXT in force. Further, I would like to be able to display
an error message prior to calling like the following
"MyModule_BeforeRecordAdd expected two parameters but none were passed." As
it, I get a cryptic error message that requires a lot of time to trace.

Of course if we switch to ASP.NET, I'll have none of these problems, just
not ready to do that yet. :-)

-Mike


"Chris Hohmann" <no****@thankyou.com> wrote in message
news:eu**************@TK2MSFTNGP12.phx.gbl...

Mike-

Have you considered looking to JScript to achieve some of the reflective
features your looking for.

IsFunction = typeof function
IsProperty = object.hasOwnProperty(proName)
IsMethod = Use object.hasOwnProperty AND typeof object.property
ParameterCount = function.length
Parameters = function.arguments
CallByName = JScript supports optional parameters
CallStack = function.caller
Global Namespace = intrinsic global object

I'm not recommending that you rewrite your existing code. However, you
could create JScript wrappers for your VBScript classes so you could
make use of the above. Also, you may consider creating a generic wrapper
for all VBScript classes. Since JScript allows you to enumerate objects,
you could pass in a VBScript class instance to the generic wrapper which
would dynamically "implement" the class. Here's a proof of concept on
enumerating a VBScript class instance.

<script language="VBScript" runat="SERVER">
Class foo
Public x
Function init()
x = 123
End Function
End Class

Dim f
Set f = New foo
f.init()
enumerate(f)
</script>

<script language="JScript" runat="SERVER">
function enumerate(obj){
var i;
for(i in obj){
Response.Write(i + ":" + (typeof obj[i]) + "<br>");
}
}
</script>

The typeof call will return "Unknown" for VBScript functions/subs since
it has no idea what a VBScript function is (nor should it). You could
replace the typeof call with the VBScript functions you've developed. I
was reluctant to send this reply since I am certain there are
considerable performance issues related to burdening ASP with this
additional abstraction layer. As such, dynamically implementing the
VBScript class is left as an exercise for the reader. :) I would
strongly suggest you rethink your class execution model. I remain
convinced that attempting to carrying over the VBA event/messaging model
to VBScript is inappropriate due to the stateless nature of the ASP. In
layman's terms, ASP should not be expected to handle OnClick. Could you
provide some more specifics on the class model? Perhaps someone here
could offer an alternative that avoids the above chaos.

HTH
-Chris Hohmann




Jul 19 '05 #17

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Michael L. | last post: by
29 posts views Thread by Christopher Brandsdal | last post: by
15 posts views Thread by Laser Lu | last post: by
14 posts views Thread by Jon Maz | last post: by
6 posts views Thread by rishabhshrivastava | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.