我不知道我做错了什么。我不断得到错误“预期:语句的结束”在‘显示输出。注释。
Option Explicit
Private Sub cmdOkay_click()
'Declare counter variable (p)
Dim p As Integer
p = 8
'Declare variable to hold calculated minutes
Dim minutes As Integer
'Display title of chart in listbox
MyListBox.AddItem “Cooking Chart”
'For each pound (from 8 to 23), calculate and display minutes
For p = 8 To 23
'Calculate minutes.pounds * 17
minutes = p * 17
'Display output.
MyListBox.AddItem p & “ lbs, “ & minutes & “ minutes.” ERROR
Next p
End Sub
Private Sub cmdExit_Click()
End
End Sub发布于 2013-12-03 16:00:43
您的代码没有运行是因为双引号。我改变了它们,它没有出错。
复制并粘贴此代码:
'Declare counter variable (p)
Dim p As Integer
p = 8
'Declare variable to hold calculated minutes
Dim minutes As Integer
'Display title of chart in listbox
MyListBox.AddItem "Cooking Chart"
'For each pound (from 8 to 23), calculate and display minutes
For p = 8 To 23
'Calculate minutes.pounds * 17
minutes = p * 17
'Display output.
MyListBox.AddItem p & " lbs, " & minutes & " minutes."
Next phttps://stackoverflow.com/questions/20355595
复制相似问题