UBOUND

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Eugene Anthony

    UBOUND

    <% if UBOUND(Arr) > 0 then%>

    <% end if %>

    I am getting the following error:

    Error Type:
    Microsoft VBScript runtime (0x800A000D)
    Type mismatch: 'UBOUND'

    How do I solve the problem. Your help is kindly appreciated.

    Eugene Anthony

    *** Sent via Developersdex http://www.developersdex.com ***
  • Stu

    #2
    Re: UBOUND

    You might get more help posting to the appropriate newsgroup (one that
    deals with VBScript or ASP); this is a SQL Server newsgroup. It would
    also be helpful if you posted more than two lines of code.

    You might find what you need on DevGuru: http://www.devguru.com

    HTH,
    Stu

    Comment

    • Tony Rogerson

      #3
      Re: UBOUND

      Check out http://www.devguru.com/Technologies/...ef/ubound.html

      How have you defined Arr?

      --
      Tony Rogerson
      SQL Server MVP
      http://sqlserverfaq.com - free video tutorials


      "Eugene Anthony" <solomon_13000@ yahoo.com> wrote in message
      news:LvFff.3$GX 6.1074@news.usw est.net...[color=blue]
      > <% if UBOUND(Arr) > 0 then%>
      >
      > <% end if %>
      >
      > I am getting the following error:
      >
      > Error Type:
      > Microsoft VBScript runtime (0x800A000D)
      > Type mismatch: 'UBOUND'
      >
      > How do I solve the problem. Your help is kindly appreciated.
      >
      > Eugene Anthony
      >
      > *** Sent via Developersdex http://www.developersdex.com ***[/color]


      Comment

      • Bill

        #4
        Re: UBOUND

        It looks like the arr data type is not being seen as an array.

        To debug add

        response.write( "<br>Var type of arr: " & Vartype(arr) )

        before the if Ubound(arr) line.

        It should tell you what it sees as 'arr's variable type.

        Go to http://www.devguru.com/technologies/vbscript/13986.asp to find
        what each vartype means. 8192 would be array type

        Hope this helps

        Bill

        PS the previous respondant is right you would get a better response
        from a VBScript news board


        On Sat, 19 Nov 2005 13:11:07 GMT, Eugene Anthony
        <solomon_13000@ yahoo.com> wrote:
        [color=blue]
        ><% if UBOUND(Arr) > 0 then%>
        >
        ><% end if %>
        >
        >I am getting the following error:
        >
        >Error Type:
        >Microsoft VBScript runtime (0x800A000D)
        >Type mismatch: 'UBOUND'
        >
        >How do I solve the problem. Your help is kindly appreciated.
        >
        >Eugene Anthony
        >
        >*** Sent via Developersdex http://www.developersdex.com ***[/color]

        Comment

        • Terry Kreft

          #5
          Re: UBOUND

          As others have said this is a SQL group but having said that the answer is
          probably that Arr is not an array.

          Have a look at the IsArray function to test for this before using the Ubound
          function.


          --
          Terry Kreft



          "Eugene Anthony" <solomon_13000@ yahoo.com> wrote in message
          news:LvFff.3$GX 6.1074@news.usw est.net...[color=blue]
          > <% if UBOUND(Arr) > 0 then%>
          >
          > <% end if %>
          >
          > I am getting the following error:
          >
          > Error Type:
          > Microsoft VBScript runtime (0x800A000D)
          > Type mismatch: 'UBOUND'
          >
          > How do I solve the problem. Your help is kindly appreciated.
          >
          > Eugene Anthony
          >
          > *** Sent via Developersdex http://www.developersdex.com ***[/color]


          Comment

          • Trevor Best

            #6
            Re: UBOUND

            Terry Kreft wrote:[color=blue]
            > As others have said this is a SQL group but having said that the answer is
            > probably that Arr is not an array.
            >
            > Have a look at the IsArray function to test for this before using the Ubound
            > function.[/color]

            Personally, I'd look at the Dim statement so see if was an array :-)

            Comment

            • Terry Kreft

              #7
              Re: UBOUND


              If it's a variant array that wouldn't work e.g.

              Dim Arr ' i.e. a variant

              Which at some later point is assigned a value such as

              Arr = Array(1, 2)

              After this line IsArray would return true, before this line it would return
              false. Before this line Ubound(Arr) raises the error the OP has seen after
              it the error is not raised, hence the reccomendation to use IsArray.




              --
              Terry Kreft



              "Trevor Best" <nospam@localho st.invalid> wrote in message
              news:4381c70a$0 $23296$db0fefd9 @news.zen.co.uk ...[color=blue]
              > Terry Kreft wrote:[color=green]
              >> As others have said this is a SQL group but having said that the answer
              >> is probably that Arr is not an array.
              >>
              >> Have a look at the IsArray function to test for this before using the
              >> Ubound function.[/color]
              >
              > Personally, I'd look at the Dim statement so see if was an array :-)[/color]


              Comment

              • Trevor Best

                #8
                Re: UBOUND

                Terry Kreft wrote:[color=blue]
                > If it's a variant array that wouldn't work e.g.
                >
                > Dim Arr ' i.e. a variant
                >
                > Which at some later point is assigned a value such as
                >
                > Arr = Array(1, 2)
                >
                > After this line IsArray would return true, before this line it would return
                > false. Before this line Ubound(Arr) raises the error the OP has seen after
                > it the error is not raised, hence the reccomendation to use IsArray.[/color]

                I'll repeat:
                Personally, I'd look at the Dim statement so see if was an array :-)

                i.e. I would never write code like that.

                Comment

                Working...