Created
August 5, 2017 23:52
-
-
Save basictomonokai/8a8407deca30756d31fea3c6b2149d04 to your computer and use it in GitHub Desktop.
ボタンと入力項目があるBASIC!プログラム
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.title "HTML test" | |
nxttest: | |
HTML.OPEN | |
HTML.LOAD.URL "btninp.html" | |
xnextUserAction: | |
! loop until data$ is not "" | |
DO | |
HTML.GET.DATALINK data$ | |
UNTIL data$ <> "" | |
type$ = LEFT$(data$, 4) | |
data$ = MID$(data$,5) | |
! Act on the data type | |
! Shown are all the current data types | |
SW.BEGIN type$ | |
! Back Key hit. | |
! if we can go back then do it | |
SW.CASE "BAK:" | |
PRINT "BACK key: " + data$ | |
popup "終了します",0,0,0 | |
pause 2000 | |
end | |
SW.BREAK | |
! A hyperlink was clicked on | |
SW.CASE "LNK:" | |
PRINT "Hyperlink selected: "+ data$ | |
popup "リンク先をロード中",0,0,1 | |
! HTML.LOAD.URL data$ | |
browse data$ | |
SW.BREAK | |
! An error occured | |
SW.CASE "ERR:" | |
PRINT "Error: " + data$ | |
popup "エラーが発生しました 終了します",0,0,0 | |
pause 2000 | |
exit | |
SW.BREAK | |
! User data returned | |
SW.CASE "DAT:" | |
PRINT "User data: " + data$ | |
! Check for Exit | |
IF data$ = "//x//" then | |
PRINT "User ended demo." | |
HTML.CLOSE | |
popup "終了します",0,0,0 | |
pause 5000 | |
end | |
else | |
msx$=data$+"←データの内容" | |
popup msx$,0,0,0 | |
if left$(data$,5) = "//i//" then | |
inpx$=mid$(data$,6) | |
print "入力データ ==> ";inpx$ | |
html.close | |
pause 6000 | |
goto nxttest | |
endif | |
pause 1000 | |
goto xnextUserAction | |
ENDIF | |
SW.BREAK | |
! Form data returned. | |
! Note: Form data returning | |
! always exits the html. | |
SW.CASE "FOR:" | |
PRINT "Form data: "+data$ | |
popup "終了します",0,0,0 | |
pause 2000 | |
exit | |
SW.BREAK | |
SW.DEFAULT | |
PRINT "Unexpected data type:", type$ + data$ | |
popup "終了します",0,0,0 | |
pause 2000 | |
exit | |
SW.END | |
GOTO xnextUserAction | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment