jyothi_priya
14 years agoContributor
How to quit from a paticular script
Hi,
In the above sample example, sub routine a fails. so it should throw a message Fail and stop executing that particular sub routine. It should then execute sub routine b.
Using wscript.quit is throwing error that wscript object is required.
Can anyone tell me how to use wscript.quit?
function x(a)
If a = 2 then
msgbox "Hi"
else
nsgbox "Fail"
wscript.quit 'This is throwing error as wscript object is required
end if
end function
Sub a
call x(1)
msgbox "Pass"
end sub
sub b
call x(2)
msgbox "Pass"
end sub
Sub Main
call a
call b
End Sub
In the above sample example, sub routine a fails. so it should throw a message Fail and stop executing that particular sub routine. It should then execute sub routine b.
Using wscript.quit is throwing error that wscript object is required.
Can anyone tell me how to use wscript.quit?