请问高手:“Ensure that they are positive values.”哪里出错了?
这几天刚开始学VB6,照着书写的小程序,可不知道怎么的出现语句错误,还请问各高人指点,不知道哪里出错了?Private Sub cmdEvaluate_Click()
'declare two floating point variables.
Dim reWidth As Double, reLength As Double
On Error GoTo wrongvalues
'extract values from input textBox controls.
reWidth = CDbl(txtWidth.Text)
reLength = CDbl(txtLength.Text)
Ensure that they are positive values. '在插入这句后,为什么出现“缺少:语句结束”的错误
If reWidth <= 0 Or reLength <= 0 Then GoTo wrongvalues
'evaluate results and assign to output text boxes.
txtPerimeter.Text = CStr((reWidth + reLength) * 2)
txtArea.Text = CStr(reLength * reWidth)
Exit Sub
wrongvalues:
MsgBox "please enter valid Length and Width values", vbExclamation
End Sub