Modern computer programming languages allow applications to be built using re-usable containers of variables (properties) and procedures (methods) called objects. Omnis Studio implements many of it's standard components ("formats" in Classic) as object classes, and enables developers to implement their own, in order to extend the hierarchical model for an application. This has benefits of code re-use and improved maintainability. The area of Object Oriented Omnis (OOO) has become a dark art in its own right, with various tricks for improved efficiency in the implementation of inheritance, polymorphism, dynamic binding and so on. But, it's worth noting that you DON'T HAVE TO USE OBJECTS, and a "traditional" Omnis Classic procedural approach will still work nicely, allowing development teams to come to terms with OOO at their own rate.
For a more detailed introduction to OOO, you can view an excellent PowerPoint presentation, prepared by Geir Fjaerli and Mark Phillips.
There is more of an emphasis on programming in Omnis Notation ($dollar commands) when using Studio, SQL and the Web. The power of notation has been increased, and you can now do virtually anything using the little dollars. For example, compare the following code:-
Set current list #L1 Define list (#1,#2,#3) Add line to list (1,1) Add line to list (2,2) For each line in list Load from list Calculate #3 as #1*#2 Replace line in list End For
Do #L1.$define(#1,#2,#3) Do #L1.$add(1,1) Do #L1.$add(2,2) For %i from 1 to #L1.$linecount Calculate #L1.[%i].#3 as #L1.[%i].#1*#L1.[%i].#2 End for
Both of the above examples will work with either Omnis Classic or Studio, but the latter is more future-safe, as it doesn't use either the current list, or the current list line (#L). In the scope of a multi-user web application server this can be very important.
Manipulating lists is central to data handling and presentation, and Omnis Studio contains some powerful list features:-
Do MyList.$smartlist.$assign(kTrue) Do MyList.$filter($ref.Value>5000) ;List contains only records > $5,000 Do MyList.$filter($ref.Date<"1 JAN 2000") ;List contains only records before 2000 Do MyList.$unfilter(1) ;List back to first filter level
For %i from 1 to MyAccountList.$linecount
If MyAccountList.[%i].$balance()>5000
Do MyAccountList.[%i].$bonus()
End if
End for
Do MyAccountList.$sendall($ref.$bonus(),$ref.$balance()>5000)
Do #L1.$sendall($ref.#3.$assign((%i.$assign(%i+1))*#L1.[%i].#1*#L1.[%i].#2)
Omnis Studio contains many more powerful and interesting features. For more information, see Further Reading
Document prepared 8 AUG 2000 by Tim Stewart