Re: some bit math help

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



> > I want to store binary information as binary, such as an array of
1024
> > checkboxes into 1024 bits, represented by 128 long character string.
I
> > cannot figure out how to do this in VB except in blocks of 8 bits or
1
> > character. I want to be able to set, get, clear, and read the
> > individual bits within the 128 chars-length string and past the
> > settings as a VB string.
>
> I would suggest you store it as a byte array, rather than a string.
If you're
> hellbent on using a string, you do realize they're 16-bits per
character, right?
> You'd want to use MidB$() to extract the individual bytes, based on a
little math to
> determine which was what.

Agreed! After all, memory isn't really that dear any more. However,
unless the OP set those 1024 CheckBoxes up in a control array (or,
perhaps, a small number of control arrays), thus making them accessible
via a simple loop, it won't much matter what method he settles on... the
code that will be necessary to store that many non-arrayed controls will
be loooong and ugly.

Rick

.



Relevant Pages

  • Re: sbalneav Your Source Code
    ... > I'm not sure where you're going to store your file streams ... hence my use this array & of .txt files. ... string Blanks; ... So instead of passing the array, & converting each element. ...
    (talk.origins)
  • Re: Proper modularization technique
    ... will generate a string to be used by the calling routine. ... Should I set aside an array in the calling routine and have the ... the function might need to store more characters than the array ...
    (comp.lang.c)
  • Re: Data From CREATEOBJECT
    ... the first column and the "key" in the second. ... The array is public so that all of the objects can find it and the main program can find all of the objects. ... So there is no need to store it once more in the array. ... If it is a variable set of properties, then it might be better to build a long string of the property names and the respective values and store this string in a memo field. ...
    (microsoft.public.fox.programmer.exchange)
  • Re: what is the best datatype for..
    ... If you are only going to store it, then use a string. ... each value in the array, check to see if it already exists in the ... If it does, then just increment the count, otherwise, add ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Is there such a thing as dynamic arrays in classic rexx?
    ... my program but now I have a need for a dynamic array. ... String length of 0000006A000005F2 is 16 ... just store the word-numbers elsewhere. ...
    (comp.lang.rexx)