[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

Re: XPL & directories???



Reply to note from Myron Gochnauer  Sat, 13 Dec 97
14:15:10 +0000

-> I'm trying to write a small XPL program which will allow me to
-> choose a file from an open directory and pass the filename
-> only, without an extension, to a DOS program run from the
-> command line.


I'd take a different approach from Robert's: Use  to grab the
full path and filename from the directory listing, and then parse out
the filename from that. It bypasses the problem of read-only
directories, also the problem of formatting deltas which, in some
directory-display configurations, are embedded on the line containing
the first filename. It also requires very little code. Try this
(XPLeNCODEd and UUencoded versions below):

XPLeNCODE v1.9
b-gin [UNTITLED]
;*; Get filename without extension from Xy directory listing{32}
[CLD 12/13/97][13+10];*;[13+10]{174}IF{174}VA$WS{175}<2{175}{
174}PRDirectory listing required{175}{174}EX{175}{174}EI{175}
;*; Is it a directory listing?[13+10];*;[13+10]{174}SX01,{174
}VA$DR{175}{175}{174}SV02,\{175}{174}LBa{175}{174}IF{174}IS01
{175}{240}"\"{175}{174}XS01,02,03,,04{175}{174}SX01,{174}IS04
{175}{175}{174}GLa{175}{174}EI{175};*; Parse out FILENAME.EXT
 from [13+10];*;[13+10]{174}IF{174}IS01{175}{240}"."{1
75}{174}SX01,{174}VA@01.1{175}{175}{174}EI{175};*; Parse out{32}
EXT, if any[13+10];*;[13+10][255+128+109]{174}PV01{175}{174}
EX{175};*; Put result on CMline at cursor position[13+10][13+
10]
-nd
XPLeNCODE

begin 644 GETFN.PM
M.RH[($=E="!F:6QE;F%M92!W:71H;W5T(&5X=&5N2!L:7-T:6YG(%M#3$0@,3(O,3,O.3==#0H[*CL-"JY)1JY60217
M4Z\\,J^N4%)$:7)E8W1O2!L:7-T:6YG/PT*.RH[#0JN4U@P,2RN5D$D
M1%*OKZY35C`R+%ROKDQ"8:^N24:N25,P,:_P(EPBKZY84S`Q+#`R+#`S+"PP
M-*^N4U@P,2RN25,P-*^OKD=,8:^N14FO.RH[(%!A0T*.RH[
M#0K_@&VN4%8P,:^N15BO.RH[(%!U="!R97-U;'0@;VX@0TUL:6YE(&%T(&-U
2http://users.datarealm.com/xywwweb/