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

Re: XPL & directories???



** Reply to note from xywrite@xxxxxxxx Sat, 13 Dec 1997 10:15:10 -0400
 
> 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.
 
There is one large wrinkle here.

XyWrite "knows" when it is displaying a directory (because VA$WS=2).
Suppose that you write something like "RUN PARSEPM" on the CMline, then you
locate the cursor on a line in your directory display, and try to eXeCute
that RUN command. Xy's response will be to RUN the file on the current
line as if it were a program. In other words, when directories are
displayed and you issue a command (e.g. RUN or CALL), the default argument
to that command is the file *where the cursor is located*, rather than
(automatically, as would be the case if a file were displayed) the
argument on the CMline. You gotta be quite careful. During
development, the easiest thing to do is to LDPM your program; during normal
use, run it out of U2.

With that caveat, this PM does it (XPLeNCODEd and UUattached):

--------

XPLeNCODE v1.9
b-gin [UNTITLED]
{<}GLA{>}[cr|lf]{{;5FnSansExt}} Get 8[.3] filename without EX
Tension RJH 12/13/97[cr|lf]{2}{<}LBA{>}{<}IF{<}VA$WS{>}<>2{>
}{<}PRNot a directory{>}{<}EX{>}{<}EI{>};*; Is it a DIRectory
 display?[cr|lf]{<}IF{<}VA$XD{>}>0{>}[BX_]es 1[Q2_][LU_]{<}EI
{>};*; Read-only dir workaround[cr|lf][XP_][YD_][XD_][GT_][DL
_]{<}SV01{>}[XD_];*; Save line in S/G 01[cr|lf][LU_]{<}IF{<}V
A$XD{>}>0{>}[LD_]{<}EI{>};*; Read-only dir workaround[cr|lf]{
<}IF{<}IS01{>}{240}""{>}{<}LBB{>}{<}PRError - no filenam
e on this line{>}{<}EX{>}{<}EI{>};*; Check it[cr|lf]{<}SV02,{32}
{>}{<}SV03,{>}{<}XS01,02,03,,02{>};*; Parse line filename in{32}
S/G 03[cr|lf]{<}IF{<}VA|03{>}<1{>}{<}GLB{>}{<}EI{>};*; Check{32}
it[cr|lf]{<}PRDone - filename is: @03{>}{<}EX{>}{2}[cr|lf][cr
|lf]
-nd
XPLeNCODE


-----------
Robert Holmgren
holmgren@xxxxxxxx
-----------
begin 644 tmp58a.tmp
MKD=,0:\-"GM[-49N4V%N:^N15BOKD5)KSLJ.R!)2!D:7-P;&%Y/PT*KDE&KE9!)%A$KSXPK_^"JV5S(#'_@G__@3>N
M14FO.RH[(%)E860M;VYL>2!D:7(@=V]R:V%R;W5N9`T*_X&M_X$]_X$+_X!]
M_X!OKE-6,#&O_X$+.RH[(%-A=F4@;&EN92!I;B!3+T<@,#$-"O^!-ZY)1JY6
M02181*\^,*__@3&N14FO.RH[(%)E860M;VYL>2!D:7(@=V]R:V%R;W5N9`T*
MKDE&KDE3,#&O\"(\1$E2/B*OKDQ"0J^N4%)%