Couldn't we use LOOKUP for this??

my_var = port A

Lookup my_var,[0,1,2,3,4,]pin_pressed



wouldn't pin_presed now hold the pin that was triggered?
Victor