home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
opendc12.zip
/
SG244883.ZIP
/
2_6.4
< prev
next >
Wrap
Text File
|
2001-01-27
|
6KB
|
117 lines
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<HTML>
<HEAD>
<base href="http://publib.boulder.ibm.com:80/cgi-bin/bookmgr/BOOKS/EZ30OZ00/2.6.4">
<title>
2.6.4 "OS/2 WARP and OpenDoc"
via IBM BookManager BookServer
</title>
</head>
<body background="/bookmgr/backdrop.gif">
<banner><br>
<a href="../../library"><img src="/bookmgr/libicon2.gif" border=0 alt="[Library]"></a>
<a href="CONTENTS#2.6.4"><img src="/bookmgr/contents.gif" border=0 alt="[Contents]"></a>
<img src="/bookmgr/drevs.gif" border=0 alt="[Revisions]">
<a href="2.6.3"><img src="/bookmgr/prev.gif" border=0 alt="[Prev Topic]"></a>
<a href="2.7"><img src="/bookmgr/next.gif" border=0 alt="[Next Topic]"></a>
<a href="../../search?book=EZ30OZ00"><img src="/bookmgr/search.gif" border=0 alt="[Search]" ></a>
<img src="/bookmgr/dslist.gif" border=0 alt="[Search Results]">
<img src="/bookmgr/dsprev.gif" border=0 alt="[Prev Topic Match]">
<img src="/bookmgr/dsnext.gif" border=0 alt="[Next Topic Match]">
<img src="/bookmgr/dnotes.gif" border=0 alt="[Notes]">
<img src="/bookmgr/dlnotes.gif" border=0 alt="[List Notes]">
<a href="../../print?book=EZ30OZ00"><img src="/bookmgr/print.gif" border=0 alt="[Print]"></a>
<a href="../../download/EZ30OZ00.boo"><img src="/bookmgr/download.gif" border=0 alt="[Download]" ></a>
<a href="../../help/book"><img src="/bookmgr/help.gif" border=0 alt="[Help]"></a>
<hr>
<a name="HDR4610DSC"><H3> 2.6.4 Script</H3></a>
</banner>
<pre width="80">
<p>
Each scripting language has a corresponding scripting component that
executes the scripts. The Object REXX is the user scripting language
delivered with OpenDoc for OS/2.
<p>
Object-oriented extensions have been added to traditional REXX, but its
existing functions and instructions have not changed. The Object REXX
interpreter is actually an enhanced version of its predecessor, but with
new support for the following:
<p>
1. Classes, objects, and methods
<p>
2. Messaging and polymorphism
<p>
3. Inheritance and multiple inheritance
<p>
4. CORBA-compliant access to OS/2 System Object Model (SOM) objects
(CORBA is the Common Object Request Broker Architecture)
<p>
<p>
Object REXX supplies the user with a base set of classes. These are ALARM,
CLASS, ARRAY, LIST, QUEUE, TABLE, SET, DIRECTORY, RELATION, BAG, MESSAGE,
METHOD, MONITOR, STEM, STREAM, STRING, and SUPPLIER. Object REXX is fully
compatible with earlier versions of REXX that were not object-based.
<p>
A script written in Object REXX can mix normal REXX commands with commands
using the object extensions of Object REXX and using OSA-based commands.
Object REXX interprets the OSA-based script commands by mapping them into
OSA events and sending them to the OSA Event Manager.
<p>
Together with the OpenDoc run time, there is a script editor delivered to
play and record scripts, as shown in<a href="#FIG4610D36"> Figure 36</a>.
<p>
<a name="FIG4610D36"><hr>
</a>
<p>
<p>
<a href="picture-36?mode=zoom"><img src="/bookmgr/pictures/EZ30OZ00.P36.GIF" alt="PICTURE 36"></a>
<p>
<p>
<hr>
Figure 36. OpenDoc Script Editor
<p>
The statement:
<p>
<samp>app</samp> <samp>=.scriptableapp~connect('OpenDoc-c:\opendoc\mydoc.doc')</samp>
<p>
as shown in<a href="#FIG4610D36"> Figure 36</a>, is an example of mixed norman and Object REXX
command. The tilde (~) is the message operator defined by Object REXX
that seperates the object receiving the message to the left of the tilde
from the actual message which is on the right of the tilde. The
<tt>.scriptableapp</tt> is a class object provided with Object REXX that gets the
message <tt>connect</tt>. A class object is an object that is able to create
instances of its class. In this example, it returns an object <tt>app</tt>. Thus
<tt>app</tt> created by the class object <tt>.scriptableapp</tt> is an instance of the class
<tt>scriptableapp</tt>, representing the OpenDoc document <tt>mydoc</tt>. Class objects are
indicated by the '.'prefix before the name. The example in<a href="#FIG4610D36"> Figure 36</a>
shows an application that the script is connected to and the name of the
application is an OpenDoc document. The document is specified by the
parameter that describes the actual file name that the script intends to
collaborate with. In the object <tt>app</tt> in turn, is stored the connected
OpenDoc document. This variable storing the application can then be the
addressee of messages sent by the script. The values in the brackets are
parameters.
<p>
<samp>PartProp</samp> <samp>=</samp> <samp>app[part[AbsPos]</samp> <samp>author~Get</samp>
<p>
Within the document we want to communicate with a component specified in
the variable <tt>part[AbsPos]</tt>. This part gets the message <tt>Get</tt> with an
additional parameter <tt>author</tt>, specifing the information we want to get.
The expected value of the property <tt>author</tt> is returned by the component and
stored by REXX in the variable <tt>PartProp</tt>. The classes needed by a script
that are defined in other CMD files, can be imported by a new REXX
statement:
<p>
<samp>:</samp><samp>:</samp><samp>requires</samp> <samp>Scrapp.</samp>
<p>
In this file the interface for the <tt>scriptableapp</tt> class is stored.
</pre>
</pre>
<hr>
<br><a href="2.6.3"><img src="/bookmgr/prev.gif" border=0 alt="[Prev Topic]"></a>
<a href="2.7"><img src="/bookmgr/next.gif" border=0 alt="[Next Topic]"></a>
<cite> ⌐ Copyright IBM Corp. 1996</cite>
<HR><p><h6><a href="/cgi-bin/bookmgr/library">IBM BookManager« BookServer</a> Copyright 1989, 1999<a href="http://www.ibm.com/"> IBM</a> Corporation. All rights reserved.</h6><p>
</BODY></HTML>