home *** CD-ROM | disk | FTP | other *** search
- /* This AREXX program is used to show an external file using multiview of OS3
- The rexx file is called from the Database program Twist with the arguments
-
- showfilename multiviewportname pubscreenname
-
- SHOWFILENAME: The name of the file to show. ::CLIP is used if the clipboard must be shown.
- MULTIVIEWPORTNAME: The name of the Multiview AREXX port. Each "external file object" in
- a databases record form addresses a different port so more than one instance
- of Multiview may be started from Twist
- PUBSCREENNAME: The name of the screen Twist is running on (Workbench, Twist or another
- public screen)
-
- If Multiview is not available Display is used
-
- Copyright (C) 1994 Mermaid Group
- */
- signal on NOVALUE
-
- PARSE ARG showfilename,multiviewportname,pubscreenname
- multiviewportname = upper(multiviewportname)
-
- IF (length(multiviewportname)>16) THEN multiviewportname = right(multiviewportname, 16)
-
- /* get kickstart version from previous call to this script */
- ksvs = getclip("TwistMWVS")
- IF ksvs == "" THEN
- DO
- /* use the shell command to find if the OS version supports DataType and Multiview */
- ADDRESS COMMAND "version >T:version_string"
- CALL OPEN 'input','T:version_string','R'
- vsline = readln('input')
- CALL CLOSE 'input'
- ADDRESS COMMAND 'delete quiet T:version_string'
- PARSE VAR vsline . d1 d2 ",".
- IF (d1 = "version") THEN ksvs = d2
- ELSE ksvs = d1
- x = setclip("TwistMWVS", ksvs)
- END
-
- IF ksvs < 40 THEN multiviewportname = "MULTIVIEW.1"
-
- IF ~ SHOW('p', multiviewportname) THEN
- DO
- /* Multiview with the named port is not currently existing so create it */
- IF showfilename = "-c" THEN filetext = "CLIPBOARD"
- ELSE filetext = "FILE " showfilename
-
- IF ksvs >= 39 THEN
- DO
- IF ksvs >= 40 THEN
- DO
- ADDRESS COMMAND "run >NIL: sys:utilities/multiview " filetext " PORTNAME " multiviewportname " PUBSCREEN " pubscreenname
- END
- ELSE
- DO
- /* The Multiview vs 3.0 on C4000 and C1200 does not know the PORTNAME option - thus only one file can be shown at a time */
- ADDRESS COMMAND "run >NIL: sys:utilities/multiview " filetext " PUBSCREEN " pubscreenname
- END
- END
- ELSE address command "sys:utilities/display " showfilename " opt t=3"
- END
- ELSE
- DO
- /* Multiview with the named port is already running. send it a AREXX command to show this file */
- ADDRESS VALUE multiviewportname
- IF showfilename = "-c" THEN OPEN CLIPBOARD
- ELSE OPEN NAME showfilename
- WINDOWTOFRONT
- END
-
- EXIT
-
- NOVALUE:
- SAY "no value error in line" sigl
- EXIT
-