A
abcd
this is simple VB question but its not clicking me right now...the code is
as below
Private Sub Command1_Click()
On Error Resume Next
MsgBox calculate
End Sub
Function calculate() As String
On Error GoTo errH
x = 10
y = 0
k = x / y
calculate = "successful"
Exit Function
errH:
calculate = "failed"
Err.Raise 1234, "dsfsd", "test message"
End Function
'I am expecting that calculate should return "failed" but its returning
empty,
What could be the cause...basically I want to get a value as a return value
from the error handler...
[its shame on me that I am microsoft certified in VB 6.0 (both desktop and
distributed and I can not solve this]
as below
Private Sub Command1_Click()
On Error Resume Next
MsgBox calculate
End Sub
Function calculate() As String
On Error GoTo errH
x = 10
y = 0
k = x / y
calculate = "successful"
Exit Function
errH:
calculate = "failed"
Err.Raise 1234, "dsfsd", "test message"
End Function
'I am expecting that calculate should return "failed" but its returning
empty,
What could be the cause...basically I want to get a value as a return value
from the error handler...
[its shame on me that I am microsoft certified in VB 6.0 (both desktop and
distributed and I can not solve this]