Mixing of "END IF" and "ENDIF" as well as "ELSE IF" and "ELSEIF" is no problem. The problem here isELSE
IF (something) THEN
ELSE is set as open and close fold string which is correct set and correct interpreted by UltraEdit. THEN is set as an open fold string (for IF and perhaps other). So when the code folding parser reaches that line it interprets it as
- ELSE found - closing fold string for previous open fold found.
- ELSE found - new open fold string found.
- THEN found - a second new open fold string found.
And THEN as second open fold string here is the problem. The code folding engine internally now thinks there are 2 folding levels open, the first one is closed with the following ELSE, but the second one is open up to END SUBROUTINE.
This situation can't be solved with the current implementation of the code folding engine of UltraEdit. I suggest to use additionally
/Ignore Fold Strings = "ELSE IF"
to get best out of the code folding engine.