This snippet shows how to use wininet.dll (a Windows system DLL) to check if your user's computer has an internet connection.
Note that you should NOT use it in a loop as I have done. If a connection doesn't exist, it will block your program for about 15 seconds while it times out.
set window on
set display mode 640,480,32
load dll "wininet",1
do
cls
conn = InternetConnected()
if conn
print "Connected"
else
print "Not Connected"
endif
anim$ = anim$ + "."
if len(anim$) > 15 then anim$ = ""
print anim$
loop
function InternetConnected()
local ret
ret = call dll(1,"InternetCheckConnectionA","http://www.google.com",1,0)
endfunction ret