home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Datafile PD-CD 1B
/
DATAFILE_PDCD1B.iso
/
_pocketbk
/
pocketbook
/
opl
/
parse__opl
< prev
next >
Wrap
Text File
|
1994-10-13
|
1KB
|
44 lines
rem by Mark Esposito
rem Pelican Software
rem This procedure will disect a file
rem name piece by piece. You can get the piece
rem you want by sending the Complete file name
rem with path and sending a number to designate
rem the part of the filename you need
rem Example: loadm "parse$"
rem Dinit"Load file"
rem Dfile fil$,"Enter:",1
rem if dialog
rem p$=parse$:(fil$,3)
rem print p$
rem endif
rem p$ can be any part of the filename
rem syntax: parse$:(fil$,1) = filesystem (Loc::,Rem::C:,etc...)
rem parse$:(fil$,2) = Device (M:,A:,B:,C:)
rem parse$:(fil$,3) = Pathname (\Bank\cc)
rem parse$:(fil$,4) = Filename (w/o extension)
rem parse$:(fil$,5) = Extension (.odb,.opl)
rem parse$:(fil$,6) = Filename+Extension
rem
rem fil$ must have 128 bytes reserved
PROC parse$:(fil$,req%)
local b%(6),p$(128),rel$(8),fsys$(8),dev$(2),path$(128),fn$(12),ext$(4)
p$=parse$(fil$,rel$,b%())
fsys$=mid$(p$,1,b%(2)-1)
dev$=mid$(p$,b%(2),b%(3)-b%(2))
path$=mid$(p$,b%(3),b%(4)-b%(3))
fn$=mid$(p$,b%(4),b%(5)-b%(4))
ext$=mid$(p$,b%(5),4)
if req%=1 :Return fsys$
elseif req%=2 :return dev$
elseif req%=3 :return path$
elseif req%=4 :return fn$
elseif req%=5 :return ext$
elseif req%=6 :return fn$+ext$
rem Add your own combinations here
endif
ENDP