Array length in VBScript

Results 1 to 3 of 3

Thread: Array length in VBScript

  1. #1
    Maleeha Guest

    Default Array length in VBScript

    I&#039;m using the below script but an error always occur<BR><BR>&#060;Script&#062;<BR>Dim position()<BR>for i = 0 to position.length<BR> position(i) = ""<BR>next<BR>&#060;/Script&#062;<BR><BR><BR>Error: Microsoft VBScript runtime error &#039;800a01a8&#039; <BR><BR>Object required with length property<BR><BR><BR>I have also tried it this way:<BR> position().length<BR>but no use<BR><BR><BR>why is it so? <BR>How can i get the length of array in VBScript??<BR>

  2. #2
    Join Date
    Dec 1969

    Default Ubound

    .length is javascript, you need x = UBound(arrayname). Shouldn&#039;t this be javascript anyway?<BR>Dom

  3. #3
    zain ( the dragon) Guest

    Default no of element in array = UBound(array) +1 , if th

    no of element in array = UBound(array) +1 , if the index starts from 0

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts