RosettaCodeData/Task/HTTP/M2000-Interpreter/http.m2000
2026-04-30 12:34:36 -04:00

29 lines
890 B
Text

Module CheckIt {
Declare xml "Microsoft.XMLHTTP"
const testUrl$ = "http://httpforever.com/"
With xml, "readyState" as ReadyState
Method xml "Open", "Get", testUrl$, True ' True means Async
Method xml "send"
\\ We set a thread to count time
k=0
Thread {
k++
} as TimeOut interval 100
\\ In main thread we can check ReadyState and Mouse button
Task.Main 100 {
Print ReadyState
If ReadyState=4 then exit
if k>20 then exit ' 20*100= 2 sec
if mouse then exit ' exit if mouse click
}
\\ So now we can read
if ReadyState=4 then {
With xml, "responseText" AS AA$
\\ break AA$ to lines
Document BB$=AA$
\\ using line breaks as CRLF
Report BB$
}
Declare xml Nothing
}
CheckIt