Results 1 to 5 of 5

Thread: ah, those wonderful arrays ;)

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2000
    Posts
    83
    ok question, how can i created a non defined(like myarray() ) 2 demensional array? I tried
    global myarray(4,) as integer

    that didn't work from that code you should get what i want right? I'd like to have an array that is 4 for the first number and the second number can change....possible?
    Ian Callanan
    VB6.0
    [email protected]

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    it's not that hard with dynamical arrays:
    Code:
    global myarray()
    ..
    redim array(4,x)
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3
    Guest

    Thumbs up kedaman totally agree but..............

    Use Preserve if ya want to ReDim the array and keep all it's existing content intact. VB5 and upwards

    ReDim Preserve MyArray(4,whatever)

    FYI
    It was once claimed on this site that you couldn't redim a multi dimensional array, but have not struck this as a problem.

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Jethro, youre right about that, but only for the last argument in the array can be redimmed preserving
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  5. #5
    PowerPoster BruceG's Avatar
    Join Date
    May 2000
    Location
    New Jersey (USA)
    Posts
    2,657
    Another way to declare a 2-dimensional dynamic array is:
    Code:
    Dim MyArray(,) As datatype
    "It's cold gin time again ..."

    Check out my website here.

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