Showing posts with label OmniScript. Show all posts
Showing posts with label OmniScript. Show all posts

Sunday, April 17, 2016

Notepad++ and OmniScript

Writing OmniScript in the default application, OmniStation, soon had me longing for something more. In that application there are no helps for the programmer. There is no language color coding and no hotkeys. Then I got on a big project developing a new website and we were introduced to a browser based scripting tool that does have some color coding. This was a welcome addition but this scripting tool also had some limitations and still no hotkeys. So I still wanted something more. Enter Notepad++.



Language Support


I had come across Notepad++ earlier but at that time I wasn't doing any programming so I didn't fully appreciate what it could do. Naturally there was no pre-programmed Notepad++ language support for OmniScript. So I set about setting up a user defined language for OmniScript. With colors for if/ ends, loop/endloops, routines, functions, comments and more, this made looking at and following scripts so much easier. I have continued to tweak this user defined language over the last couple of years and a growing number of scripters on our team are using it and Notepad++. It's worth having to paste script back into OmniStation over and over to be able to use the benefits of this great text editor.  



Other Great Features


Other great features of Notepad++ have made it one of my favorite programs of all time. The hotkeys are a great time saver. I constantly use them to delete or duplicate and move whole lines. Indenting or un-indenting whole sections at once has been another great benefit. And then there are the search features. Simply double clicking on a word and having all other such occurrences of the same word in that file automatically highlighted has been a huge help in avoiding and finding errors. Searching for all occurrences in one file or all open files has been wonderful for making changes or just tracing the flow of a program. I regularly have 30+ component scripts open at the same time and I can't say enough about being able to so easily search for all occurrences of a variable or term across all scripts at the same time, with all of the results so nicely cataloged for me. On top of all of that there are the great plugins.


I am constantly singing the praises of Notepad++ to my co-workers. I have often said that I want a Notepad++ shirt to wear. It has become goal of mine to at one point contribute to this great program.


i++

Sunday, April 10, 2016

OmniScript Containers

One of the best features in OmniScript is what is known as Containers. The closet thing I can compare them to is a table in a database, such as Microsoft Access. The same thing could be accomplished with a multi-dimensional array but the container structure ties everything together very nicely and makes it very simple to set up and work with.

Creating Containers

When you create a container in OmniScript you declare the length of the key for each record as well as how many of each type of field you will be using in the container. As with OmniScript variables, there is only one type of numeric field but there are three different types of text fields based on the length of the string.  There are 10 byte, 40 byte and 200 byte text fields. So you determine how many of each field you will need and declare them in the container create statement.

Adding and Updating Container Records

Once the container is created you can add records or update existing records based on the unique record key. Numeric fields can be set or added to or subtracted from. Text fields can only be set but through a two step process you can read what is in them, append to that string, and then reset them. Any record fields that are not set when the record is added to the container default to 0 for numeric fields or null for text fields.

Because each key is unique and the records in a container are sorted by the key, containers are useful for both sorting and consolidating duplicates.

Accessing Container Records

Individual records in a container can be accessed with a get statement by specifying the record key.

Just like with the built in sets of records in the recordkeeping database you can loop through the records in a container. You can either loop through all records or you can use a key prefix to only loop through the records that have a key starting with the string provided. This allows you to create one container with a primary set of records and then create a second container that has a varying number of records that relate to the records in the first container, in a one to many relationship. The key of each item in the second container begins with the key of the corresponding item in the first container.

And so then you can loop through the first container and for each item in that container you loop through the second container with the key of the first container being used as a keyprefix for the loop on the second container.

Cleaning up Containers

Naturally, container items can be deleted and containers can be emptied and reused as needed. When you are done with them it is also important to destroy containers to clear them out of memory and free that memory up.


Containers are definitely one of the strengths of OmniScript and a very useful tool in managing data.

i++

Sunday, March 13, 2016

OmniScript and Other Languages

As I shared in my last post, OmniScript is a proprietary, server-side, interpreted scripting language for the OmniPlus System, a COBOL based financial application. Like any language, as I've been learning, OmniScript has it's strengths and weaknesses. There are some things it naturally does very well in dealing with the data structure of the OmniPlus system, and, as I've been learning about other languages, I'm seeing some of OmniScript's limitations (at least with my limited knowledge anyway).

Language Learning


In college I took two years of Greek. I found learning this ancient language, with it's different letters,fascinating. One interesting thing I found was that learning Greek had the added benefit of helping me with my English. The fresh experience of seeing grammatical concepts in Greek gave me a better understanding of similar concepts in English that I had taken for granted for the most part.

When it comes to OmniScript, my early understanding of BASIC helped to prepare me, and as I've spent time since learning Java and a little Python, that has given me a clearer understanding of the concepts I'm using in OmniScript. Studying Java through Stanford's Programming Methodology course online has made me a better OmniScripter. It's interesting to learn and compare the similarities and differences in languages and it makes me a better writer of whatever language I'm working with.


i++

Sunday, March 6, 2016

My Introduction to OmniScript

In my retirement services recordkeeping job I worked mostly in Microsoft Access for the first 15 years or so. Due to that nature of the group of retirement plans that my department did the reocrdkeeping for, we had to perform the annual compliance testing on the plans outside of the main recordkeeping system, OmniPlus by SunGard (now FIS). Therefore my main job was maintaining and developing a growing Access database. But then when some changes came in 2011, I started in a new role shortly after I went back to working there fulltime. In these first 15 years I had limited experience with gathering and exporting data from the OmniPlus system. Then in 2012 I officially joined the technical team and began writing OmniScript fulltime.

OmniScript

What is OmniScript? OmniScript is a proprietary, server-side, interpreted or compiled scripting language for the OmniPlus System, a COBOL based financial application. It is a VBA type scripting language which provides access and update capability to the OmniPlus database, and access to internal operations.

When I started, I knew next to nothing about the scripts I started looking at. There were no good training materials available to me so my training was much like getting dropped into the pool to learn how to swim. Thankfully my past experiences with programming, limited as they may have been, provided a good foundation for learning this new language.

My first tasks were making modifications and enhancements to existing processes and reports. With each one I studied what was being done in the scripts, tracing the structure and flow. I quickly got a sense of things and soon came to enjoy scripting. 

Less Visual (sort of)

Because my work with Access was much more visual than looking at code and seeing data showing up in files and transactions, I was unsure at first if I would like it as much. Now though, I can say that I enjoy writing code more than anything else I have done. I like designing and structuring the logical flow needed to gather data and accomplish tasks. While I spend a lot of time just looking at text, in my mind I'm visualizing the structure of my program, seeing how the many details work together, step after step, to accomplish what's needed.

As I modified scripts and wrote new things I learned about OmniScript quickly. Neither my boss nor I expected it, but within six months I was assigned with writing a whole new product we wanted to offer our clients. I'll write more about that and OmniScript in future posts.

i++