Clarion Language: Complete List of Statements That Require a Matching END

Hi everyone,

I’m working on improving Clarion folding support for VS Code and need to ensure that all block structures requiring an explicit END are properly handled.

What I Need Help With

I’m looking for a definitive list of Clarion statements that introduce a block structure that must be explicitly closed with an END.

Here’s what I have so far:

  • CASE ... END
  • IF ... END
  • LOOP ... END
  • WINDOW ... END
  • SHEET ... END
  • TAB ... END
  • QUEUE ... END
  • CLASS ... END
  • MAP ... END
  • FILE ... END
  • RECORD ... END
  • VIEW ... END
  • JOIN ... END (inside VIEW)
  • INTERFACE ... END

Clarifications:

:white_check_mark: I’m looking for blocks that require a closing END to be valid.
:white_check_mark: I’m looking for any missing structures that follow this pattern.

Are there any other statements that start a block requiring an END that I’ve missed?

Thanks in advance!
Mark

GROUP ... END
MODULE ... END
OPTION ... END
REPORT ... END
1 Like

Let’s see here a few more

  • GROUP (in Data, and a control in a window, if context matters)
  • ITEMIZE
  • EXECUTE
  • BEGIN

  • REPORT
  • FORM
  • DETAIL
  • HEADER
  • FOOTER
  • BREAK(Variable) (when inside of a report) vs. the statement inside of a loop that does not have an end

  • TOOLBAR
  • MODULE (as mentioned by Rick)
  • MENUBAR
  • MENU
  • OPTION (as mentioned by Rick)

  • ACCEPT
  • APPLICATION (an MDI frame)
  • OLE

NOTE: The end of a LOOP can be END | UNTIL | WHILE

and of course, it is allowed to still use a period ‘.’ in place of an END
Which is something that I removed from my code due to code folding complications

Thank you Carl for the formatting :wink:

2 Likes

Thanks Mark

Yes I am not really contemplating handling a . unless it’s something like a one line IF maybe
IF A=B THEN SomeProcedure().

What are yours or others thoughts on that?

Mark

Personally I don’t have a problem with ignoring periods as terminators
I’m sure it must make the parsing a fair bit harder, as there more contexts to track.

If you can handle easliy handle some cases, then why not write them?
But if it’s bogging you down, then just leave those cases as TODOs.
IMO If someone really wants code folding to support period as END, then let them write the TODOs.

Because of my history with other editors that fail to handle periods in place of END for code folding, I’ve personally come to consider a period as an END as a code smell. So much so that I’ve considered asking for a pragma that removes support for periods as END, but SV has much higher priorities and I don’t want to distract them.

Just my 1/50 of a dollar :wink:

(strange, I had to hit refresh, for a typo fix to appear)

3 Likes

I agree with Mark. I haven’t used . for END in many years.

1 Like

I certainly use one-liners like that

  if errorcode() then break.

having said that, I don’t use VS Code so I am not the intended audience.

1 Like

To each…
I dumped the dot years ago and use END for one-liners also

if errorcode(); BREAK; END
! or even
if x# = 1 THEN message('one') ; x# +=1; else x#=3; message('x#='&x#) ;END

Hi,

For sure, I only use the “.” for one line IFs…
BTW, please add support for SublimeText… Thanks!

FYI SublimeText does have code folding in clarion, based on indentation vs an understanding of the language.

To be honest I rarely it’s code folding, despite spending quite a lot of my coding time in SublimeText.

Are you aware of the Clarion Package for Sublime Text?
Clarion - Packages - Package Control

ha ha, to each indeed, I dumped END years ago and only use .

Hi,

Yes! I use the Clarion package and works very well (thanks, fushnisoft!)
I use the code folding some times, when I want to read my code on a higher level…
On the old 2k years, I used TextPad and it had Clarion definition files. They are from 2000, but maybe could be of any help…
Here:
TextPad addons