sktanmoy Active Member Licensed User Longtime User Jan 23, 2013 #1 I'm trying to write a class to check if internet connection is available. Code is Code: Copy 'Class module Sub Class_Globals End Sub 'Initializes the object. You can add parameters to this method if needed. Public Sub Initialize End Sub Public Sub Status As Boolean Dim P As Phone If (P.GetDataState == "CONNECTED" ) Then Return True End If End Sub But not working while I'm trying to use it. Code: Copy Dim net As Connection If net.Status = True Then Msgbox("Connected", "") Else Msgbox("No Connection", "") End If Please help me to understand the error.
I'm trying to write a class to check if internet connection is available. Code is Code: Copy 'Class module Sub Class_Globals End Sub 'Initializes the object. You can add parameters to this method if needed. Public Sub Initialize End Sub Public Sub Status As Boolean Dim P As Phone If (P.GetDataState == "CONNECTED" ) Then Return True End If End Sub But not working while I'm trying to use it. Code: Copy Dim net As Connection If net.Status = True Then Msgbox("Connected", "") Else Msgbox("No Connection", "") End If Please help me to understand the error.
Erel B4X founder Staff member Licensed User Longtime User Jan 23, 2013 #2 You should post the error message from the logs (right click to copy it). You didn't call net.Initialize. Upvote 0
You should post the error message from the logs (right click to copy it). You didn't call net.Initialize.
sktanmoy Active Member Licensed User Longtime User Jan 23, 2013 #3 net.Initialize solved the issue. Thanks. Upvote 0