Results 1 to 5 of 5

Thread: How to initialize VB Array

  1. #1
    Join Date
    Dec 2008
    Posts
    87

    How to initialize VB Array

    I'm attempting to load that byte array into the ILArray and have attempted various methods without luck. The code i have used in my program gives me an ILArray with only one row with the value "(unknown data type) and the message "End of expression expected". Visual Basic doesn't provide any way to declare an array and initialize its elements at the same time.

  2. #2
    Join Date
    Oct 2008
    Posts
    180

    Re: How to initialize VB Array

    Try to create the ILArray with generic type of byte instead of double, reshape it afterwards to the size needed and convert it to 'double' then (if needed). This is generally a good idea so you don't have to keep track of two bounds instead of one. Obviously, in some cases you might want two bounds to match the logic of your problem.

  3. #3
    Join Date
    Feb 2008
    Posts
    137

    Re: How to initialize VB Array

    You may add an additional condition that will also allow the function to indicate whether the passed array is initialized. This will create ILArray, having arrays of byte on each element. A fixed-size array most closely matches our CD rack anology. There are a limited number of slots you can slide CDs into. Pretend you have three CDs - one by the Deftones, another by Tool, and a third by Disturbed.

  4. #4
    Join Date
    Oct 2008
    Posts
    167

    Re: How to initialize VB Array

    The very existence of this, and that array bounds can be set to anything you want means that you can't count on the lower bound in any technical sense. When the array has been dimensioned, the code accurately returns the current number of dimensions in the array, regardless of how large (UBound) each dimension is, or whether each dimension are all the same or of differing sizes. This would also explain the "unknown data type" message, since ILArray.ToString (which is called internally) does not know how to handle elements of byte[] array type.

  5. #5
    Join Date
    Feb 2009
    Posts
    96

    Re: How to initialize VB Array

    show us the code so we can see it more clearly

Similar Threads

  1. Hdd won't initialize
    By 20phileagles in forum Hardware Peripherals
    Replies: 4
    Last Post: 11-12-2011, 03:35 AM
  2. Cant initialize to MBR
    By Cortezz in forum Operating Systems
    Replies: 3
    Last Post: 10-09-2010, 01:50 PM
  3. How to initialize IKE
    By Renau in forum Technology & Internet
    Replies: 5
    Last Post: 15-02-2010, 09:06 AM
  4. Assigning an array to an array
    By MACE in forum Software Development
    Replies: 3
    Last Post: 18-11-2009, 05:19 PM
  5. External USB HD won't initialize
    By abdulthekewl in forum Hardware Peripherals
    Replies: 9
    Last Post: 01-08-2009, 08:55 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,727,255,836.73329 seconds with 17 queries