In my last post I described how we can add expression elements, such as variable and column names, to an expression with very few keystrokes when we are certain of the item name we want to use – and we are certain of how that name is spelled. But there is another keyboard-accessible source for inserting such names that is nearly as fast – and that is very useful when we are NOT certain of the name we need or of its spelling. This is one of the many uses of:
The Catalog in the Omnis Studio IDE is a window that we can open or bring to the front at any time in the development process. It provides us with interactive access to a variety of expression elements arranged by category. The categories are shown as the names of the tabs on the two-column tab pane that fills that window. Those categories are, from left to right:
Each pane displays two columns of lists. The column on the left displays a list of subcategories for the selected category tab and the column on the right displays a list of the members of the subcategory selected from the list on the left.
For this blog post, we’ll limit the discussion to the first tab – the Variables pane. But that is the one most frequently used – and it has the most relevance to our current thread.
At first glance, this appears to be some sort of data dictionary. But the Catalog is much more than a data dictionary of table and column names. Virtually ANY element that can be placed in an expression, beyond the basic operators, is accessible through the Catalog – so we could think of it as a “Component Store for Expression Elements”. But since variables are probably the most often used elements, they are put in the most convenient place: the first Catalog tab.
How does this help us as we are writing code for our Omnis Studio library? We can access any item listed in either of the two columns of the current pane directly from the keyboard as part of our expression entry workflow. Here’s how that works:
While typing an expression into any calculation entry area within Omnis Studio, a simple keystroke combination of Command-9 on a Mac – and an even simpler one on Windows where it’s only a press of the F9 key – launches the Catalog window if it is not already open or brings it to the front if it is. The first time we do this after launching Omnis Studio itself, Variables is the current pane, the Task item in the left column has already been selected (by being the first item in that list) and the focus is in the right column with the first item there selected (if there are any items in that column to select).
While it appears on the surface that we’ll need to grab the mouse and start clicking to use this window, Omnis Studio has additional features that allow us to keep our hands on the keyboard. Suppose that we need to get the name of an Instance variable, but we need to see that list to remind us of the ones that are available for the context where we invoked the Catalog – which might have been the “Field name” entry area for a Calculate command in the Method Editor for a specific remote form class.
Here’s how we would proceed
First, we’d press the Tab key, which switches the focus into the column on the left side of the Catalog. We would then type “i” because the first item in that list that begins with “i” is “Instance”, which is the category we want. We then type the Tab key again to get back into the right side list. When we see the variable we want, we simply type the first few characters of that item to select that line of the list. We could also use the arrow keys, but typing characters is often faster because Omnis skips right to the first line matching the string we typed. We can also use the asterisk as a “wild card” character. When the item we want is highlighted, we simply hit the Return/Enter key and that variable name is placed in the field we were in when we invoked the Catalog. The focus is now in that field and the Method Editor window is now the front window again.
It’s much faster to do than to explain
The Catalog window remains open. The next time we invoke it (as long as we haven’t closed it in the meantime), the Variables tab will still be the current one, the Instance category will still be selected and the right column will still have the focus. So as long as we need the name of another Instance variable, the process is even faster the next time we use it!
Remember, this is for situations where we aren’t sure of the name of the item we want. If we had known the variable name, we could have simply used Tab Completion as described in my previous post. Both techniques apply ANYWHERE within our Omnis Studio library where we need a pointer to a variable – so anywhere we are working on a live expression or anywhere we need a reference to a variable that is in scope, such as the “data name” property for a field that we are supplying in the Property Manager window.
These first five posts to our blog all support my assertion that a seasoned Omnis Studio developer can generate more code with fewer keystrokes than a seasoned developer in most other languages or environments. And they are intended to help newcomers who are just beginning to evaluate Omnis Studio understand that even in this GUI programming environment, a properly educated Omnis Studio developer can do a great deal without ever having their hands leave the keyboard. And less time is required for debugging because we generally don’t have to worry about spelling or syntax errors.
But there will be times when we need to go looking for programming elements whose names and features we don’t know. Again, Omnis Studio provides some useful tools for these situations as well. I will introduce one of those in my next post.
Posted by: David Swain