array with variable

Results 1 to 2 of 2

Thread: array with variable

  1. #1
    cheril Guest

    Default array with variable

    When I use an array with the size defined as a variable i get an error like <BR>Expected integer constant <BR>dim check1(x)<BR>-----------^<BR>for the part of code written below<BR><BR>dim x<BR>x=ubound(array)<BR>dim check1(x)<BR>Now when I use dim check1(11) it works but when a variable is<BR>defined it gives the above error.<BR>Ofcourse I have defined the array named "array" & it works fine<BR>so ubound of array will give me 11 so x must be equal to 11 & hence instead of writing 11 I want to write x as this value is dynamic.<BR>Please can anyone help.<BR>Thanx

  2. #2
    J Guest

    Default RE: array with variable

    try this:<BR><BR>dim aryCheck(), x, aryArray<BR><BR>x = UBound(aryArray)<BR><BR>redim aryCheck(x)<BR><BR>

Posting Permissions

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