180行目前後において、後何秒であるかを出力し続ける機能を追加してみました。
コード:
'差分
16 Dim Time As String
17 Dim st As SYSTEMTIME
18 Dim Remainder$ As String
19 Dim Remainder As Long
171 If Time=Time$() Then goto 171
172 GetLocalTime(st)
173 Remainder=((hour-st.wHour)*3600+(min-st.wMinute)*60+(sec-st.wSecond)+24*3600) Mod (24*3600)
174 Remainder$=Str$(Int(Remainder/3600))+"時間"+Str$(Int(Remainder/60) Mod 60)+"分"+Str$(Remainder Mod 60)+"秒"
175 Locate 0,5
176 Print Remainder$+" "
'書き換え
180 If chk<>Time$() Then goto 171
'差分
181 Locate 0,5
182 Print "0時間0分0秒 "
全体のソースはこちら [ここをクリックすると内容が表示されます] [ここをクリックすると非表示にします]コード:
#N88BASIC
10 dim hour As Integer
13 dim min As Integer
15 dim sec As Integer
16 Dim Time As String
17 Dim st As SYSTEMTIME
18 Dim Remainder$ As String
19 Dim Remainder As Long
20 dim chk As String
23 dim chk1 As String
25 dim chk2 As String
28 dim chk3 As String
29 dim chk4 As String
30 print "何時";
40 input hour
50 If hour<0 or hour>23 Then goto 30
60 print "何分";
70 input min
80 If min<0 or min>59 Then goto 60
90 print "何秒";
100 input sec
110 If sec<0 or sec>59 Then goto 90
112 If hour<10 Then chk1="0"+Str$(hour As Double) Else chk1=Str$(hour As Double)
115 If min<10 Then chk2="0"+Str$(min As Double) Else chk2=Str$(min As Double)
117 If sec<10 Then chk3="0"+Str$(sec As Double) Else chk3=Str$(sec As Double)
120 chk=chk1+":"+chk2+":"+chk3
130 print chk
140 print "この時刻でよろしいならyを、そうでなければnを入力してください。";
150 input chk4
160 If chk4="n" or chk4="N" Then goto 30
170 If chk4<>"y" and chk4<>"Y" Then goto 140
171 If Time=Time$() Then goto 171
172 GetLocalTime(st)
173 Remainder=((hour-st.wHour)*3600+(min-st.wMinute)*60+(sec-st.wSecond)+24*3600) Mod (24*3600)
174 Remainder$=Str$(Int(Remainder/3600))+"時間"+Str$(Int(Remainder/60) Mod 60)+"分"+Str$(Remainder Mod 60)+"秒"
175 Locate 0,5
176 Print Remainder$+" "
180 If chk<>Time$() Then goto 171
181 Locate 0,5
182 Print "0時0分0秒 "
200 print "時間です。"
210 beep
しかし行番号が久しいですね。
_________________
Website→
http://web1.nazca.co.jp/himajinn13sei/top.html
ここ以外の場所では「暇人13世」というHNを主として使用。
に署名を書き換えて欲しいと言われたので暇だしやってみるテスト。