13 years ago
Calling subroutine from another script doesn't work - what do I do wrong?
Hi,
I have two vb scripts in my project, both are single subroutines and I want to call one from another. I have followed instructions from article "Calling Routines and Variables Declared in Another Unit" and set unit references from one script to another, even in both directions (so called circular references) to be perfectly sure they reference to each other. And it doesn't work, when I try to call the other sub it never goes there. Maybe I'm doing something wrong, I'm not experienced in VB Script; the code is following:
Called sub:
Sub AddTestResult(sResultType, sContentStep, sContentResult, sContentTime)
...
End Sub
Calling sub:
Sub ReadStartTime
...
Call AddTestResult ("Initial", "Test description", "passed", CStr(Now))
End Sub
or:
Sub ReadStartTime
...
AddTestResult "Initial", "Test description", "passed", CStr(Now)
End Sub
Called subroutine is not executed. I placed breakpoints in the beginning of script "AddTestResult" and it never goes there.
What is wrong?
Regards
Michal
I have two vb scripts in my project, both are single subroutines and I want to call one from another. I have followed instructions from article "Calling Routines and Variables Declared in Another Unit" and set unit references from one script to another, even in both directions (so called circular references) to be perfectly sure they reference to each other. And it doesn't work, when I try to call the other sub it never goes there. Maybe I'm doing something wrong, I'm not experienced in VB Script; the code is following:
Called sub:
Sub AddTestResult(sResultType, sContentStep, sContentResult, sContentTime)
...
End Sub
Calling sub:
Sub ReadStartTime
...
Call AddTestResult ("Initial", "Test description", "passed", CStr(Now))
End Sub
or:
Sub ReadStartTime
...
AddTestResult "Initial", "Test description", "passed", CStr(Now)
End Sub
Called subroutine is not executed. I placed breakpoints in the beginning of script "AddTestResult" and it never goes there.
What is wrong?
Regards
Michal