This is a discussion on calling function within the ASP Development forums, part of the Programming & Scripting category; hi i have one function which send message named sendmessage.this function returns false if sending failed.now i want to give ...
| |||||||
|
#1
| ||||
| ||||
| hi i have one function which send message named sendmessage.this function returns false if sending failed.now i want to give 3 tries to this function in case of failure.i meant this function will be called maximum three time in case of failure.and in all 3 attempts message being not send then i want to call a error routine.how to do this. Code: bReturn = SendMessage(BatchGuid, "Admin", "TR",Senderid, 1, asLines(i), Null)
If Not bReturn Then
'raise an error
mClientErrorAdd asLines(i), _
ERR_NO_GHS_MESSAGE_SEND
End If
__________________ Love is physical attraction and mental destruction Last edited by guddu; November 4th, 2008 at 03:03 PM. |
|
#2
| ||||
| ||||
| You can wrap it in a For...Next statement, checking the condition each time. For example: Code: For i = 1 To 3
bReturn = SendMessage(BatchGuid, "Admin", "TR",Senderid, 1, asLines(i), Null)
If bReturn Then
' Message was sent, exit loop
Exit For
Else
' There was an error, if 3rd attempt, call error message routine
If i = 3 Then
ERR_NO_GHS_MESSAGE_SEND
End If
End If
Next
__________________ jmurrayhead If you agree with me... click the icon! If my post solved your problem, click the button in the lower right-hand corner of the post.If you like it here...throw us a few bones to help support us. Join our Folding team: DeveloperBarn Folding |
|
#3
| ||||
| ||||
| JMH thanks a lot.did the trick. |
![]() |
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |