One of the neatest things that Matt pointed out to me was that even in Notes, I have the ability to use *any* WinAPI call, provided I include the .dll if it’s not already part of my OS. It’s just a matter of tweaking the code, parameters and data types so that LotusScript can translate it correctly.
One of the more useful calls I found was InternetGetConnectedState, which simply returns a boolean value if the code executor is online or not. Previously, I had racked my brains to come up with kludgy methods like a ping that outputs the results to a text file, and checking the text file for “reply.”
Why would you even want this? The obvious example is to give to a user before clicking button code that requires them to be online, but I found other uses for it, including:
- testing toggling between wired and wireless connections
- including in additional software packages as safeguards before other code will work successfully
To test, simply put this code in a button. Run the code, then unplug yourself and try it again.
I did find that there is a delay in re-plugging in and trying the code. For a few seconds it will still say you are offline. And, on Matt’s machine, it didn’t work at all. However, I called Matt’s machine tainted and called it a day. Experimental workstation, is not the word for it. Mad Scientist playground is more like it. He’s got more SDK’s, runtime environments, compilers, etc. etc. than I’ve ever seen. So he doesn’t count. 
‘Declarations
Declare Function InternetGetConnectedState Lib “wininet.dll” (lpdwFlags As Long, Byval dwReserved As Long) As Long
Sub Click(Source As Button)
If InternetGetConnectedState(Clng(0),0&) Then
Msgbox “You passed the Internet connectivity test! You may proceed.”
Else
Msgbox “You are not online. Please connect to the Internet and then proceed.”
End If
End Sub
After that, it’s just a matter of heading over to msdn.microsoft.com and typing in what you want to do in the search box. If it’s there, you’ll find it.