I guess you mean PORTAbits.RA0, but yes, this should work. The direction register is input by default, so no need to do anything for it, but if it is one of those PICs with analog inputs, usually you have to configure it for digital input (ANSEL register), because default is analog input.