User Language: Difference between revisions
mNo edit summary |
|||
Line 1: | Line 1: | ||
'''User Language''' is the internal language of the <var class="product">[[Model 204]]</var> DBMS, a product of [http://www.rocketsoftware.com/m204 Rocket Software]. It | '''User Language''' (renamed '''SOUL''' in version 7.5 of Model 204) is the internal language of the <var class="product">[[Model 204]]</var> DBMS, a product of [http://www.rocketsoftware.com/m204 Rocket Software]. It is a 4th Generation Language (4GL), which means it was designed to be a "high level" language, with a good deal of abstraction and power embedded in relatively simple programming directives. | ||
<var class="product">User Language</var> is characterized by its very easy, English-like syntax and its tight integration with the <var class="product">Model 204</var> DBMS. Programs begin with a " | <var class="product">User Language</var> is characterized by its very easy, English-like syntax and its tight integration with the <var class="product">Model 204</var> DBMS. Programs begin with a "Begin" statement and end with "End": | ||
<p class="code">Begin | |||
PRINT 'HELLO WORLD' | |||
END | |||
</p> | |||
Because it is tightly integrated into <var class="product">Model 204</var>, <var class="product">User Language</var> contains native instructions for manipulating data held in <var class="product">Model 204</var> files. Records in a file are selected using variations on the '''FIND''' statement and can be looped over using a variety of structures, the main one being the '''FOR EACH RECORD''' loop. | Because it is tightly integrated into <var class="product">Model 204</var>, <var class="product">User Language</var> contains native instructions for manipulating data held in <var class="product">Model 204</var> files. Records in a file are selected using variations on the '''FIND''' statement and can be looped over using a variety of structures, the main one being the '''FOR EACH RECORD''' loop. | ||
Line 17: | Line 17: | ||
END | END | ||
In <var class="product">User Language</var>, variables begin with the percent sign (%) and native "functions" | In <var class="product">User Language</var>, variables begin with the percent sign (%), and native "functions," which implement many complex features of the language, begin with a dollar sign ($) (or a pound-sign in England or a Yen sign in Japan). | ||
<p class="code">BEGIN | |||
%X IS FLOAT | |||
FOR %X FROM 1 TO 10 | |||
IF $MOD(%X,2) THEN | |||
PRINT %X WITH ' IS ODD' | |||
ELSE | |||
PRINT %X WITH ' IS EVEN' | |||
END IF | |||
END FOR | |||
END | |||
</p> | |||
A wide variety of variations are possible with the language, allowing novice coders to start using the language quickly, and expert users to learn the shortcuts and abbreviations. | A wide variety of variations are possible with the language, allowing novice coders to start using the language quickly, and expert users to learn the shortcuts and abbreviations. | ||
Line 37: | Line 36: | ||
==Sirius Software extensions to User Language== | ==Sirius Software extensions to User Language== | ||
Any <var class="product">Model 204</var> site with the <var class="product">[[Sirius Mods]]</var> linked in, gains a number of enhancements to <var class="product">User Language</var>, the most obvious one being [[Mixed-case User Language|mixed-case User Language]]: | Any <var class="product">Model 204</var> site with the <var class="product">[[Sirius Mods]]</var> linked in, gains a number of enhancements to <var class="product">User Language</var>, the most obvious one being [[Mixed-case User Language|mixed-case User Language]]: | ||
<p class="code">Begin | |||
print 'Hello World' | |||
End | |||
</p> | |||
The Sirius-added Object-Oriented additions to <var class="product">User Language</var> let you write sophisticated applications using a range of classes, some provided by Sirius and others that you can write locally. The Object-Oriented additions to <var class="product">User Language</var> were contained in the <var class="product">[[Janus SOAP User Language Interface]]</var> prior to version 7.5 of <var class="product">Model 204</var>. | |||
Sirius | |||
For a non-exhaustive list of <var class="product">User Language</var> enhancements, some available throughout the <var class="product">Sirius Mods</var> and some exclusive to the <var class="product">Janus SOAP User Language Interface</var>, see [[Janus SOAP User Language Interface#Non-OO User Language enhancements|"Non-OO User Language enhancements"]]. | For a non-exhaustive list of <var class="product">User Language</var> enhancements, some available throughout the <var class="product">Sirius Mods</var> and some exclusive to the <var class="product">Janus SOAP User Language Interface</var>, see [[Janus SOAP User Language Interface#Non-OO User Language enhancements|"Non-OO User Language enhancements"]]. | ||
Sirius also | Before its emphasis evolved to the development of classes, Sirius also provided a large set of <var class="product">User Language</var> $functions. These $functions and classes range from simple functions useful in the language (<var>[[$Parse]]</var> and <var>[[$ParseX]]</var>) to complex structures and constructs like <var>[[Stringlist_class|Stringlists]]</var> and <var>[[Daemon class|Daemons]]</var> that open up new ways of programming and new possibilities for managing complex, in-memory data manipulation. | ||
In addition, many of the Sirius extensions to <var class="product">User Language</var> | In addition, many of the Sirius extensions to <var class="product">User Language</var> support the [[Sirius Software product list#janus|Janus product set]], which provides access to <var class="product">Model 204</var> via HTTP, sockets, Sybase Omni servers, FTP clients, and more. | ||
==See also== | ==See also== |
Revision as of 18:38, 10 May 2013
User Language (renamed SOUL in version 7.5 of Model 204) is the internal language of the Model 204 DBMS, a product of Rocket Software. It is a 4th Generation Language (4GL), which means it was designed to be a "high level" language, with a good deal of abstraction and power embedded in relatively simple programming directives.
User Language is characterized by its very easy, English-like syntax and its tight integration with the Model 204 DBMS. Programs begin with a "Begin" statement and end with "End":
Begin PRINT 'HELLO WORLD' END
Because it is tightly integrated into Model 204, User Language contains native instructions for manipulating data held in Model 204 files. Records in a file are selected using variations on the FIND statement and can be looped over using a variety of structures, the main one being the FOR EACH RECORD loop.
BEGIN X: IN FILE INVENTORY FIND ALL RECORDS FOR WHICH ITEMTYPE = 'BOOK' END FIND FOR EACH RECORD IN X PRINT TITLE AND AUTHOR AND PUBLISHER AND PRICE END FOR END
In User Language, variables begin with the percent sign (%), and native "functions," which implement many complex features of the language, begin with a dollar sign ($) (or a pound-sign in England or a Yen sign in Japan).
BEGIN %X IS FLOAT FOR %X FROM 1 TO 10 IF $MOD(%X,2) THEN PRINT %X WITH ' IS ODD' ELSE PRINT %X WITH ' IS EVEN' END IF END FOR END
A wide variety of variations are possible with the language, allowing novice coders to start using the language quickly, and expert users to learn the shortcuts and abbreviations.
Model 204 provides its own terminal services, and User Language procedures are typically stored in Model 204 database files, so User Language programmers usually work directly inside the database environment, opening database files at the command level, editing User Language with Model 204's internal editor, and running programs with the "GO" directive from inside the editor.
It is also possible to access Model 204 from external programs using Host Language Interfaces or Model 204's SQL capability but, because User Language is so highly optimized, the majority of Model 204 applications are written in User Language.
Sirius Software extensions to User Language
Any Model 204 site with the Sirius Mods linked in, gains a number of enhancements to User Language, the most obvious one being mixed-case User Language:
Begin print 'Hello World' End
The Sirius-added Object-Oriented additions to User Language let you write sophisticated applications using a range of classes, some provided by Sirius and others that you can write locally. The Object-Oriented additions to User Language were contained in the Janus SOAP User Language Interface prior to version 7.5 of Model 204.
For a non-exhaustive list of User Language enhancements, some available throughout the Sirius Mods and some exclusive to the Janus SOAP User Language Interface, see "Non-OO User Language enhancements".
Before its emphasis evolved to the development of classes, Sirius also provided a large set of User Language $functions. These $functions and classes range from simple functions useful in the language ($Parse and $ParseX) to complex structures and constructs like Stringlists and Daemons that open up new ways of programming and new possibilities for managing complex, in-memory data manipulation.
In addition, many of the Sirius extensions to User Language support the Janus product set, which provides access to Model 204 via HTTP, sockets, Sybase Omni servers, FTP clients, and more.
See also
- User Language documentation (the former User Language Reference Manual)
- Additional Sirius Software User Language extensions: "Other User Language enhancements"
- Other Model 204 documentation: