It has been a long time since I wrote anything on the BASIC Stamp... so forgive me please for forgetting most of it...
That said, I am trying to figure out how I can write a byte value to ports.
The idea is to generate a random number, then write the three least significant bits to three port in succession.
The ultimate goal is to generate a random RGB color from LEDs (driven by a set of relays) based on the values of least-significant bits in a random number.
The process would be placed in a loop thus creating a sequence of non-repeatable colors on a lighting fixture as a game show effect.
Getting the least significant contents of a random number into three ports elegantly is the task...