Title: Re-factoring The Clarion Dictionary Part 3!

Date: August 30 2013
Clarion Date:

Download Recording

Hosts: Arnold Young, John Hickey, Lisa Daugherty, Mike Hanson


Mike Hanson
Mark Goldberg


Our continuing series on re-factoring the Clarion dictionary continues! Plus, some exciting CIDC updates and news on the upcoming Clarion Exchange!

Bonus! Mark Goldberg will be joining us to demonstrate how he's started to re-factor the Ultimate Debug class to make it even better! It's a re-factor party!

Webinar Notes:
From Mark Goldberg:

During the webinar on friday, we started talking a bit about the environment I'm using www.SublimeText.com (ST) It's an editor that is extremely configurable, and extendable. We already have some support for clarion: syntax highlighting, also compiling with error navigation. It's far easier to open source and navigate around it than anything else I've seen.

While it does have autocompletion, we have yet to "teach" it enough about CW for it to understand scoping and prefixes, but I'm certain it does have necessary hooks to eventually support it. In any case, for folks working with embeds, you have no choice as to what editor you use.
OTOH if you have external modules, classes, hand code projects, or just want to look at source that ships from SV or 3rd parties, it's an excellent choice.
I said a couple of things that I'd like to change my answers.
While talking about strengths of the SV.IDE vs. ST, I mentioned that FindAll Results Pane of the SV.IDE
I said that ST didn't have that..
I was wrong, it does have it, and it's more powerful.
  • - more control over which files are search
  • - option to show context around a match (a couple of lines above/below)
  • - choice to show results in a pane, or in an editor buffer (as another tab)
in the editor, there is code folding by file, there are hyper links to the locations, you can perform searches on the results. You can navigate to Next/Prev result using keyboard short cuts (same as next/prev compiler error)
I was asked about Version control system (VCS) integration
I had a package installed to give access to my Hg stuff, and tried to show a diff, but it failed. It turned out the file I was trying it on, had no differences.
I also discovered one of the packages installed a menu tools->hg with a TON of choices, including some things I don't know how to do inside of TortoiseHg !!
There are quite a few VCS packages for available packages (including clarion), see https://sublime.wbond.net/

In any case, I really wanted my version control to show changes to the file, as I'm editting it. I found this package: https://sublime.wbond.net/packages/VCS%20Gutter

and after I also found that I needed a command line [diff] program found at http://gnuwin32.sourceforge.net/packages/diffutils.htm

I now have little symbols in the gutter (to the left of the line number). See the screenshot with the VCS Gutter package. Note: you have full control over the colors.

I was also asked by Dave Harms about replacing all [Do] with [DO], but just of routine invocations
I talked about using KSS to do that, and that is certainly a great approach. Rick Martin suggested here in the skype chat that I use RegEx, and quite frankly that is an excellent idea.
So in SublimeText (ST):
And that works... But it feels hard, and I've replaced white space (which might be a tab) with a space much simpler:
So in SublimeText (ST):
  • - FindInFiles
  • - Turn on Whole Word
  • - Search for [Do]
  • - Set your Where (which files) as desired
  • - Replace With [DO]
  • - Replace All
Now the subject of replacing Do with DO is really just a tiny corner of the real subject
Which is... making source code uniform
The goal is to have:
  • - all key words be exactly the same, let's say Upper Case
  • - indentation follows standards
  • - consistent use of tab or space for indentation
  • - trim trailing whitespace on each line
  • - ensure each file has a newline at the end (VCS systems like this)
  • - consistent newlines (Windows style)

I believe all of this is possible, using ST
One trick part with many systems, will be setting keywords to upper case, but NOT messing with the contents of string literals
In other words: MESSAGE('What do you want to do?') should NOT be changed to MESSAGE('What DO you want to do?')
ST has an advantage here, in that you can use it's scoping system (part of the language syntax) to limit selections.
Before just heading off, and writing something from scratch I'd first look for packages that sound like they do what you want (albeit for languages other than clarion) and see if those can be updated.
I think some of the keywords to search on are:
  • - Formatting
  • - Tidy
  • - Lint (not quite the same subject, but one that I'm interested in)

Also Note: we created a Skype Chat for SublimeText, please make requests to be added to it in the ClarionLive Skype Chat.


Old Business: None

New Business: None


Topics Covered:


Additional Downloads: None

Slide Show:

Time Events:

Webinar Introduction

Webinar Recording

Fourth Rule Of The Webinar:


comments powered by Disqus