Thread View: comp.lang.rexx
3 messages
3 total messages
Started by Darren Abbott
Wed, 03 Apr 1996 00:01
REXX Beauties: openhere - open a WPS folder for the current directory.
Author: Darren Abbott
Date: Wed, 03 Apr 1996 00:01
Date: Wed, 03 Apr 1996 00:01
30 lines
1070 bytes
1070 bytes
/********************************************* * openhere.cmd * * Open a WPS folder for the current directory. * * Usage: * openhere [<view>] * view = I (Icon), T (Tree), D (Details), default = I *********************************************/ call RxFuncAdd 'SysOpenObject', 'RexxUtil', 'SysOpenObject' d = 'D' t = 'T' i = 'I' nbr.D = 102 nbr.T = 101 nbr.I = 1 ARG view IF view = '' then view = "I" call SysOpenObject DIRECTORY(), nbr.view, "TRUE" call RxFuncDrop 'SysOpenObject' ------------------------------------------------- Darren abbott@hiwaay.net Compuserve: 71045,1777
Re: REXX Beauties: openhere - open a WPS folder for the current directory.
Author: C. Vissenberg
Date: Thu, 11 Apr 1996 11:05
Date: Thu, 11 Apr 1996 11:05
55 lines
2135 bytes
2135 bytes
Darren Abbott (abbott@hiwaay.net) wrote:
> /*********************************************
> * openhere.cmd
> *
> * Open a WPS folder for the current directory.
> *
> * Usage:
> * openhere [<view>]
> * view = I (Icon), T (Tree), D (Details), default = I
> *********************************************/
> call RxFuncAdd 'SysOpenObject', 'RexxUtil', 'SysOpenObject'
> d = 'D'
> t = 'T'
> i = 'I'
> nbr.D = 102
> nbr.T = 101
> nbr.I = 1
> ARG view
> IF view = '' then
> view = "I"
> call SysOpenObject DIRECTORY(), nbr.view, "TRUE"
> call RxFuncDrop 'SysOpenObject'
> -------------------------------------------------
> Darren
> abbott@hiwaay.net
> Compuserve: 71045,1777
Small problem here, Darren.
You should not use "RxFuncDrop" at the end of the script.
Since OS/2 V2.0, "RxFuncAdd" and "RxFuncDrop" work system-wide.
When your script drops the RexxUtil-DLL, it might crash another
script that runs concurrently.
Demo:
Insert a 'pause' statement just before 'call SysOpenObject...'.
In one window run 'open' until it hits 'pause'.
Now open a second window, run 'open' there and hit space to pass
the 'pause'.
Return to the first window. When you hit the spacebar to pass the
'pause', the 'open'-script will crash on the 'SysOpenObject' call.
General rule: Do not use 'RxFuncDrop' in scripts.
--
Con Vissenberg | GCS d-- H- s g- p?>1 a w+ v C+ US+$
cvissenb@emt.ie.philips.nl | !P L>+ 3 E N++ K W--- M? !V -po+
I don't speak for Philips. | Y+ t !5 !j R G? tv b+ !D B? e++
| u+ h---- f r+++ n+ z+++
Re: REXX Beauties: openhere - open a WPS folder for the current directory.
Author: Chad Slaughter
Date: Fri, 19 Apr 1996 21:06
Date: Fri, 19 Apr 1996 21:06
64 lines
2387 bytes
2387 bytes
<C. Vissenberg (cvissenb@emt.ie.philips.nl) wrote:>
: ~>Darren Abbott (abbott@hiwaay.net) wrote:
[snip ]
: ~>Small problem here, Darren.
: ~>You should not use "RxFuncDrop" at the end of the script.
: ~>Since OS/2 V2.0, "RxFuncAdd" and "RxFuncDrop" work system-wide.
: ~>When your script drops the RexxUtil-DLL, it might crash another
: ~>script that runs concurrently.
[more snip'ed ]
Another solution to this problem is to not use the RexxUtil functions
at all when dealing with the WPS.
I know not everyone has Object Rexx, so its not a universal solution, but I
went ahead and implemented Darren's nice little program in Object Rexx to
show another way to do it.
For those interested here it is:
--Begin open.cmd --
/* Add the workplace constants to the global environment */
call wpconst
/* Parse agurments as neccessary */
ARG view
Select
when view = 'D' then
type = 'OPEN_DETAILS'
when view = 'T' then
type = 'OPEN_TREE'
when view = 'I' then
type = 'OPEN_DEFAULT' /* Icon is default on my system */
otherwise
type = 'OPEN_DEFAULT'
end
/* Get Current Directory */
dir = .wpfolder~wpclsQueryObjectFromPath( Directory() )
/* Open the directory view and make it current */
dir~~wpopen(0,.wpconst[type],0)~wpswitchto(0)
-- end open.cmd --
Here's a one liner for those interested in small.
/* */
/*
call wpconst
/* next two lines whould be on one line when ran, I broke it up b/c it
exceeds 70 chars in length */
.wpfolder~wpclsQueryObjectFromPath( Directory() )~~
wpopen(0,.wpconst['OPEN_DEFAULT'],0)~wpswitchto(0)
/*end*/
Cheers,
--
Chad Slaughter
slaught@umr.edu
<PGP public key available upon request>
"No I wasn't dead, just stuck in a swamp for 7 months" -- me
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads