/**/ signal on novalue /* force REXX and its way of 'NOVALUE ON' */ /* Usage: [MACRO] CLIPBRD [target] */ /* Example: CLIPBRD paste (using GET) */ /* CLIPBRD target copy (using PUT) */ /* Purpose: interface to `clipbrd.exe` using GET resp. PUT */ /* with the default .\KEDITPUT.TMP (that's a quick */ /* hack not working for e.g. read-only CD drives). */ /* Note that target can be ALL, BLOCK, etc. */ /* Clipbrd: Maybe `clipbrd2.exe` shipped with OS/2 Lynx can */ /* be used instead of `clipbrd.exe` (?). Both need */ /* `pmclip.exe` as interface to the PM clipboard. */ /* See also: KHELP GET, KHELP PUT, KHELP TARGET */ /* Requires: Kedit 5.0, clipbrd.exe, OS/2 WPS (or only PM ?) */ /* (Frank Ellermann, 2002) */ ARG = strip( arg( 1 )) /* no or blank arg(1) => GET */ MSG = lastmsg.1() ; 'nomsg msg' /* save & clear lastmsg.1() */ if ARG = '' then OK = GET() ; else OK = PUT( arg( 1 )) if OK <> 0 then 'emsg' lastmsg.1() ; else 'nomsg msg' MSG exit OK /* reset lastmsg.1() if okay */ GET: procedure 'nomsg put 0' ; if rc <> 0 then return rc address CMD '@clipbrd -r > KEDITPUT.TMP' if rc <> 0 then return BAD( rc ) 'nomsg get' ; return rc PUT: procedure 'nomsg put' arg( 1 ) ; if rc <> 0 then return rc address CMD '@clipbrd < KEDITPUT.TMP' if rc <> 0 then return BAD( rc ) ; return rc BAD: procedure 'nomsg msg clipbrd error' arg( 1 ) ; return arg( 1 )