It must be strictly code. The following code is just a small, simple example of pulsing four outputs.

Code:
  a  var  portb.0
  b  var  portb.1
  c  var  portb.2
  d  var  portb.3

action:

  for x = 1 to 5

    a = 1
    b = 1
    c = 0
    d = 0

  pause 200

    a = 0
    b = 0
    c = 0
    d = 0

  pause 200

  next x

  for x = 1 to 5

    a = 0
    b = 0
    c = 1
    d = 1

  pause 200

    a = 0
    b = 0
    c = 0
    d = 0

  pause 200

  next x

  goto action
What I want to do with the code is be able to change the assignment of the ports when an external input is received, therefore to be able to change the assignment as follows:

Code:
  a  var  portb.3
  b  var  portb.2
  c  var  portb.1
  d  var  portb.0
or
Code:
  a  var  portb.0
  b  var  portb.3
  c  var  portb.2
  d  var  portb.1
or
Code:
  a  var  portb.0
  b  var  portb.2
  c  var  portb.1
  d  var  portb.3
This is the only part I'm struggling with. I can do the rest of the code, but to change the assignment, I am having great difficulty.

As I said, I tried using if..then statements, select case, the above variables won't work once they've been set. I even tried using other variable to substitute for the port aliases. My setup didn't like it. To me it looks like it should work, but the pic might not see it that way.

Don't judge where the returns are and missing code. That was done just so you know that they didn't flow into each other. The way it works is that when action is run, it runs through its code continuously until a button is pressed. Once pressed, it jumps to an on..gosub command where it advances the pairing change option by one. When the pairs have been reassigned, it goes back to action and runs the code with the new pairing assignment.

Code:
  a  var  portb.0
  b  var  portb.1
  c  var  portb.2
  d  var  portb.3
  e  var  word
  f  var  word 
  g  var  word
  h  var  word

pair1:
'  1 and 2 vs. 3 and 4

  e = a
  f = b
  g = c
  h = d

  return                         ' return to pairing change

pair2:
'  1 and 4 vs. 2 and 3

  e = a
  f = d
  g = b
  h = c

  return                         ' return to pairing change

action:
' alternating flash

  for x = 1 to 5

    e = 1
    f = 1
    g = 0
    h = 0

    pause 200

    e = 0
    f = 0
    g = 0
    h = 0

    pause 200

  next x

  for x = 1 to 5

    e = 0
    f = 0
    g = 1
    h = 1

    pause 200

    e = 0
    f = 0
    g = 0
    h = 0

    pause 200

  next x
Does any of this make any sense and am I at all on the right track or at least headed in the right direction or did I hit a dead end?