Results 1 to 2 of 2

Thread: Error in dynamic arrya

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2000
    Posts
    71

    Question

    Public iCount as intger .
    Why is it there is error in this statement - ReDim Preserve lHwnd(iCount) ?

  2. #2
    Lively Member
    Join Date
    Feb 2001
    Posts
    78
    Public iCount as intger .
    ReDim Preserve lHwnd(iCount)

    Firstly assuming intger isn't your own data-type it is spelt wrong, maybe thats just a typo when you typed your code in here, but if its in the original it may be a problem. What Error do you get:

    If its array already dimensioned, check the original Declare of the array it should have empty brackets:

    Public lHwnd() As Long 'For Example

    If its subscript out of range, put a breakpoint on the line:
    ReDim Preserve lHwnd(iCount)
    and check the value of Icount if its negative then thats the problem.

    You need to supply a bit more information though for people to tell what the problem is.

Posting Permissions

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



Click Here to Expand Forum to Full Width