The EGL keyword if marks the start of a set of statements that run only if a logical expression resolves to true. The optional keyword else marks the start of an alternative set of statements that run only if the logical expression resolves to false. The keyword end marks the close of the if statement.
You can nest if and other end-terminated statements (code blocks) to any level. Each end keyword closes the most recent open block of code.
if (userRequest == "U") myCustomer.customerBalance=newTotal; try replace myCustomer; onException(myEx AnyException) myErrorHandler(16); end else try add myCustomer; onException(myEx AnyException) myErrorHandler(18); // ends program end if (sysVar.systemType is WIN) displayFormattedResults(); else displayTextResults(); end end