home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Spezial
/
SPEZIAL2_97.zip
/
SPEZIAL2_97.iso
/
ANWEND
/
ONLINE
/
SREFPRC1
/
HOMEDIR.SRF
< prev
next >
Wrap
Text File
|
1996-12-14
|
780b
|
28 lines
/* Do HOME_DIR for ~substitution, with $ replacement too */
sref_homedir:
parse arg asel,homedir
if pos('~',asel)=0 then return asel /* trivial case */
if pos('$',homedir)>0 then do /* $ mode */
parse var asel a1 '~' a2 '/' a3 /* break asel into pre, ~, and post compomnents */
if a3<>"" then a3='/'||a3
/* replace $ with this stuff (might mean removal with no replacement)*/
homedir2=strip(sref_replacestrg(homedir,'$',a2,'ALL'))
end
else do /* standard mode */
parse var asel a1 '~' a3
homedir2=strip(homedir)
end
/* check for // */
if right(a1,1)='/' then homedir2=strip(homedir2,'l','/')
if left(a3,1)='/' then homedir2=strip(homedir2,'t','/')
afoo=a1||homedir2
if a3<>' ' then afoo=afoo||a3
return afoo