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 >
Text File  |  2001-01-27  |  6KB  |  117 lines

  1. <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
  2. <HTML>
  3. <HEAD>
  4. <base href="http://publib.boulder.ibm.com:80/cgi-bin/bookmgr/BOOKS/EZ30OZ00/2.6.4">
  5. <title>
  6. 2.6.4 "OS/2 WARP and OpenDoc" 
  7.   via IBM BookManager BookServer
  8. </title>
  9. </head>
  10. <body background="/bookmgr/backdrop.gif">
  11. <banner><br>
  12. <a href="../../library"><img src="/bookmgr/libicon2.gif" border=0 alt="[Library]"></a>
  13. <a  href="CONTENTS#2.6.4"><img src="/bookmgr/contents.gif" border=0 alt="[Contents]"></a>
  14. <img src="/bookmgr/drevs.gif" border=0 alt="[Revisions]">
  15. <a href="2.6.3"><img src="/bookmgr/prev.gif" border=0 alt="[Prev Topic]"></a>
  16. <a href="2.7"><img src="/bookmgr/next.gif" border=0 alt="[Next Topic]"></a>
  17. <a href="../../search?book=EZ30OZ00"><img src="/bookmgr/search.gif" border=0 alt="[Search]" ></a>
  18. <img src="/bookmgr/dslist.gif" border=0 alt="[Search Results]">
  19. <img src="/bookmgr/dsprev.gif" border=0 alt="[Prev Topic Match]">
  20. <img src="/bookmgr/dsnext.gif" border=0 alt="[Next Topic Match]">
  21. <img src="/bookmgr/dnotes.gif" border=0 alt="[Notes]">
  22. <img src="/bookmgr/dlnotes.gif" border=0 alt="[List Notes]">
  23. <a  href="../../print?book=EZ30OZ00"><img src="/bookmgr/print.gif" border=0 alt="[Print]"></a>
  24. <a href="../../download/EZ30OZ00.boo"><img src="/bookmgr/download.gif" border=0 alt="[Download]" ></a>
  25. <a  href="../../help/book"><img src="/bookmgr/help.gif" border=0 alt="[Help]"></a>
  26. <hr>
  27. <a name="HDR4610DSC"><H3> 2.6.4   Script</H3></a>
  28. </banner>
  29. <pre width="80">
  30. <p>
  31.    Each scripting language has a corresponding scripting component that 
  32.    executes the scripts.  The Object REXX is the user scripting language 
  33.    delivered with OpenDoc for OS/2. 
  34. <p>
  35.    Object-oriented extensions have been added to traditional REXX, but its 
  36.    existing functions and instructions have not changed. The Object REXX 
  37.    interpreter is actually an enhanced version of its predecessor, but with 
  38.    new support for the following: 
  39. <p>
  40.    1.  Classes, objects, and methods 
  41. <p>
  42.    2.  Messaging and polymorphism 
  43. <p>
  44.    3.  Inheritance and multiple inheritance 
  45. <p>
  46.    4.  CORBA-compliant access to OS/2 System Object Model (SOM) objects 
  47.        (CORBA is the Common Object Request Broker Architecture) 
  48. <p>
  49. <p>
  50.    Object REXX supplies the user with a base set of classes. These are ALARM, 
  51.    CLASS, ARRAY, LIST, QUEUE, TABLE, SET, DIRECTORY, RELATION, BAG, MESSAGE, 
  52.    METHOD, MONITOR, STEM, STREAM, STRING, and SUPPLIER.  Object REXX is fully 
  53.    compatible with earlier versions of REXX that were not object-based. 
  54. <p>
  55.    A script written in Object REXX can mix normal REXX commands with commands 
  56.    using the object extensions of Object REXX and using OSA-based commands. 
  57.    Object REXX interprets the OSA-based script commands by mapping them into 
  58.    OSA events and sending them to the OSA Event Manager. 
  59. <p>
  60.    Together with the OpenDoc run time, there is a script editor delivered to 
  61.    play and record scripts, as shown in<a href="#FIG4610D36"> Figure 36</a>. 
  62. <p>
  63. <a name="FIG4610D36"><hr>
  64.  </a>
  65. <p>
  66. <p>
  67.                                    <a href="picture-36?mode=zoom"><img src="/bookmgr/pictures/EZ30OZ00.P36.GIF" alt="PICTURE 36"></a>           
  68. <p>
  69. <p>
  70. <hr>
  71.  
  72.    Figure 36. OpenDoc Script Editor 
  73. <p>
  74.    The statement: 
  75. <p>
  76.      <samp>app</samp> <samp>=.scriptableapp~connect('OpenDoc-c:\opendoc\mydoc.doc')</samp> 
  77. <p>
  78.    as shown in<a href="#FIG4610D36"> Figure 36</a>, is an example of mixed norman and Object REXX 
  79.    command.  The tilde (~) is the message operator defined by Object REXX 
  80.    that seperates the object receiving the message to the left of the tilde 
  81.    from the actual message which is on the right of the tilde.  The 
  82.    <tt>.scriptableapp</tt> is a class object provided with Object REXX that gets the 
  83.    message <tt>connect</tt>.  A class object is an object that is able to create 
  84.    instances of its class.  In this example, it returns an object <tt>app</tt>.  Thus 
  85.    <tt>app</tt> created by the class object <tt>.scriptableapp</tt> is an instance of the class 
  86.    <tt>scriptableapp</tt>, representing the OpenDoc document <tt>mydoc</tt>.  Class objects are 
  87.    indicated by the '.'prefix before the name.  The example in<a href="#FIG4610D36"> Figure 36</a> 
  88.    shows an application that the script is connected to and the name of the 
  89.    application is an OpenDoc document.  The document is specified by the 
  90.    parameter that describes the actual file name that the script intends to 
  91.    collaborate with.  In the object <tt>app</tt> in turn, is stored the connected 
  92.    OpenDoc document.  This variable storing the application can then be the 
  93.    addressee of messages sent by the script. The values in the brackets are 
  94.    parameters. 
  95. <p>
  96.      <samp>PartProp</samp> <samp>=</samp> <samp>app[part[AbsPos]</samp> <samp>author~Get</samp> 
  97. <p>
  98.    Within the document we want to communicate with a component specified in 
  99.    the variable <tt>part[AbsPos]</tt>. This part gets the message <tt>Get</tt> with an 
  100.    additional parameter <tt>author</tt>, specifing the information we want to get. 
  101.    The expected value of the property <tt>author</tt> is returned by the component and 
  102.    stored by REXX in the variable <tt>PartProp</tt>.  The classes needed by a script 
  103.    that are defined in other CMD files, can be imported by a new REXX 
  104.    statement: 
  105. <p>
  106.      <samp>:</samp><samp>:</samp><samp>requires</samp> <samp>Scrapp.</samp> 
  107. <p>
  108.    In this file the interface for the <tt>scriptableapp</tt> class is stored. 
  109. </pre>
  110. </pre>
  111. <hr>
  112. <br><a href="2.6.3"><img src="/bookmgr/prev.gif" border=0 alt="[Prev Topic]"></a>
  113. <a href="2.7"><img src="/bookmgr/next.gif" border=0 alt="[Next Topic]"></a>
  114. <cite>  ⌐ Copyright IBM Corp. 1996</cite>
  115. <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>
  116. </BODY></HTML>
  117.