Code: Select all
' ascii browser
' remake of Dav's ascii browser
' plus : only showing interesting blocks
' minus : iPad version only (Dav's : also iPhone)
'
n=10
dim from(n+1),unto(n+1)
for i=0 to n ! read from(i),unto(i) ! next i
data 32,191, 8986,9210, 9728,10175, 11013,11093
data 57345,57434, 57601,57690, 57857,57939, 58113,58189
data 58369,58444, 58625,58678, 63493,63568
set buttons font size 50
for i=0 to 9 ! for j=0 to 9
button i&j text "" at 35+70*j,60+70*i size 60,60
next j ! next i
set buttons font size 70
button "back" text "◀️" at 280,820 size 80,80
button "forw" text "▶️" at 400,820 size 80,80
set buttons font size 160
button "large" text "" at 45,770 size 180,180
field "nums" text "" at 230,10 size 400,30 RO
field "nums" font size 30
field "valu" text "" at 520,840 size 400,30 RO
field "valu" font size 30
button "large" hide ! field "valu" hide
ind=0 ! b=from(0)
do
ee=b+99 ! e=min(ee,unto(ind))
field "nums" text "from "&b&" unto "&e
for i=0 to 9 ! for j=0 to 9 ! k=b+10*i+j
if k<=e then ! button i&j text chr$(k)! button i&j show
else ! button i&j hide
end if
next j ! next i
done=0
do slowdown
if bp("forw") then
done=1
button "large" hide ! field "valu" hide
if e<unto(ind) then ! b=e+1
else ! if ind<n then ! ind+=1 ! b=from(ind) ! end if
end if
end if
if bp("back") then
done=1
button "large" hide ! field "valu" hide
if b>from(ind) then
b=max(b-100,from(ind)) ! continue
end if
if ind=0 then continue
ind-=1 ! b=max(from(ind),unto(ind)-99)
end if
for i=0 to 9 ! for j=0 to 9
if bp(i&j) then
done=1 ! k=b+10*i+j
button "large" text chr$(k) ! button "large" show
field "valu" text "value = "& k ! field "valu" show
clipboard clear ! clipboard write "chr$("&k&")"
end if
next j ! next i
until done
until forever
end
def bp(a$) = button_pressed(a$)