Results 1 to 7 of 7

Thread: BitVector32

  1. #1

    Thread Starter
    Fanatic Member popskie's Avatar
    Join Date
    Jul 2005
    Location
    In my chair
    Posts
    666

    BitVector32

    hi,

    How to create an instance of BitVector32 and initialize all to true? I read the MSDN but not totally answer my question.


    Thanks,
    POpskie

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: BitVector32

    The BitVector32 only has two constructors. One takes a BitVector32 object, so that's obviously no use, and the other takes an int. If you want every Item in the BitVector32 to be true then you must specify an int that has every bit set. What int value is that?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Fanatic Member popskie's Avatar
    Join Date
    Jul 2005
    Location
    In my chair
    Posts
    666

    Re: BitVector32

    Quote Originally Posted by jmcilhinney
    The BitVector32 only has two constructors. One takes a BitVector32 object, so that's obviously no use, and the other takes an int. If you want every Item in the BitVector32 to be true then you must specify an int that has every bit set. What int value is that?
    Hi JM,

    I want all of this object initilialize to true. What is the syntax or how to create an instance tha initialize BitVect object all to true;

    BitVect[0] // true;
    BitVect[1] // true;
    BitVect[2] // true;
    BitVect[3] // true;
    BitVect[4] // true;
    BitVect[5] // true;
    //etc.

    thanks
    Popskie

  4. #4
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: BitVector32

    You already have the answer.

  5. #5

    Thread Starter
    Fanatic Member popskie's Avatar
    Join Date
    Jul 2005
    Location
    In my chair
    Posts
    666

    Re: BitVector32

    By doing one by one and assign to true.I think there is another way.Maybe passing an integer to the constructor but i dont know what the value to pass in order to assign to true. Maybe its one or zero or the lenght of the array you want to be true.

  6. #6
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: BitVector32

    Quote Originally Posted by jmcilhinney
    If you want every Item in the BitVector32 to be true then you must specify an int that has every bit set. What int value is that?
    Its unsigned 0xffffffff which is signed -1 since the first bit is the sign bit.

  7. #7
    New Member
    Join Date
    Aug 2008
    Posts
    1

    Re: BitVector32

    As per the last reply.
    0 as a binary is 000...0000 - So in BitVector32 this would set all bits to false
    1 as a binary is 000...0001 - Would set the 1st bit to true the rest to false
    -1 as a binary is 111...1111 - Would set all bits to true

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