reflection/ macro in vbscript

Hi
From my vbscript code I need to send to external API parameters like: current line, functione, module etc.  How do I get these details?  
tlangentAsked:
Who is Participating?
 
Bill PrewCommented:
matthewspatrick may know something I don't (I know he knows a LOT I don't) on this topic, but I'm not aware of any way object or property in VBS that exposes the current line number to the program.

~bp
0
 
Patrick MatthewsCommented:
Please explain what you are trying to do.

VBScript cannot make API calls.
0
 
Bill PrewCommented:
I'm not aware of any way for an external program to interact with a running windows shell script (VBS). And even if there was a way to invoke a procedure in your code to return this type of information, at that point it would always report itself (the "api" procedure) as the location executing.

Depending on what you are trying to accomplish, the VBS script could periodically write to a text file or set a global system variable (or I guess even update a registry entry of your own) with a "bread crumb trail" of where it is executing.  But you would have to add code to your VBS script to accomplish this.

~bp
0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

 
tlangentAuthor Commented:
no matter what I am trying to do, I will phrase it anew:  Is there a way for my vbscript to tell me what line, function etc I am on ?
0
 
Patrick MatthewsCommented:
The closest you could come would be to create a "status" variable, which you periodically update to indicate what you are doing.  For example...


Dim Status
' Other Dim statements
' Const declarations

Status = "Step 1"

' do stuff

Status = "Step 2"

' do stuff

Status = "Step 3"

' do stuff

'et cetera

Open in new window


Your runtime engine will sometimes give you a line number if you have a runtime engine, of course.
0
 
tlangentAuthor Commented:
Right, there is no solution
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.