这是我使用的代码
Sub btnguess_Click
randNum = Math.GetRandomNumber(10)
FCControls.GetText(txtCels)
If txtCels = randNum Then
lblanswer = "That's correct the Madame would like to hire you!"
ElseIf txtCels <1 or >10 Then
lblanswer = "Please enter number between 1 and 10"
Elseif txtCels <> randNum Then
lblanswer = "That's incorrect the Madame asks you to leave."
EndIf
endsub
我得到的错误:45,24:Expected a condition here.
我不知道我在这里错过了什么
问题在ElseIf txtCels <1 or >10 Then
在指定语句时,即使前面已经提到,也不能省略条件。
您必须在>10
之前重写txtCels
,即
ElseIf txtCels <1 or txtCels >10 Then
如果没有这个,你实际上是在说"大于10",这是没有意义的。