msvisual.com Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

aScriptControl.Procedures("nonexistant") kabooooooom

 
Post new topic   Reply to topic    msvisual.com Forum Index -> OLE
Author Message
Jenda Krynicky



Joined: 04 Oct 2007
Posts: 4

PostPosted: Fri Mar 18, 2005 2:03 am    Post subject: aScriptControl.Procedures("nonexistant") kabooooooom Reply with quote

aScriptControl.Procedures("foo") returns an object (type ScriptProcedure)
for procedures that are defined within that control. Can anyone explain why
the [censored] doesn't aScriptControl.Procedures("nonexistant") return
Nothing, but instead errors out with the silly "Invalid procedure call or
argument" message? Does anyone in Microsoft ever think?

Why would I want to error out? I guess just to make the code more messy
right? So that instead of nice and clean

If Not aScriptControl.Procedures("foo") Is Nothing Then value =
aScriptControl.Run( "foo", value)

I'm supposed to write something like

On Error Goto HeyItAintThere
value = aScriptControl.Run( "foo", value)
StirTheSpaghetti:
...

HeyItAintThere:
If Err.Number = 438 Then
Err.Clear
GoTo StirTheSpaghetti
End If
TheOrdinaryErrorHandler:
other load of bull^B^B^B^BVB
End Function

Aint that sweeeeeeet?

And no I do not expect any reply. Just like I do not expect the VB/COM/.Net
Framework objects to behave sanely.

Jenda
P.S.: I'd also like to meet the guy who decided that VB will evaluate
conditions fully.
While (Not rst.EOF and rst.Fields("Type").Value = 1)
Hey, don't be silly, that'd be too simple, dude!

Archived from group: microsoft>public>vb>ole
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    msvisual.com Forum Index -> OLE All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group