owenG
home learn tableau about
divider
legalific swsom swsom diagram swapps ahk ue








UltraEdit

Where

The two .uew (UltraEdit wordfiles) files can be downloaded from here. In version 15+ of UltraEdit the files can be dropped in the appropriate location as-is, see their powertip for further information. Earlier versions have a single wordfile that contains definitions for various languages, see the v14.20 and earlier powertip for details on adding the contents of the .uew files to the common wordfile.

What

Within UltraEdit, syntax highlighting support for CT Summation .vs script files and LexisNexis Concordance Programing Language (CPL) .cpl files.

UltraEdit is a popular (and powerful) text editor, with support for HTML, hex, XML and a whole lot more - see their website for more details. One of the program's features is support for syntax highlighting, which allows for language-specific keywords to be color coded and auto-corrected within the editor itself (I believe the 'Auto Correct Keywords' feature is disabled by default). The specifics for each language are contained within what UltraEdit calls a wordfile and the application installs with support for several languages (13 as of v15.00), with a whole bunch more available on their Extra Downloads page as add-ons.

The advantage of syntax highlighting is most evident once one begins to code in a supported language but the below screenshots may also help in understanding the benefits.


divider element

.vs/Summation

Code snippet of a Summation script, displayed as simple text without any syntax highlighting:

vs script snippet without syntax highlighting

Same snippet as it might appear with keyword highlighting once applicable wordfile is in place:

same vs snippet with syntax highlighting

The above example uses a modified version (VBScriptVs.uew) of the VBScript wordfile available on the UltraEdit website. The original VBScript definition came with separate sections for groupings of keywords particular to that language. I added some new sections for words specific to Summation, with a set of keywords also being added directly to the existing VBScript 'Objects' grouping. Within the Syntax Highlighting section of UltraEdit's Advanced Configuration the various sections have been set with distinct colorings (selected colors are for screenshot purposes only, I usually have most groups appearing in blue):

  • The Statement/Operator section includes 'If' and 'End' and color = blue
  • Strings are colored maroon
  • Comments are teal and italicized
  • Objects, which includes both VBScript and Summation objects/collections, are purple and bolded
  • Summation properties are green and bold, VBScript's own properties are orange
  • Summation methods are fuchsia and bold

As noted above, the syntax highlighting includes limited auto-correction. The effect is that casing on keywords will be conformed to the casing of the keyword as defined in the wordfile e.g. the VBScript ReDim keyword is defined with exactly those characters and if that word is typed as 'redim' it will be auto-replaced with 'ReDim'. This feature won't work too well when '.' characters separate keywords, where text that was originally entered as db.defaults.mediacol will be auto-corrected only to DB.defaults.mediacol. The applicable color-coding will then only appear for a given keyword when it exists in the editor with the correct casing.

One shortcut that can be employed when working with .vs files in UltraEdit involves the editor's 'Run Windows Program' feature, which can be activated via the Advanced menu or F10 key. The '%f' variable to be used in the resulting Command box represents the currently active file and you would precede it, in the case of .vs files, with the path to the main sw32.exe executable (need a space between). For a standard mobile installation of Summation the text to enter would be something like "C:\Program Files\Summation\Blaze\sw32.exe" "%f" where the quote characters are used to ensure any spaces in either file path don't cause problems.
Run Windows Command screenshot
Click OK and the script will be executed through Summation, just as if the script were being run in the Scripting window. Optionally, the script could contain the (Application.)BringWindowToTop method so that the Summation window is activated once the script runs, sending UltraEdit to the background. If working on a .vbs file within UltraEdit the Windows Program to run would be wscript.exe (don't need to enter any pathing information for this .exe).
It does not appear as if the same methodology will work with the Concordance executable, as it will try to open up a new instance instead of working upon the already open program.

divider element

.cpl/Concordance

Code snippet of a CPL, displayed as simple text without any syntax highlighting:

CPL snippet without syntax highlighting

Same snippet in UltraEdit with wordfile:

same CPL with syntax highlighting

There are seven sections in the CPL wordfile, CPL.uew. For screenshot the colors were set as:

  • The Reserved Words section (e.g. 'if', 'else') = blue
  • Strings are colored gray, Comments are teal
  • Data Types are red, Numbers bright green
  • CPL Functions are fuchsia and bold

In CPL files the auto-correction is especially helpful since the language is case sensitive. Most of the functions, even those that are compound words, are entirely in lower case while a subset are lower camel cased. Trying to run 'messagebox' will fail as Concordance regards it as entirely different from 'messageBox', which is the correct set of characters for that particular function. On the other hand, 'getnumber' really should be entered that way, entirely in lower case. With auto-correct running (it is turned off in default installation of UltraEdit), the incorrect 'messagebox' string would be replaced almost instantly by 'messageBox'.

How

CT Summation VBScript and .vs files

The Summation wordfile exists as a modification of the VBScript wordfile available from the UltraEdit website. It made sense to use the existing VBScript definitions since Summation script files are most often written using the VBScript language and may have .vs (for scripts run internally within Summation) or .vbs (typically accessing Summation via CreateObject) file extensions. There were essentially four steps to updating the VBScript wordfile for Summation:

  1. Added 'VS' as a file extension, in addition to existing VBS and WSF
  2. Added an alphabetized list of the objects and collections available within the Summation scripting object model to the existing section for VBScript 'Objects'
  3. Added an alphabetized list of Summation properties to a new 'SwProperties' section
  4. Added an alphabetized list of Summation methods to a new 'SwMethods' section

I had initially created a separate 'SwObjects' section for those keywords but found that (my) UltraEdit was only fully supporting the first eight sections (C1 - C8) that appeared in the language definition. The version of UltraEdit I was using is a few years old and it is possible newer releases would be OK with a C9 for only the SwObjects. Also, there is some overlap in the SwProperties and SwMethods - both within those two sections themselves (e.g. 'ExpandAll' appears in both) and across the existing VBScript sections (e.g. Left is under VBScript Functions and under SwProperties). Cleaning them up wouldn't be difficult - simply save the VBScript defintion as a .vs file and, assuming different color coding for each keyword group, the second occurrences of any keywords will stand out from their immediate neighbors. UltraEdit appears to simply accept the first categorization of a given keyword and ignores later duplication.


LexisNexis Concordance CPL/.cpl files

The CPL.uew started out as the wordfile for C++, where it keeps the C++ settings for Block Comment, Function Strings, Delimiters, and Indent/Unindent Strings and inserts "CPL" as the file extension. Onto that are added seven sections, which are generally taken from the same-named categories listed in the CPL documentation:

  1. CPL Functions
  2. CPL Data Types
  3. Reserved Words
  4. System Variables
  5. Database KeyWords
  6. Constants
    • Enums that are listed under various CPL functions in the original documentation, plus TRUE/FALSE
  7. Operators