首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >VB6预期报表结束

VB6预期报表结束
EN

Stack Overflow用户
提问于 2013-12-03 15:48:49
回答 1查看 964关注 0票数 0

我不知道我做错了什么。我不断得到错误“预期:语句的结束”在‘显示输出。注释。

代码语言:javascript
复制
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
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-12-03 16:00:43

您的代码没有运行是因为双引号。我改变了它们,它没有出错。

复制并粘贴此代码:

代码语言:javascript
复制
    '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 p
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/20355595

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档