Algorithm 有人能解释一下下面代码的最后一个例子吗?MoveCursor做什么?
该程序用于用户编辑系统日期和时间。输入集为(Alt-F4、时间、日期、选项卡)。请解释一下标签盒是如何工作的?Algorithm 有人能解释一下下面代码的最后一个例子吗?MoveCursor做什么?,algorithm,testing,Algorithm,Testing,该程序用于用户编辑系统日期和时间。输入集为(Alt-F4、时间、日期、选项卡)。请解释一下标签盒是如何工作的? 代码如下: Input = GetInput() While (Input != Alt-F4) do Case (Input = Time) If ValidHour(Time.Hour) and ValidMin(Time.Minute) and ValidSec(Time.Second) and ValidAP(Time.AmPm
代码如下:
Input = GetInput()
While (Input != Alt-F4) do
Case (Input = Time)
If ValidHour(Time.Hour) and ValidMin(Time.Minute) and
ValidSec(Time.Second) and ValidAP(Time.AmPm)
Then
UpdateSystemTime(Time)
Else
DisplayError(“Invalid Time.”)
Endif
Case (Input = Date)
If ValidDay(Date.Day) and ValidMnth(Date.Month) and
ValidYear(Date.Year)
Then
UpdateSystemDate(Date)
Else
DisplayError(“Invalid Date.”)
Endif
Case (Input = Tab)
If TabLocation = 1
Then
MoveCursor(2)
TabLocation = 2
Else
MoveCursor(1)
TabLocation = 1
Endif
Endcase
Input = GetInput()
Enddo
一个小程序将显示一个包含当前系统时间和日期的窗口,可以通过在编辑字段中键入新值来更改该窗口,如下所示。程序由Alt+F4键盘组合终止,Tab键在字段之间移动 按Tab键时,光标将移动到其他编辑字段。由于此图片中只有两个编辑字段,新时间:和新日期:,按Tab键将光标从其所在的字段移动到另一个字段
来源:这不是Java。它看起来像Visual Basic。