B basil99 Active Member Licensed User Longtime User May 14, 2013 #1 Hi! I have the following piece of code to detect is device internet connected: B4X: Dim i As ServerSocket If i.GetMyIp = "127.0.0.1" Then Msgbox( "You're not connected to Internet, sorry", "Network Error" ) End If I got warning on Dim i As ServerSocket - Variable 'i' was not initialized. (warning #11) Ignore it ? Thanks
Hi! I have the following piece of code to detect is device internet connected: B4X: Dim i As ServerSocket If i.GetMyIp = "127.0.0.1" Then Msgbox( "You're not connected to Internet, sorry", "Network Error" ) End If I got warning on Dim i As ServerSocket - Variable 'i' was not initialized. (warning #11) Ignore it ? Thanks
Erel B4X founder Staff member Licensed User Longtime User May 14, 2013 #2 You can either ignore it (add 'ignore comment) or you can initialize the variable. In most cases it is incorrect to use methods of an uninitialized object. However in this case it is fine. Upvote 0
You can either ignore it (add 'ignore comment) or you can initialize the variable. In most cases it is incorrect to use methods of an uninitialized object. However in this case it is fine.