I'm guessing this is related to your other thread.
Which compiler are you using?
Please explain the difference between 'TRISA.B2' and 'TRISA.TRISA2' if there is any.
WPUA.WPUA4=1; suggests you want the internal pull-up on RA4 to be active so the pin should be high at all times unless you are driving it low.
I am assuming you have the config words set to use the internal oscilator modes and you have not configured RA4 as the CLKOUT pin and also you have not configured the Watchdog timer to let it reset so quickly it can't execute your code.
The MCLR can be tied directly high or through a resistor, it shouldn't change the way it works. Obviously use a resistor if something else has to pull it low.
i have an application wich use RA4 as output connected to a led
Code:
sbit Led_Blanche at LATA4_bit ; // RA4
sbit Led_Blanche_direction at TRISA4_bit
the main difference i see is :
i used LATA4_bit=1;
Code:
ANSELA=0;
Led_Blanche_direction=0;
Led_Blanche=1; // led pulled up trough R=4,7K so need 0 to bright ON the led
.....
Led_Blanche= !Led_Blanche; // blink RA4
To set RA4 as an output pin you need to turn off the analogue inputs (which you have done), and also set the configuration bits 2-0 set to 100 and bit 11 set to a one.