Practical example from perplexity.ai (distant cousin of chatgpt):
https://www.perplexity.ai/search/8a97b6 ... 1010ea?s=u
Code: Select all
#include once "windows.bi"
Dim hClient As HANDLE
Dim pInterfaceList As PWLAN_INTERFACE_INFO_LIST
Dim pNetworkList As PWLAN_AVAILABLE_NETWORK_LIST
Dim dwResult As DWORD
' Open a handle to the wireless interface
dwResult = WlanOpenHandle(1, 0, hClient, @pInterfaceList)
If dwResult <> ERROR_SUCCESS Then
Print "Error opening handle to wireless interface"
End
End If
' Enumerate the wireless interfaces
dwResult = WlanEnumInterfaces(hClient, 0, @pInterfaceList)
If dwResult <> ERROR_SUCCESS Then
Print "Error enumerating wireless interfaces"
End
End If
' Get the list of available wireless networks
dwResult = WlanGetAvailableNetworkList(hClient, pInterfaceList(0).InterfaceGuid, 0, 0, @pNetworkList)
If dwResult <> ERROR_SUCCESS Then
Print "Error getting list of available wireless networks"
End
End If
' Print the list of available wireless networks
For i As Integer = 0 To pNetworkList.dwNumberOfItems - 1
Print "SSID: " & pNetworkList.Network[i].dot11Ssid.ucSSID
Print "Signal quality: " & pNetworkList.Network[i].wlanSignalQuality
Print "Security: " & pNetworkList.Network[i].dot11DefaultAuthAlgorithm
Next
' Clean up
WlanFreeMemory(pNetworkList)
WlanCloseHandle(hClient, 0)
Good luck getting it to run...
Intriguing check the sources it does seem to 'deduce'
also, given that it is deducing, it assumes
#include once "windows.bi"
has the the necessary bindings, given that it has an concept
of bindings, .... amusing but understandable.
On a side note 'WlanEnumInterfaces' does pop up
in libwlanapi.dll.a (32bit / 64bit versions) bundled
with freebasic 1.09.0 but the are no bindings
aka .bi file(s).
Now if somebody can 'AI' a nice working 'chicken translator'
from .h to .bi (and no, none of the existing apps really
cut it) maybe we can start seeing the merits of an
language based model AI or AGI with regard to programing
in freebasic.
Wait I'll up the ante parse the web page:
https://learn.microsoft.com/en-us/windo ... i/wlanapi/
and generate an .bi nice and current
Bye the bye:
https://en.wikipedia.org/wiki/Perplexity
'In information theory, perplexity is a measurement of how well a
probability distribution or probability model predicts a sample.
It may be used to compare probability models.
A low perplexity indicates the probability distribution is
good at predicting the sample.'