PDA

View Full Version : One variable made up of another variable



DynamoBen
- 31st August 2007, 04:30
Can anyone think of a "sneaky" way of doing the following? I couldn't think of a way so may ending having to head in another direction but I thought I would ask, just in case.

OUT0 VAR PORTB.1
OUT1 VAR PORTB.5
OUT2 VAR PORTC.2
OUT3 VAR PORTC.6
OUT4 VAR PORTD.3
OUT5 VAR PORTD.5

For Counter=0 to 5
Out(Counter)
Next Counter

paul borgmeier
- 31st August 2007, 04:47
This link may have what you want
http://www.picbasic.co.uk/forum/showthread.php?t=4074

DynamoBen
- 31st August 2007, 04:56
That just might do it. Thanks!

DynamoBen
- 1st September 2007, 00:18
Based on what I'm reading if I line everything up on portb I should be able to to and turn everything on with the following code. In the end I think this may work for what I need.

for counter = 0 to 7
PortB.0[Counter]=1
next Counter