IFs and ENDs

Hi.

Reading this doc on If:

my impression is that the doc is saying that the entire construct needs only a single “end” statement.

However, I seem to be observing that each sub-block requires an “end” for the compilation to work.

For example (this compiles), the 5 "end"s at the bottom of this code -

Many Ends 01.zip (1.4 KB)

Am I misreading what the docs say?

It would be a nice-to-have if the GP script editor could highlight the matching begin word for a selected “end” statement.

1 Like

It’s your use of Else If instead of Elsif that requires the extra ends.
Switch to Elsif.

1 Like

Perfect. Thanks Ed!

1 Like

If you have a lot of tests, consider using a select statement

1 Like