layer Posted March 1, 2005 Share Posted March 1, 2005 (edited) hey, i was using the Ping function and im a little unsure of how to get the extended info with @error... could someone give me an example of how to do this?From helpfile:When the function fails (returns 0) @error contains extended information: 1 = Host is offline 2 = Host is unreachable 3 = Bad destination 4 = Other errorsid like to know how to do that.. thanks! Edited March 1, 2005 by layer FootbaG Link to comment Share on other sites More sharing options...
MHz Posted March 1, 2005 Share Posted March 1, 2005 Some examples for you: $result = Ping("www.hiddensoft.com",250) If $result = 1 Then MsgBox(0, 'Error', 'host is not pingable or other network errors occured and sets @error') If $result = 0 Then MsgBox(0, 'Success', 'Returned the roundtrip-time in milliseconds: ' & $result) If @error = 1 Then MsgBox(0, 'Error', 'Host is offline') If @error = 2 Then MsgBox(0, 'Error', 'Host is unreachable') If @error = 3 Then MsgBox(0, 'Error', 'Bad destination') If @error = 4 Then MsgBox(0, 'Error', 'Other errors') If @error Then MsgBox(0, 'Error', 'Unknown error') If Not @error Then MsgBox(0, 'Success', 'Host has been pinged') Just pick 1, or 2 or.... Link to comment Share on other sites More sharing options...
layer Posted March 1, 2005 Author Share Posted March 1, 2005 thanks MHz! just what i was looking for! i can always count on you FootbaG Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now