HighTechTalks DotNet Forums  

how to get the script function that called a non script function?

Dotnet VSA microsoft.public.dotnet.vsa


Discuss how to get the script function that called a non script function? in the Dotnet VSA forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Nolan Woods
 
Posts: n/a

Default how to get the script function that called a non script function? - 02-10-2005 , 01:12 PM






Suppose I have a VSA script (vbscript) that does a bunch of stuff, and
in the midst of that, it calls a method of some object

-------
Public Module Script
Sub DoStuff(ob as Bar) handles host.OnDoStuff

ob.Baz(7)

End Sub
--------
public class bar
{
public bar()
{
}

public Baz(int number)
{
if (number > 5) // error condition
}
}
-----------

For my error condition, I want to display a message that says where Baz
was called from (i.e., Script.DoStuff) and preferably has the line
number.

Does anyone please have any suggestions? I'm at a complete loss for how
to proceed.

Thanks,
Nolan Woods


Reply With Quote
  #2  
Old   
bruce barker
 
Posts: n/a

Default Re: how to get the script function that called a non script function? - 02-10-2005 , 01:58 PM






the exception will have the stack trace, you can use that.

-- bruce (sqlwork.com)

"Nolan Woods" <nolan.woods (AT) gmail (DOT) com> wrote

Quote:
Suppose I have a VSA script (vbscript) that does a bunch of stuff, and
in the midst of that, it calls a method of some object

-------
Public Module Script
Sub DoStuff(ob as Bar) handles host.OnDoStuff

ob.Baz(7)

End Sub
--------
public class bar
{
public bar()
{
}

public Baz(int number)
{
if (number > 5) // error condition
}
}
-----------

For my error condition, I want to display a message that says where Baz
was called from (i.e., Script.DoStuff) and preferably has the line
number.

Does anyone please have any suggestions? I'm at a complete loss for how
to proceed.

Thanks,
Nolan Woods




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.