Quote:

should I close every IF with and ENDIF



Yes.