UpperLeftX = 1
UpperLeftY = 1
button #w, "Click me and view the mainwin", tick, UL, 20, 100
open "Event bug" for window as #w
wait
print "Fell through a WAIT statement: should never happen!!"
[ticktacktoock]
print "ticktacktoock"
wait
print "Fell through a WAIT statement: should never happen!!"
[secondTick]
print "secondTick"
wait
print "Fell through a WAIT statement: should never happen!!"
' LB 4.5.0 function library for LB Booster
' by Richard Russell, http://lbbooster.com
function after$(source$, match$)
i = instr(source$, match$)
if i then after$ = mid$(source$,i+len(match$))
end function
function afterlast$(source$, match$)
do : i = j
j = instr(source$, match$, j+1)
loop until j = 0
if i then afterlast$ = mid$(source$,i+len(match$))
end function
function endswith(source$, match$)
endswith = right$(source$,len(match$)) = match$
end function
function remchar$(source$, charset$)
for i = 1 to len(charset$)
do
j = instr(source$, mid$(charset$,i,1))
if j then source$ = left$(source$,j-1);mid$(source$,j+1)
loop until j = 0
next
remchar$ = source$
end function
function replstr$(source$, old$, new$)
do
i = instr(source$, old$, i+1)
if i then
source$ = left$(source$,i-1);new$;mid$(source$,i+len(old$))
i = i + len(new$) - 1
end if
loop until i = 0
replstr$ = source$
end function
function upto$(source$, match$)
i = instr(source$, match$)
if i then upto$=left$(source$,i-1) else upto$=source$
end function
function httpget$(url$)
open "WININET.DLL" for dll as #net
calldll #net, "InternetOpenA", "LB Booster" as ptr, 0 as long, _
0 as long, 0 as long, 0 as long, hnet as ulong
calldll #net, "InternetOpenUrlA", hnet as ulong, url$ as ptr, _
"" as ptr, 0 as long, 0 as long, 0 as long, hurl as ulong
buffer$ = space$(1000)
struct httpget, nread as long
do
buflen = len(buffer$)
calldll #net, "InternetReadFile", hurl as ulong, _
buffer$ as ptr, buflen as long, httpget as struct, res as long
httpget$ = httpget$ + left$(buffer$, httpget.nread.struct)
loop until httpget.nread.struct = 0
calldll #net, "InternetCloseHandle", hurl as ulong, res as long
calldll #net, "InternetCloseHandle", hnet as ulong, res as long
close #net
end function