“预期陈述”在 If then 语句中

发布于 2025-01-06 08:20:14 字数 515 浏览 2 评论 0原文

我有一个经典的 asp 应用程序,如果用户选择将此报告导出到 Excel(for 循环对结果进行分页),我需要跳过 for 循环

,我试图跳过此操作,如下所示:

 if not wordExport then    
    response.Write "test"
    for J = 1 to RSList.PageSize
    end if

更多代码此处显示全部来自数据库的信息。(由于用户选择了“导出”,因此没有分页)

 if not wordExport then
    RSList.movenext
    next
    end if

但是,我不断收到以下错误:

Microsoft VBScript compilation error '800a0400'

Expected statement


end if
^

我缺少什么吗???我没看到……啊啊啊。帮助!

I have a classic asp application, and i need to skip a for loop if the user has chosen to export this report into excel (the for loop paginates the results)

i'm trying to skip this, like so:

 if not wordExport then    
    response.Write "test"
    for J = 1 to RSList.PageSize
    end if

more code here display all the information from the database.(without pagination since the user has picked "export")

 if not wordExport then
    RSList.movenext
    next
    end if

however, i keep getting the following error:

Microsoft VBScript compilation error '800a0400'

Expected statement


end if
^

is there something i'm missing??? i don't see it... aaah. help!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

别再吹冷风 2025-01-13 08:20:15

我必须采取一种解决方法(这会导致大量冗余代码),

if wordExport then
Call DisplayAll()
else
Call DisplayWithPages()
end if

其中这两个子程序完全相同,除了一个以 20(页面大小)增量循环,另一个循环遍历整个数据集。

i had to do a workaround (which cause lots and lots of redundant code)

if wordExport then
Call DisplayAll()
else
Call DisplayWithPages()
end if

where these two subs are exactly the same, except one loops in increments of 20 (page size), and the other loops through the whole dataset.

梦在夏天 2025-01-13 08:20:14

是的,您甚至一开始就没有合适的 FOR 循环。

 if not wordExport then    
    response.Write "test"
    for J = 1 to RSList.PageSize
    next   <-----
end if

Yes, you don't even have a proper FOR loop to begin with.

 if not wordExport then    
    response.Write "test"
    for J = 1 to RSList.PageSize
    next   <-----
end if
救星 2025-01-13 08:20:14

您是否缺少 Next J 语句?

if not wordExport then    
    response.Write "test"
    for J = 1 to RSList.PageSize
    'Do Something
    Next J
end if

are you missing a Next J statement?

if not wordExport then    
    response.Write "test"
    for J = 1 to RSList.PageSize
    'Do Something
    Next J
end if
不醒的梦 2025-01-13 08:20:14

我认为在 for 循环之后您可能需要一个 Next

I think you might need a Next after your for loop

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文