Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,56 @@
nomainwin
textbox #demo.val, 20, 50, 90, 24
button #demo.inc, "Increment", [btnIncrement], UL, 20, 90, 90, 24
button #demo.rnd, "Random", [btnRandom], UL, 20, 120, 90, 24
open "Rosetta Task: GUI component interaction" for window as #demo
#demo "trapclose [quit]"
validNum$ = "0123456789."
#demo.val 0
wait
[quit]
close #demo
end
[btnIncrement]
#demo.val "!contents? nVal$"
nVal$ = trim$(nVal$)
if left$(nVal$, 1) = "-" then
neg = 1
nVal$ = mid$(nVal$, 2)
else
neg = 0
end if
validNum = 1
nDecs = 0
for i = 1 to len(nVal$)
if instr(validNum$, mid$(nVal$, i, 1)) = 0 then
validNum = 0
end if
if mid$(nVal$, i, 1) = "." then
nDecs = nDecs + 1
end if
next i
if nDecs > 1 then
validNum = 0
end if
if neg = 1 then
nVal$ = "-";nVal$
end if
if validNum = 0 then
notice nVal$;" does not appear to be a valid number. " + _
"(Commas are not allowed.)"
else
nVal = val(nVal$)
nVal = nVal + 1
end if
#demo.val nVal
wait
[btnRandom]
confirm "Reset value to random number";yn$
if yn$ = "yes" then
nVal = int(rnd(1) * 100) + 1
#demo.val nVal
end if
wait

View file

@ -0,0 +1,27 @@
nomainwin
stylebits #demo.val, _ES_NUMBER, 0, 0, 0
textbox #demo.val, 20, 50, 90, 24
button #demo.inc, "Increment", [btnIncrement], UL, 20, 90, 90, 24
button #demo.rnd, "Random", [btnRandom], UL, 20, 120, 90, 24
open "Rosetta Task: GUI component interaction" for window as #demo
#demo "trapclose [quit]"
#demo.val 0
wait
[quit]
close #demo
end
[btnIncrement]
#demo.val "!contents? nVal"
nVal = nVal + 1
#demo.val nVal
wait
[btnRandom]
confirm "Reset value to random number";yn$
if yn$ = "yes" then
nVal = int(rnd(1) * 100) + 1
#demo.val nVal
end if
wait