home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 18 REXX
/
18-REXX.zip
/
open.cmd
< prev
next >
Wrap
OS/2 REXX Batch file
|
1994-12-30
|
2KB
|
76 lines
/* OPEN.CMD - open an object in a specified view */
/* Original stolen from OPEN.CMD as listed in Melissa Woo's excellent
* "Stupid OS/2 Tricks" (get it from ftp-os2.cdrom.com).
* Not very much remains from the original, though.
*
* If anyone can make this script:
* 1. Work with files with spaces in the path.
* 2. Open abstract objects
* 3. Open view's with spaces in their names
* 4. List available view's for an object and/or check the view's
* available against the view requested.
* you're more than welcome to make the change.
*
* Questions can be directed to (although not necessarily answered by)
* etxbrfa@kk.ericsson.se or bjorn@algonet.se (same person, different
* addresses).
*
* Oh, BTW, you're completely on your own with this script. It works for
* me, on my machine, for what little testing I've done. If it doesn't
* work for you, too bad. I will claim no responsibility for anything
* this program causes, or doesn't cause for that matter. Screwed up
* data, wrong view's, bad weather, terrible lunch, and so on, are *not*
* my fault; they're your fault for taking the risk.
*
* However, if it works, great! If you feel like it please send me a post
* card. The address is:
*
* Bjorn Fahller c/o Eklund
* Kvistbrogran 15
* S-124 67 Bandhagen
* SWEDEN.
*/
call RxFuncAdd "SysSetObjectData", "RexxUtil", "SysSetObjectData"
PARSE ARG objectpath view
if objectpath == '' then do
say "open objectpath view"
exit
end /* Do */
if view == '' then
view='DEFAULT'
drive=filespec("drive", objectpath)
path=filespec("path", objectpath)
name=filespec("name", objectpath)
if drive == '' then
drive=filespec("drive", directory())
if path == '' then
path=filespec("path", directory())
objectpath=drive''path''name
rc = SysSetObjectData(objectpath, "OPEN="view) ;
if rc == 0 then do /* hmm, maybe it was a relative path */
if RIGHT(directory(), 1) == '\' then
here = directory()
else
here = directory()'\'
part=filespec("path", here)
objectpath=drive''part''path''name
rc = SysSetObjectData(objectpath, "OPEN="view) ;
end /* Do */
if rc == 0 then
say 'Could not open ' objectpath
exit