> Hi, I am looking for some help in converting a boolean matrix (array) to a
> numerical value. ie, row one = 0 through 19, row two = 20 through 39, etc...
> I have tried many different approaches and seem to wind up with a number of
> different ways to do things I don't want to do. I have to make a matrix to
> select relays via GPIB addresses, each card location has 20 addressable
> positions with 18 card locations ( 0 - 19, 20 - 39, 40-59,...).
>
I'd recommend that you drop a For loop, and wire up the 2D array of
Booleans. It will index out each row. Multiply i times 20 and
use that to add to the result of each row. From the description, it
isn't clear whether there is only one True per row. If that it the
case, then search 1D array for True. It will return t
he index of
the element that is True, or -1 if not found. If found, then add
the index to the 20*i value. The next step is probably going to
be formatting the array of integers to a string for GPIB transmission.
Greg McKaskle