[Omnis-Newsletter] Omnis Technical Newsletter
omnis-news-admin@omnis.net
omnis-news-admin@omnis.net
Wed, 21 Mar 2001 13:16:14 -0000
Omnis Tech Newsletter March 21st, 2001
========================================
UNSUBSCRIBE OPTIONS: You have been sent this email because you have directly
signed up for, or expressed an interest in receiving a technical newsletter
when you downloaded an evaluation of Omnis Studio, or registered the Lite
version of Omnis Studio. If, however you feel you have received this email
in error you can unsubscribe as well as change your subscription options at
www.omnis.net/newsletter.
N.B. If you subscribed by checking a box on one of our forms, you will not
have received a password. You will need to submit your email address at
www.omnis.net/newsletter and select the 'email me my password' option on the
next page in order to receive this.
========================================
Welcome to this the first issue of our Omnis Technical Newsletter. Published
fortnightly, it is intended for Omnis developers of all levels and
experience and for those people evaluating Omnis Studio. We think you'll
find the content both interesting and useful for your Omnis development
needs and hopefully it will help you become more productive in Omnis
application design. The first article 'Building your first Omnis Studio
application' steps you through creating a very simple application, and the
other 'Literals vs. Expressions' discusses the difference between text and
variable values and how to represent them in Omnis Studio. You may find it
easier to work through the exercises and examples in this newsletter by
printing it out before you begin.
CONTENTS:
-About the Authors
-Building your first Omnis Studio application
-Studio Quick Tip
-Literals vs. Expressions
-About Omnis Studio
-A word about our web site
-Copyright and Unsubscribe details
========================================
About the Authors
The Omnis Technical Newsletter contains high quality content from two
leading and well respected Omnis developers, Geir Fjaerli and David Swain.
Geir Fjaerli is based in Norway and has been an Omnis professional developer
for many years as well as a Regional Sales Manager for Omnis. He is
currently working freelance again developing a range of products (in Omnis
of course) including his Prophet5 sales and customer relationship management
solution, soon to be released for MacOSX.
David Swain is the founder and president of Polymath Business Systems, for
many years a leading provider of Omnis training. His expertise in Omnis
programming and his ability to make complex concepts understandable are
recognized throughout the worldwide Omnis community.
========================================
Building your first Omnis Studio application
By Geir Fjaerli, Sunshine Data
Email: geir@sunshinedata.net
Web: www.sunshinedata.net
----------------------------------------------------------------------
Q: I just got a copy of Omnis Studio, and I don't know where to start.
A: Well, first of all you need to get it installed. As Omnis comes with easy
installers, I will assume you have done that already.
So, now you want to get going on your first application. There are actually
things to consider before you get that far, we shall discuss the
preparations for a successful application project in coming issues. But for
now, let us just see if we can get the thing running.
Note: The following assumes you have a knowledge of your operating system,
and GUI techniques such as click and double-click, drag & drop and file
dialog navigation.
There are a number of files in the Omnis folder/directory. We shall cover
these as well in coming issues. But the one to focus on now is the Omnis
program file: it is labeled Omnis Studio 3.0 (or above). Depending on your
installation choices you may have an icon on the desktop or in the Start
menu (Windows). If not, you will find it in the folder where you installed
Omnis, for example, C:\Program files\Omnis Software\OS30.
--> Start Omnis Studio.
When you open this you will see a splash screen while Omnis loads, and then
the "welcome" screen. (Unless you have started Omnis before and turned this
option off.) Here you will find choices like "New users", "Knowledge store",
"New library" etc.
--> Click the "New library" button.
A "library" is a file that holds all your application elements and logic,
like the windows and reports, menus, data structure and code. The data will
be stored somewhere else, either in a datafile, locally or on a server, or
in a database server like Oracle or Sybase. Your application can have
several libraries, but for now we will only use one.
Once you click "New library", a file dialog opens to let you name your
library and where to create it.
--> Select folder/directory
--> Name your library
Use the dialog to navigate to the folder you want to keep your library in,
and name it "Hello world" (without the quotes). The library can be stored
anywhere, it does not have to be inside the Omnis folder. Leave the file
type as suggested (.lbs)
--> Click OK
The New library dialog will now close, and you will see two windows:
-The Browser, with the title "Libraries".
The browser window is the list of all our application objects. At the moment
it is on the top level, showing the currently open libraries. We only have
one, so that is the only one listed.
-The Component Store.
The component store contains the components (objects) that we can add to a
library. Since the Browser currently displays libraries, the Component Store
displays objects we can add to a library. As we shall see, the contents of
the Component Store changes to reflect the current level we are working on,
so it will be different if we are designing a window or a report.
TIP: The file browsers in Studio can be customized to your preference. For
now, leave them as is, so you do not get confused by your screen looking
different from what is described here.
--> Open the library to display its classes.
TIP: You can open a library or other application object by double-clicking
its icon or name, by clicking the Open icon in the browser toolbar, or by
selecting open in the "Library" Menu.
Studio will now open a second browser window showing the contents of the
Hello World library. This is what we call the classes of the application. A
class can be a menu, window or report, or a number of other types of class.
At the moment it only displays one, called "Startup_Task".
(The Startup_Task contains "kickstart" code that is run when the user opens
the library in runtime. For now we just leave it.) (Any new library will
also contain a number of so-called System tables. These are date formats,
font tables, icons and more. Since we normally won't worry about these most
of the time, they are currently hidden. More about System tables later.)
Now look at the Component Store. It is currently displaying the different
classes that you can add to your library. You will see it is divided in two
by a horizontal inset line. The top row of icons let you navigate between
different types of classes, including template classes and wizards that help
you create certain classes. Bring the Component Store to the front and move
the cursor over the icons to see helptips describing their purpose. For now,
stay on the first set of icons (by selecting the leftmost icon in the top
row, the one that looks like a stack of books). The bottom part of the
Component Store will now show the basic classes that you can add:
* Windows: The onscreen display and entry windows, palettes and dialogs and
other window types, holding entry fields, buttons, lists etc.
* Menus: Your application menus to install in menu bars or to use as context
menus
* Toolbars, Reports, and a number of others that we shall discuss later.
--> Click and drag the New Window icon and drop it onto the browser.
If you are not familiar with drag & drop, you can go to the "Class" menu in
the browser, and select the "New..." submenu and "Window".
A new window class is added to your library and shown in the browser, and
the name "New window" suggested. The name is already selected for editing,
so you can start typing directly to change it.
--> Type wHello and then press the Return key.
You now have a window class called wHello. (The "w" in front of the class
name is a convention. You don't have to use these prefixes, many do not, but
be aware that you cannot have two classes with the same name, even if they
are of a different type. So since you cannot have both a window and a report
called Hello, by using "w" for the windows, "r" for the reports and so on,
you avoid the problem.)
--> Double-click the window in the browser to open it in design mode.
In Omnis we refer to two different "modes":
* Design mode is where you create classes and add components and code.
* Runtime is the program that runs your finished application on the client
machine.
Your window will now open in design mode. By default it is small, and does
not contain any fields or buttons. TIP: Studio has a number of templates and
wizards that will allow you to create windows and other classes
pre-configured with fields and code.
You will notice that another window has opened on the right side of your
screen. This is the Property Manager. This is where you set various
attributes for your current class or component, like the name, size and
color of your window. We shall look at the Property Manager in future
issues, but at the moment let us concentrate on adding functionality to the
wHello window.
Look at the Component Store again. You will notice that it has changed.
Rather than showing class types, templates and wizards, it now shows the
various controls and other objects we can add to a window. These include:
* Entry fields; single and multi line...
* Buttons; pushbuttons, radio buttons and checkboxes...
* Lists; display list boxes, enterable grids, drop down and pop up lists...
* Tab and page panes, group boxes and more.
Again there are a number of selection icons on top of the Component Store,
they let you switch between fields, background objects, external components
and subwindows.
TIP: As mentioned above, you can configure the built-in windows of Studio to
suit your preferences. While the default is a small icon only view, you can
show large icons with text or list views instead. That may make it easier to
find your way through the Component Store. We shall tell you how in a coming
issue.
--> Add a pushbutton to your window.
The pushbutton is the icon that looks like a button and has the text "OK" on
it. To add it to the window, either drag it from the Component Store into
the window or click it in the Store and then click and drag inside the
design window. (The area you drag determines the size of the button.)
Now you have a window and a button. The button has the text "Pushbutton",
since we haven't assigned any text to it. That is not important now, we
shall cover that in our discussion of the Property Manager. Also, the button
is a standard one, with no functionality. To complete our first venture into
Omnis, let us add some code to the button so that we can see it actually
working.
--> Double-click the pushbutton in design mode.
This opens the method editor. Don't be overwhelmed by all the stuff in
there, we shall cover it in another issue. Basically it is divided in three:
* The top part lets us create various types of variables to hold values for
our window and button.
* The middle part has a list of methods on the left, sorted by which
component it belongs to, and the method text for the chosen component on the
right.
* The bottom part shows available commands on the left (only when a line is
chosen in the method text window), and parameters and options for the chosen
command (if any) on the right.
First concentrate on the middle part. At the left is a "tree list" showing
two entries: "Class methods" and "wHello_xx" (where xx is a number like
1016). This last entry is our pushbutton, and shows a child node called
$event. (Later we shall see how we can use the Property Manager to give our
pushbutton a more descriptive name other than wHello_1016.)
$event is a special kind of method that handles what we call events, that is
any actions performed in the window or the control, for example, the user
clicking the pushbutton. To distinguish between different actions and act
accordingly, you can test on which action was performed. You can see this in
the method to the right, it already contains the line:
On evClick ;; Event Parameters - pRow( Itemreference )
"On evClick" is the command that qualifies the event to act on, it means "If
the user clicked on this button". The rest of the line is a so-called inline
comment, it is there to help you understand how the command works. Inline
comments are prefixed in the code by ;;.
--> Click in the method window on the line below the On evClick command.
Now look at the bottom part of the method editor window. You will notice
that the bottom left of the window contains a number of command groups,
starting with "Calculations...", and "Parameters and variables...". The
three dots (...) means that this is a group containing several commands.
--> Add an "OK message" to the code
Use the scroll bar on the commands list to scroll down until you see a group
named "Message boxes..." Double-click to expand this one. This will reveal a
number of message types, including Ok, Yes/No and Working messages.
--> Select Ok message.
The bottom right of the method editor now displays the options for the
chosen command. For an OK message, that is the title and the message, plus
checkboxes to let you select whether you want an icon, a beep and/or a
cancel button. For now, enter "Hello World" in the Title box, and "My first
Omnis Studio application" in the message box. Now close the method editor by
clicking the close box.
You should be back in your wHello window now. To save this window select
"Save wHello" from the File menu. Omnis will also automatically save a class
when you close its design window.
We are now ready to test our application.
--> Open the window in runtime mode.
Omnis Studio applications do not need to be compiled, so we don't have to do
anything before we run it. If your window is still open in design mode, you
can toggle between design and runtime mode by simply pressing Ctrl/Cmd-T, or
selecting "Open window" from the context menu.
If the design window is not open, you can open it in runtime mode from the
browser by selecting it and then selecting "Open window..." from the context
menu.
Now your window should show an empty title bar (we didn't set a window title
but you can), and the pushbutton.
--> Click the pushbutton.
Centered on the screen you should now get a message box titled Hello World.
Your first application is finished. Congratulations!
========================================
About the Omnis Studio manuals
Full and comprehensive user documentation for Omnis Studio is provided in
PDF format on the product CD and to download from our website at:
www.omnis.net/downloads/manuals.html
Printed copies of the main manuals are available from Trafford Publishing,
an 'on-demand' publisher based in Canada. To order your Omnis Studio V3
manuals online, go to:
www2.ondemandmanuals.com/omnis.
This will take you to a list of all Omnis Studio V3 publications currently
available. You can buy the four main product manuals either individually or
as a set: the manuals are 'Using Omnis Studio', 'Omnis Programming', 'Omnis
Reference', and 'Developing Web Applications in Omnis Studio', plus a
'Getting Started with Omnis Studio' manual to help newcomers to the product.
========================================
Studio Quick Tip
By Geir Fjaerli
Q: Did you know that you can increase the font size of the Studio method
window? A: Just click somewhere in the method text/list that you want to
enlarge and press ctrl+] (Windows) or Cmnd+] (Mac), that is ctrl/Cmnd and
the right square bracket. Ctrl/Cmnd and the left square bracket decreases
the font size again. Handy for when you are doing presentations, or when
your eyes simply are not as good as they once were.
Note! Studio will only support direct key combinations with control and
command. That is you cannot combine them with shift or alt/option. This
renders the above and other shortcuts inaccessible on some national keyboard
layouts, e.g. the square brackets on my Norwegian keyboard is Alt-Gr 8 and 9
respectively. And ; (semi colon) which is used to comment method text is a
Shift+comma.
There is a workaround solution to that problem. Windows as well as MacOS
allows you to set up more than one keyboard layout in the control panel. And
they will let you assign a shortcut to cycle through the available layouts
(e.g. Alt+Shift in Windows). So to get to those shortcuts in Omnis on your
keyboard, set up English as an alternative layout, then when you need them
momentarily switch to English, type the Studio shortcut and switch back to
your local layout. Of course, you will have to learn where those shortcuts
are on an English keyboard, e.g. the square brackets are the two keys
between the P and the Return key.
========================================
Literals vs. Expressions
By David Swain, Polymath Business Systems Inc
Email: dataguru@polymath-bus-sys.com
Web: www.polymath-bus-sys.com
There are many places in Omnis Studio where you must enter what appear to be
string values. It may be for a property value in the Property Manager, a
direct option for an Omnis command or a block of text in a background object
on a window or report class. It will look like you are just typing in some
text, but what is required is, depending on the context, either a literal or
an expression. Here is how Omnis Studio differentiates between these.
A literal is a group of characters that has no special meaning within Omnis
Studio. Omnis accepts these character strings as entered (they are taken
"literally") and does not check their viability or correctness until
execution time, if at all. Often these are simply message strings or
comments, but they can also include the names of windows, menus, reports,
etc., or the pathnames of files. When a value is entered into an entry area
that expects a literal, Omnis simply stores whatever is entered as is and
with no syntax checking.
An expression is a calculation string that contains variable references,
operators, numbers, constants and functions. An expression can be evaluated
to derive a value or result. It "expresses" how the value is to be derived
using operation symbols and variable and constant names in addition to
numbers. When characters are typed or pasted into an entry area that expects
to see an expression, Omnis Studio checks what is entered for syntactical
correctness before allowing the cursor to move out of the entry area. If an
error is found, such as an extra parenthesis or a misspelled variable name,
Omnis highlights the part of the expression it finds to be in error and
offers a message to the programmer explaining what it found wrong. (Strictly
speaking, Notation strings are exempted from this syntax checking and
tokenization in expressions, but the general principle is still valid.)
If the expression passes the syntax test, Omnis Studio then stores the
expression as tokens rather than as the exact characters entered. A token is
a shorthand reference to a command, operator, function or variable that is
easier for a computer to store, read and execute than verbose human language
text.
A token simply "points to" or "replaces" an original item, for example, a
field definition in a File Class. Often a token only requires one or two
bytes to point to an item that would require many characters to name.
Another advantage of tokens, at least for field variable names, is that the
name can be changed in the File Class and it immediately appears to have
been "replaced" in its new form throughout the library. This is because the
name is actually only stored in a single location: the field definition in
the File Class.
Using this technique, Omnis Studio acquires the same compactness of code and
speed of execution that compilation provides other languages without losing
the flexibility of being an interpreted language. It is also the basis for
Omnis Studio's seamless cross-platform compatibility. (The tokenization of
commands, a related aspect of Omnis Studio, even allows us to see those
commands in the human language for which the current development copy is
localized, so Omnis Studio developers around the world can share
demonstration libraries and see the code in their preferred language!)
While the Omnis Studio manuals do not explicitly state whether a specific
entry area in a command or property expects a literal or an expression, this
can usually be gleaned from the examples given. If not, simple tests can be
performed to make the determination.
Mixing Literals and Expressions
Literals and expressions do not normally mix. If an expression is entered
where a literal is expected, no syntax checking is performed at design time,
no tokenization takes place, and no evaluation is performed at runtime. It
simply won't work as the programmer had envisioned, yet doesn't cause any
runtime errors. (An exception to this is a literal that must be a valid
value at runtime. Example 3 given below illustrates this.) If a literal is
entered where an expression is expected, however, Omnis attempts to evaluate
the literal anyway. It scans the string for operator characters and locates
the substrings between them. It then attempts to resolve each substring as a
variable or function. If it cannot, it reports an error to the programmer,
highlights the offending substring, and does not allow the cursor to leave
the entry area until the "error" is corrected. All this happens while in
design mode. Three brief examples can illustrate this:
Exercise 1: Entering an expression where a literal is expected
Open the Startup_Task class of any library and create a new method named
"testArea1". To create a new method, right-click (Windows) or Ctrl-click
(Mac) on the Class Methods entry (in the middle-left area of the method
editor) and select the Insert New Method option from the context menu; when
the method has been added, enter a name, in this case, enter testArea1 and
press Return.
Click on the first line of this method (in the middle-right area of the
method editor) and place an OK message command on it (to find this commands,
just type "ok" and Omnis will locate the command in the command list).
In the "Message" entry area (bottom-right), enter "2+2". (Do not type the
quote characters.)
Press Ctrl/Cmnd-E to execute the method. The OK dialog that appears shows
the "expression" as entered and does not evaluate it.
Exercise 2: Entering a literal where an expression is expected
In the same Startup_Task class, create a new method named "testArea2".
Click on the first line of this method and place a Calculate command on it
(just type "c").
In the "Calculation" entry area, enter "two plus two". (Do not type the
quote characters or the point will be lost.)
Now try to leave the "Calculation" area, either by tabbing or by clicking on
another item. Omnis Studio does not allow this because it detects a syntax
error, so it highlights the first error it notices, in this case the entire
phrase, since nothing in the phrase is recognized as something to either
tokenize (like a variable) or ignore (like a Notation string). Then an error
dialog appears, displaying the warning "Unrecognized variable name, item
name or attribute"
Change the first "two" to a "2", then attempt to leave the field again. This
time an error dialog appears stating simply "Operator missing", since Omnis
Studio would expect to see an operator following a number in an expression.
Since operators are often single characters, only the first letter ("p") of
the word "plus" is highlighted.
Change the word "plus" to the proper symbol ("+"), then attempt to leave the
field again. We get the same dialog as we did the first time ("Unrecognized
variable..."), but only the word "two" at the end of the phrase is now
highlighted.
Finally, change the last word "two" to a "2" and attempt to leave the field.
Omnis Studio allows this action, but notice that it also cleaned up the expr
ession by removing unneeded spaces. Omnis simply tokenized the expression
and then redisplayed it.
Exercise 3: Entering an incorrect literal where it must be evaluated at
runtime
In the same Startup_Task class, create a new method named "testArea3".
Click on the first line of this method and place an Open window instance
command on it (just type "o*w").
In the "Class" entry area, enter "xxxxx". (Or use some other string that is
not the name of an existing window class, but do not type the quote
characters.)
Press Ctrl/Cmnd-E to execute the method. Since a runtime error is generated,
no dialog appears. Rather, the Omnis Studio debugger comes into play and an
error message explaining the problem is placed in the Debugger Error Message
line just above the Parameters and Options Pane in the Method Editor. This
illustrates the fact that some command options that expect a literal can
still cause runtime errors if the literal is not correct. Commands that
refer to classes, such as the Open window instance command, need the class
name to be properly spelled so it can be recognized at runtime. Omnis Studio
tokenizes variable references (which often appear in expressions), but not
references to classes (which generally do not).
When you have finished examining the error message, select Stack>Clear
Method Stack from the Method Editor menu bar to clear the pending execution
of this method.
Most programming languages allow a literal to be injected into an expression
by enclosing the literal in quotes - so does Omnis Studio. Enclosing literal
values within quotes in expressions has become so commonplace that most
experienced people don't give it a second thought, so they never consider
that the opposite concept might exist or have some use.
Omnis Studio also allows expressions to be injected into otherwise static
literal entries by enclosing the expression in square brackets. This is
called Square Bracket Notation. It is a very powerful technique in Omnis
Studio that has many applications.
Square bracket notation can also be of great benefit where class names are
required in a literal, but only if the expression used will always generate
valid results. It is good practice to test an application thoroughly to
locate accidental bad references of this type.
Square Bracket Notation
We can use square brackets to inject a live expression into a literal. At
runtime, the expression is evaluated and its resulting value used in place
of the square brackets and their contents. For example, we could inject the
name of the current customer into the title of a window displaying invoices
for that customer by including the first and last name field variables in
square brackets in the window's title property. Here is a simple exercise to
guide you:
Exercise 4: Displaying customer name in window title
Create a new window class in your library with the name "wInvoiceBrowser".
Open the new window class and double-click on it to open its Method Editor.
Create two instance variables of Character type named "firstName" and
"lastName". To create an instance variable, click on the instance tab in the
variable pane of the method editor (top section), then right-click (Windows)
or Ctrl-click (Mac) in the variable pane and select the Insert New Variable
option from the context menu. When the variable has been added, enter a name
for the variable and press Return. Having named the variable, select a type
(and in some cases a subtype), and if required you can enter an intial
value.
For this exercise, enter initial values "'Alex'" and "'Bennett'" for these
variables respectively. (Be sure to include the inner quotes as these are
literal values being entered where expressions are expected.)
Return to the window view and modify the 'title' property using the Property
Manager:
title Invoices for [Customer.firstName] [Customer.lastName]
Now open a test instance of the window by pressing Ctrl/Cmnd-T. Notice the
space between the two sets of square brackets. Each one is evaluated
independently and its resulting value injected in the string. Since a space
is needed between the first and last names, a space is added between the
square bracket expressions used to retrieve them.
We can include any Omnis Studio expression of any length in square bracket
notation. We are not limited to simple variable names as in the example
above. Another exercise will illustrate this:
Exercise 5: Selecting a window to open based on a radio button variable
Create three new window classes named "window0", "window1" and "window2".
For each window class, copy its name value into its title property.
Create a new window class with the name "windowSelector".
Open the new window class and double-click on it to open its Method Editor.
Create an instance variable of Number type and Short integer subtype and
name it "selector". (Since it is a number, it will default to a value of 0,
so no initial value is required for this exercise.)
Return to the window view place a radio button on it from the Component
Store.
Change the following properties of the radio button field using the Property
Manager:
dataname: selector
text: Window 0
Now hold down the Control key (Windows and Linux) or Option key (Macintosh)
and drag a copy of the radio button below the first one. If you hold down
the Shift key once the dragging has commenced, the duplicate will remain in
alignment with the original.
Change the text property of the second radio button to "Window 1".
Make another duplicate of the radio button and change its text property to
"Window 2".
Place a pushbutton from the Component Store onto the window. Set its text
property to "Open window". Also make sure its buttonmode property (under the
Action tab in the Property Manager) is set to kBMuser.
Now double-click on the pushbutton to go to its $event method. This method
should already have a line for detecting an evClick event. On the second
line, place the Open window instance command.
In the Class entry area, enter one of the following two strings:
[con('window',selector)]
[pick(selector,'window0','window1','window2')]
The first of these is best for our situation where there is a common element
among all the windows in our pool and a numeric variable element. In the
more general case where the windows can have any names, the second technique
is more appropriate.
Now open a test instance of the Selector window, select a radio button and
click the pushbutton. Notice that the window corresponding to the selected
radio button is opened. This and related techniques are very useful for
specifying classes or instances based upon some variable value. It is the
equivalent of using If...Else if... or Switch...Case... constructs in a
single line of code.
We can use square bracket notation almost anywhere in Omnis Studio
including:
-Message text
-Window or report text objects
-Window titles
-Menu line text
-SQL statements
-Notation strings
-Field name command parameters (This is known as indirection)
Note: There is a slight performance penalty for using indirection in that
Omnis Studio must spend an extra moment evaluating which field is to receive
the calculated value, but it is not noticeable. Try the following example to
explore this concept:
Exercise 6: Using indirection to assign a value to a variable
In the Startup_Task class, create a new method named "indirectionTester".
Create two local variables of Character type for this method named "pointer"
and "target".
Put the following lines of code into the method:
Calculate pointer as "target"
Calculate [pointer] as 'Square brackets'
OK message {pointer = "[pointer]"//target = "[target]"}
Note: The curly braces in the OK message command above are displayed by
Omnis Studio and are not to be entered by you. Also, the two slash (/)
characters are a special code that forces a line break in the message.
Now execute the method by pressing Ctrl/Cmnd-E. The variable target now
holds the value "Square brackets". The variable pointer still holds the name
of the variable target.
It is most important to make certain that the square bracket expression will
always evaluate to a valid variable name when using indirection. To help in
testing this, we can use the Test for valid calculation command and the
eval() function. Our method above would then become:
Calculate pointer as "target"
Test for valid calculation {eval(pointer)}
If flag true
Calculate [pointer] as 'Square brackets'
OK message {pointer = "[pointer]"//target = "[target]"}
Else
OK message {Evaluation error: "[pointer]" is not a valid variable name.}
End if
Summary
There will be many examples in future articles that will take advantage of
the concepts discussed in this one. The main points made here are:
-Omnis Studio differentiates between literals and expressions in command
parameters and property values.
-Expressions are checked for syntax and then tokenized for storage.
-Literals are accepted and stored as entered.
-Literals can be injected into expressions by enclosing them in quotes.
-Expressions can be injected into literals by enclosing them in square
brackets.
-Square Bracket Notation has many uses within an Omnis Studio application.
========================================
About Omnis Studio
Omnis Studio is one of the most powerful and flexible Rapid Application
Development (RAD) tools available today. It allows the independent or
team-based developer to create e-business and information management
solutions for companies and organizations of any size.
Omnis Studio lets you develop and deploy applications under Windows, Linux,
and MacOS for such diverse markets as healthcare, human resources,
publishing, customer relationship management, e-business, education,
government, and more.
Using Omnis Studio, you can create form-based client applications that
access all leading server databases, including Oracle, Sybase, DB2, and
Informix, as well as all ODBC-compliant databases, such as MySQL and MS SQL
Server. Omnis Studio version 3 is optimized for multi-tier and web-based
application development.
Go to: www.omnis.net for further details about Omnis Studio.
========================================
A word about our web site
The Omnis web site contains a lot of information about the Omnis Studio
family of products, and details about our support and training services. We
publish a weekly news page containing all the latest Omnis news, product
releases, trade shows, an Omnis-related site of the week and Studio
technical tips. See the latest issue at:
www.omnis.net/news
And see the Omnis News back issues at:
www.omnis.net/news/backissue.html
Regards,
--Andrew Smith.
Omnis Tech Newsletter Editor
Email: editor@omnis.net
========================================
No part of this newsletter may be reproduced, transmitted, stored in a
retrieval system or translated into any language in any form by any means
without the written permission of Raining Data.
(c) Copyright Raining Data, Inc., and its licensors 2001. All rights
reserved.
Omnis(r) is a registered trademark and Omnis 7(tm), and Omnis Studio are
trademarks of Raining Data UK Ltd. Other products mentioned are trademarks
or registered trademarks of their corporations.
========================================
To unsubscribe from this newsletter or change your subscription options,
please go to:
www.omnis.net/newsletter