In the second program, the HIGH and LOW commands automatically make the pins outputs – you have not set them in the first to output. Add

Code:
TRISA = 0 ' make all PORTA output that can be outputs 
          ' (check datasheet depending on your PIC)
to the first.

In the second program, you are changing PORTB pins and in the first, PORTA pins. Most PICs default PORTB to digital but many default PORTA to analog. Without knowing what PIC you are using, it is hard to say if this is the issue. Look at this link from MELABS for help on this latter issue. (Pins must be set digital to use them in your manner)

http://www.melabs.com/support/mcu_hints.htm

Good Luck,
Paul Borgmeier
Salt Lake City, Utah
USA