« Previous Next »

Thread: Is there a maximum number of variables that can be used in a VBScript / ASP page?

Last post 01-17-2009 2:28 AM by Hobbes23. 2 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (3 items)

Sort Posts:

  • 01-11-2009, 3:52 AM

    • Hobbes23
    • Not Ranked
    • Joined on 01-11-2009, 3:45 AM
    • Posts 2

    Is there a maximum number of variables that can be used in a VBScript / ASP page?

    I have an error that recently came up as I was adding more code to a large application written in VBScript in the classic asp.
    After some testing it seems to me that it has an issue with the number of variables used in my script. Since all pages are linked by using includes, and all processing and displaying is done through the same root asp page, it is thousands of lines long and could have this many variables I guess.
    Here is the error message I get:
    Microsoft VBScript runtime error '800a0006'

    Overflow: '[number: 32771]'

    /default.asp, line 519

    the line 519 is actually after the server has processed thousands of lines in other files. Line 519 is actually blank, and I'm not sure why it even says that line. Made it really difficult to narrow down the actual issue's source.

    but when I remove a small displaying of a variable, even that triggers the error. And removing a variable from my code seems to decrement the number displayed in the error after number.

    Any ideas? Is there somewhere or somehow for this max limit to be increased?
    -Peter
  • 01-16-2009, 1:51 AM In reply to

    Re: Is there a maximum number of variables that can be used in a VBScript / ASP page?

    Hi,

    The description of the Overflow error in VBScript Run-time Errors shows it should caused by that the value attempted to assign to a variable is too large.

    you can use the "On Error Resume Next" statement to narrow down the root cause. Below is a article contains a sample code to use this statement.

    Handling Errors in VBScript
    http://msdn.microsoft.com/en-us/library/ms805163.aspx

    I hope the information will be of help.

    Leo Tang
    Microsoft Online Community Support

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • 01-17-2009, 2:28 AM In reply to

    • Hobbes23
    • Not Ranked
    • Joined on 01-11-2009, 3:45 AM
    • Posts 2

    Re: Is there a maximum number of variables that can be used in a VBScript / ASP page?

    In another forum I got a reply saying: "VBScript uses a signed INT to enumerate variables, which suggests that the maximum number of variables will be 32767" But I think it is actually counting either the executable lines, or the actual jumping in and out of code, meaning between HTML code and VBScript code. So since I have a main page with Select case to separate modules, but the modules are joined in using sharp includes of other asp pages, and then those have similar structure again, and they all call back to the main page, and the chain of selects determine what actual page content is displayed. So my conclusion is that the total amount of code that could execute in each page call has exceeded some variable's maximum, and I'll need to replace at the root level the sharp includes with response redirects in order to break the modules off to have separate executions from the root and other modules. The dissapointing part is that I can't find anything on this on Microsoft's site regarding VBScript's limitations.
Page 1 of 1 (3 items)
Microsoft Communities