memclear
cls
button "Set Wifi Settings", [WifiSettings]
button "End Program", [endprog]
wprint "<br> <br>"
wait
[WifiSettings]
listWifis$ = ""
n = wifi.scan()
n = n - 1
wprint "Number of network found = "
wprint n
for x = 1 to n
listWifis$ = listWifis$ & wifi.ssid(x)
listWifis$ = listWifis$ & ","
next x
serialprint listWifis$
wprint "<br>Select SSID: "
dropdown listWifis$, selectedWifi
wprint "<br>Password: "
passwordbox networkPW
wprint "<br>"
button "Connect To Wifi", [connectWifi]
wprint "<br> <br>"
wprint "Standalone Access Point (AP) without connecting to your wifi use this! <br> <br> Enter AP Name: "
textbox networkSSID
wprint "<br>Enter AP Password: "
passwordbox networkPWap
wprint "<br>"
button "Start AP", [StartAP]
wprint "<br>"
wait
[StartAP]
WiFioff
bla = wifi.ap(networkSSID,networkPWap)
wait
[connectWifi]
WiFioff
bla2 = wifi.connect(selectedWifi,networkPW)
wait
[endprog]
end
Moderator: Mmiscool
for x = 1 to n
listWifis$ = listWifis$ & wifi.ssid(x)
listWifis$ = listWifis$ & ","
next x
The problem is in Line 3.
The result of the growing string would contain the sign "," at the end.
The "," should separate the items between. But you have also such a character at the end, not followed by an item.
Thanks for the help Edi!
memclear
cls
button "Set Wifi Settings", [WifiSettings]
button "End Program", [endprog]
wprint "<br> <br>"
wait
[WifiSettings]
listWifis = ""
n = wifi.scan()
n = n - 1
wprint "Number of network found = "
wprint n
for x = 1 to n
listWifis = listWifis & wifi.ssid(x)
listWifis = listWifis & ","
next x
testn = len(listWifis)
testn = testn - 1
listWifis = left(listWifis,testn)
serialprint listWifis
wprint "<br>Select SSID: "
dropdown selectedWifi,listWifis
wprint "<br>Password: "
passwordbox networkPW
wprint "<br>"
button "Connect To Wifi", [connectWifi]
wprint "<br> <br>"
wprint "Standalone Access Point (AP) without connecting to your wifi use this! <br> <br> Enter AP Name: "
textbox networkSSID
wprint "<br>Enter AP Password: "
passwordbox networkPWap
wprint "<br>"
button "Start AP", [StartAP]
wprint "<br>"
wait
[StartAP]
WiFioff
bla = wifi.ap(networkSSID,networkPWap)
wait
[connectWifi]
WiFioff
bla2 = wifi.connect(selectedWifi,networkPW)
wait
[endprog]
end