'********* 一般的 ***************************************************
Dim I As Byte , J As Byte , K As Byte , L As Byte
Dim q As Byte
Dim Setdatetime_index As Byte
Setdatetime_index = 2 '日期数组的第一个索引为1,2 = _min
Dim Date_array(6) As Byte At _sec Overlay '秒/分钟/小时/天/月/年的数组指定在内存中覆盖变量。
'********* 主循环 ***************************************************
Do
Disable Interrupts '禁用中断
I = Key_press '读取键
Key_press = 0
L = Lookup(setdatetime_index , Date_max)
If Setdatetime_index = 4 Then
L = Lookup(_month , Date_month)
K = _year And 3
If _month = 2 Then If K = 0 Then Incr L
End If
K = Lookup(setdatetime_index , Date_min)
J = Date_array(setdatetime_index)
If I = Key_plus Then
If J < L Then Incr J Else J = K
End If
If I = Key_minus Then
If J > K Then Decr J Else J = L
End If
Date_array(setdatetime_index) = J
Enable Interrupts '启用中断
If I = Key_enter Then
If Setdatetime_index < 6 Then Incr Setdatetime_index Else Setdatetime_index = 1
End If