Results 1 to 6 of 6

Thread: Exiting Function???

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 1999
    Posts
    77

    Exiting Function???

    I'm currently writing a program, and I noticed a few strange things.

    I went into debug mode and noticed that this statement:
    ReDim Preserve glo.Links(1 To glo.CounterVal, 1 To 3)

    Would exit the current function, and I have no clue why. I'm positive it is that statement as well.

    (Note: glo.CounterVal = 2)

    Any ideas why that would cause the problem to exit the function? Thanks, and feel free to ask any questions about the function.

  2. #2
    Frenzied Member moinkhan's Avatar
    Join Date
    Jun 2000
    Location
    Karachi, Pakistan
    Posts
    2,011
    When I was sleeping that day... someone whispered me "You can only Redim the last dimension of the Multidimensional Array while still preserving the Older values"

    Maybe this is the problem??

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 1999
    Posts
    77
    Although I am preserving the older values.

    ReDim Preserve glo.Links(1 To glo.CounterVal, 1 To 3)

    Perhaps I'm misunderstanding something?

  4. #4
    Frenzied Member moinkhan's Avatar
    Join Date
    Jun 2000
    Location
    Karachi, Pakistan
    Posts
    2,011
    You can only Redim the last dimension of a multidimensional array

    ReDim Preserve X(2,5)


    'Also when redimming with Preserve do not use Lower bounds

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jul 1999
    Posts
    77
    Thank god, this would be pretty simple to fix.

    ReDim Preserve glo.Links(1 To glo.CounterVal, 1 To 3)

    all I need to do is change to this:

    ReDim Preserve glo.Links(1 To 3, 1 To glo.CounterVal)

    Thanks for your help, I appreciate it .

  6. #6
    Frenzied Member moinkhan's Avatar
    Join Date
    Jun 2000
    Location
    Karachi, Pakistan
    Posts
    2,011
    Don't mention it.. My Pleasure!

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