Next: LIST OF SUBPROGRAMS
Up: EXAMPLES
Previous: EXAMPLE 3 -
This example just illustrates how to write a simple Dedicated Process
Server.
C------------------- EXAMPLE 4 CODE ------------------------
PROGRAM EXAMPLE4
C
C Description:-
C =============
C Example Program to setup Dedicated Process Server
C
C Global Declarations:-
C =====================
C
$$If VAX
Implicit None
$$Endif
$$Include 'UIPack$Library:UINames.Inc'
$$Include 'UIPack$Library:UIParam.Inc'
$$Include 'UIPack$Library:UIError.Inc'
C
C Local Declarations
C ==================
C
INTEGER STATUS,FILLEN
CHARACTER*64 FILNAM
C
C Executable Code:-
C =================
C
STATUS = UIINIT(UIVTMD) (1)
FILNAM = 'Server.UID' (2)
STATUS = UIGTFI('UIPACK Definition Filename',
& FILNAM,FILLEN)
IF (STATUS .EQ. UISUCC) THEN
STATUS = UIISPC(FILNAM(1:FILLEN)) (3)
STATUS = UILSPC() (4)
ENDIF
STATUS = UIFINI() (5)
STOP
END
C
C
C ----------------- END OF EXAMPLE 4 -----------------------
Notes:
- This call initialises UIPACK in ViewText Mode. This is the most
efficient mode in which to initialise UIPACK in the role as a Process Server,
but it isn't essential since the subsequent call to UIISPC puts the
Application program into the correct UIPACK configuration.
- This code prompts the User to supply a UIPACK Definition File Name. For an
example of such a File see the later section of this Example.
- This code sets up the Application program as a dedicated Process
Server. The UIPACK Definition File that was specified by the User is
assumed to define some Client Processes.
- This code causes the Application Program to loop servicing the Client
Processes. This servicing will continue until the User types Ctrl-C, at which
time a Menu of options will be presented to them. Choosing ``EXIT" will cause
the Server to terminate.
- This code terminates the use of UIPACK.
!--------------- EXAMPLE 4 Definition File ----------------
!
Viewport /XLow=2/XHigh=50/YLow=2/YHigh=15 (1)
Process/Viewport= Example1 "Run/NoDebug Example1.Exe" (2)
Display (3)
Process/Detached=MyName/Display Silly "Silly.Exe" (4)
Process/Connect Test2 "Run/NoDebug ViewportTest" (5)
!------------ End of EXAMPLE 4 Definition File ------------
Notes:
- This call defines the next unassigned Viewport. This will be
associated with the creation of the next Process (see 2).
- This creates a Subprocess (since these is no /DETACHED Qualifier) that has
the name ``Example_1" and executes the specified DCL Command. The Subprocess
is associated with the Viewport that was previously created. This Viewport is
hidden by default.
- This makes the Viewport associated with the Subprocess visible.
- This creates a Detached Process that runs under the UIC ``MyName" and
executes the specified Executable Image. The /DISPLAY Qualifier causes the
Viewport associated with the Process to be made visible. Since this Viewport
has not been explicitly specified, one is created having a default size and
placement (since this is the 2nd Process, it is the upper right-hand quadrant).
- This creates another Subprocess and connects the Keyboard to it. This
causes the Viewport associated with the Process to be popped to the front of
the screen and highlighted. Since no Viewport has been specified, this
Process will appear at the bottom left-hand quadrant.
Next: LIST OF SUBPROGRAMS
Up: EXAMPLES
Previous: EXAMPLE 3 -
Liz Buckle
Fri Jan 13 17:20:31 CST 1995