Server Reference Guide : F. Contents of the 62demo Application Directories : Intertask2 Application
 
Share this page                  
Intertask2 Application
The intertask2 application is one of several that show how OpenROAD eClient applications can pass internal and external events to each other.
Purpose
The intertask2 application is a 4GL example script that demonstrates how two OpenROAD applications can communicate with each other and pass an integer value between them.
Description
This script is a simple example that demonstrates how to register for a user event, send a user event, send an external event with an integer message value, and how to retrieve the user event, external event, and message value.
How you use it
The application used in this procedure is named i101711_appl1.exp. Follow these steps to setup the test:
1. Import this application into Workbench under the name "i101711_appl1".
2. Import this application into Workbench again under the name "i101711_appl2".
3. Start application i101711_appl1 and i101711_appl2.
4. In the first application, click the "Register User Event" button. The entry field next to it should say "External Event 1".
5. In the second application, click the "Send External Event" button.
This sends an external event from the second application to the first application. The on userevent event block will trap this external event.
The message integer value sent from the second application to the first application is displayed.
Notes
The intertask2 application uses the IIW4GL_SendUserEvent 3GL function that is built into the OpenROAD Runtime. This function is exported in both or4glnt.dll and orrun.dll. The OpenROAD eClient is bound to orrun.dll. In the 3GL declaration, this DLL is specified for this 3GL function.
Because only an integer can be passed between the two applications by the external event mechanism, an application convention must be established to de-reference this integer value into additional information. This can take the form of an index in a database table or a call to the OpenROAD Server.
Forcing the use of Loadnrun Client 6.2 runtime
The following directive forces the use of the Loadnrun 6.2 Client runtime if the application is launched by the Loadnrun60.bat or Loadnrun51.bat script:
ENVIRONMENT=PATH=%II_ECLIENT_APPDIR%bin;%II_LOADNRUN62_ROOT%\bin;%PATH%
Contents of the subdirectory
intertask2.img
install4gl.txt
Contents of Intertask2\install4gl.txt
//
//  The following control statements must not start on line 1.
//
4GLVERSION =6,20,14001,0
IMAGEFILE  =Intertask2.img
CMDFLAGS   =-Tyes
//
//  The following environment variables are set by the run.bat that is generated
//  by Loadnrun when an application is downloaded from the server
//
//    Environment Variable       Value
//    --------------------       -----
//    II_ECLIENT_ROOT            %APPDATA%\Actian\eclientcache\[HOSTSYSTEM]\[HOSTSUFFIX]\
//    LOADNRUN_CLIENT_ROOT       %II_LOADNRUN51_ROOT%\  (if launched using LOADNRUN51.bat)
//    LOADNRUN_CLIENT_ROOT       %II_LOADNRUN60_ROOT%\  (if launched using LOADNRUN60.bat)
//    LOADNRUN_CLIENT_ROOT       %II_LOADNRUN62_ROOT%\  (if launched using LOADNRUN62.bat)
//    II_ECLIENT_RUNMODE         2
//    II_ECLIENT_URL             [HOSTSYSTEMURL]
//    II_ECLIENT_VERSION
//    II_ECLIENT_4GLVERSION      [INSTALL4GLVERSION]
//    II_ECLIENT_SUFFIX          [HOSTSUFFIX]
//    II_ECLIENT_APPDIR          %II_ECLIENT_ROOT%[APPNAME]
//    II_ECLIENT_LIBDIR          %II_ECLIENT_ROOT%lib
//    II_W4GLAPPS_SYS            %II_ECLIENT_ROOT%lib
//    II_W4GLAPPS_DIR            %II_ECLIENT_ROOT%[APPNAME]
//    II_LOG                     %II_ECLIENT_ROOT%[APPNAME]
//    II_ECLIENT_SYSTEM          %windir%\syswow64     (on 64-bit systems)
//    II_ECLIENT_SYSTEM          %windir%\system32     (on 32-bit systems)
//    PATH                       %II_ECLIENT_ROOT%qt;%LOADNRUN_CLIENT_ROOT%bin;%PATH%
//    II_LOADNRUN                TRUE
//
//  where the following are defined
//
//    String Name                String Value Description
//    -----------                ------------------------
//    [HOSTSYSTEMURL]            This is the URL that is passed when Loadnrun is invoked on
//                               the Client
//    [HOSTSYSTEM]               This is the system name that is hosting the [HOSTSYSTEMURL]
//    [HOSTSUFFIX]               This is the suffix that is passed when Loadnrun is invoked
//                               on the client
//    [INSTALL4GLVERSION]        This is the value of the 4GLVERSION directive located in
//                               the install4gl.txt
//    [APPNAME]                  This is the application name passed when Loadnrun is invoked
//                               on the Client
//
//  An example of the command that will be invoked is as follows
//
//    loadnrun62.bat [APPNAME] [HOSTSYSTEMURL] [HOSTSUFFIX]
//
//  The following ENVIRONMENT directives will be used to append SET statements in
//  the run.bat that will be generated by Loadnrun. These can override any environment
//  variables generated in run.bat prior to the launch of the application.
//
//  Force the use of the Loadnrun 6.2 client runtime for run.bat
//
ENVIRONMENT=PATH=%II_ECLIENT_APPDIR%bin;%II_LOADNRUN62_ROOT%\bin;%PATH%
//
//  Environment for Application
//