Place to put your Basic demos and examples

Moderator: Mmiscool

User avatar
By Reijndert
#76015 I pimped the wifi scanner code a little.
However, i'm struggling with the 'scan again' button. How do i make it refesh the screen instead of adding to it?

let quote = chr(34) 'dubbele quote

n = wifi.scan()
html "<b>"
html "Number of "& quote & "network found = "
html n
html "</b>"
html "<hr>"

html "<TABLE BORDER=" & quote & "1" & quote & ">"
html "<TR><TH>SSID</TH><TH>dBM</TH><TH>INDICATOR</TH><TH>QUALITY</TH></TR>"

html "<TR>"
for x = 1 to n

html "<TD>"
html wifi.ssid(x)
html "<TD> "
html wifi.rssi(x)

let q = wifi.rssi(x)
let r = "Amazing"

html "<TD>"
for y = q * -1 to 94
html "|"
next y

if q < -35 then
let r = "Super good"
endif

if q < -50 then
let r = "Very good"
endif

if q < -70 then
let r = "Acceptable"
endif


if q < -80 then
let r = "Not so good"
endif


if q < -90 then
let r = "<b>Unusable</b>"
endif

html "<TD>"
html r & " quality"
html "</TD>"
html "</TR>"
next x
html "</TABLE>"


button "Scan again", [DoItAgain]
wait

[DoItAgain]
run
wait
User avatar
By MegaHurtz
#81172
Reijndert wrote:However, i'm struggling with the 'scan again' button. How do i make it refesh the screen instead of adding to it?

A less elegant solution would be to simply clear the screen at button press:

Code: Select all[DoItAgain]
cls
run
wait