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

Re: auto-truncation



** Reply to message from "Myron Gochnauer"  on Fri, 29 Nov 2002
12:12:47 -0400

Myron:

> When I try to use LCD with a directory open on the screen it seems to use
> part of the directory listing rather than what I have on the command line.

You mean, coincidentally, a dir listing just happens to be in the current
window? Because those dir listings should already be 8.3, no? You'd just CD
against them (not LCD). Lemme try...

Hmmm. I cannot reproduce the problem. On my machine, with an LCD dirspec on
the CMline, and a DIR listing in the window, LCD dirspec executes as
it should. Ah, perchance you have read-only dir listings, i.e. default XD=1?
Command VA/NV $XD to find out. Because those damn things always highlight
(=DeFine) one line, and LCD is picking that up and trying to do something with
it, ≪MDxx≫ garbage and all. I'll set LCD to ignore highlights in dir
listings.  

You know, I forgot to indicate in the Help frame that LCD (unlike native CD)
will move you to a different *drive* and then cd to the specified dir. E.g.,
if you're in G:\XY4, and you execute "lcd C:\Program Files\PC-Doctor for
Windows 2000", your current d:\dir becomes C:\PROGRA~1\PC-DOC~1.
Whereas with the native CD command, you would stay on drive G:, but *if* you
changed to drive C:, you'd find yourself in \PROGRA~1\PC-DOC~1. There are
arguments to be made for both procedures, the most compelling one for the
native procedure being that that's how most operating systems handle it; but
usually, when I do a CD to a different drive, I want the whole thing in one
fell swoop.

The beauty of separating the truncation engine from individual applications is
that the applications are usually very simple, and if you don't like the way
they work, you just change them -- or add new ones. Whereas changing the
engine is not trivial.

I rewrote the whole engine from scratch. It has some bug fixes (deletes
terminal periods [e.g. "my long file.abc.xyz."], per M$ rules, even though I
can't for the life of me create such a file or directory under W2K -- terminal
periods are automatically dropped by the OpSys; capitalizes the 8.3 output,
again per the rules; fix for read-only directories), but mainly it is simpler,
more meticulous, and much more logical. Carl also suggested some error
checking in LCD and LCA, herewith adopted. The Help frame will be improved
also, in next U2.

BTW, Carl also suggests that when adding frames like these to U2, the best
procedure is to use frame ADD2U2 to integrate them into U2, and also to
activate them. It's painless, and it ensures that user doesn't mess anything
up. You save this msg to a file, open file in XyWrite, DECODE the
three frames below, then DeFine them (all of them, as a single DF block), and
finally command ADD2U2 -- presto, Done. 

Plug these in, dump the earlier frames:

XPLeNCODE v2.0
b-gin [UNTITLED]
{{;5trunc}} Trunc[ate] pathname|filename to 8.3 format RJH 1
1/30/2002[cr|lf]{002}{<}IF{<}VA$DF{>}>0&{<}VA$WS{>}<2{>}[DZ_]
{<}SV50{>}{<}EI{>}{<}SX50,@UPR({<}IS50{>}){>}{<}SX01,{<}IS50{
>}{>}{<}SV02,{>}{<}SV03,\{>}{<}SV04,.[255+252+142]{>}{<}SV05,
 {>}{<}SV06,.{>}{<}SV07,{027}X{027}X{027}X{>}{<}SV08,{027}X{0
27}X{027}X{027}X{027}X{027}X{>}{<}LBA{>}{<}SV09,0{>}{<}SX10,{
<}IS50{>}{>}{<}SV11,{>}{<}IF{<}IS50{>}{240}"\"{>}{<}XS50,03,1
0,,11{>}{<}EI{>}{<}SX50,{<}IS11{>}{>}{<}IF{<}VA|10{>}>0{>}{<}
LBB{>}{<}IF".[255+252+142]"{238}({<}IS10{>}+"[255+252+142]")>
-1{>}{<}SX10,{<}IS10{>}+"[255+252+142]"{>}{<}XS10,04,12,,13{>
}{<}SX10,{<}IS12{>}{>}{<}SX09,1{>}{<}GLB{>}{<}EI{>}{<}IF":"{2
38}{<}IS10{>}==1{>}{<}SX02,{<}IS02{>}+{<}IS10{>}{>}{<}GLE{>}{
<}EI{>}{<}IF{<}IS10{>}{240}" "{>}{<}LBC{>}{<}XS10,05,14,,15{>
}{<}SV09,1{>}{<}IF{<}IS15{>}{240}{<}IS05{>}{>}{<}SX10,{<}IS14
{>}+{<}IS15{>}{>}{<}GLC{>}{<}EI{>}{<}SX10,{<}IS14{>}+{<}IS15{
>}{>}{<}EI{>}{<}IF{<}IS10{>}{240}"."{>}{<}XS10,06,14,,15{>}{<
}SX10,{<}IS14{>}+"."{>}{<}LBD{>}{<}IF{<}IS15{>}{240}"."{>}{<}
SX11,{<}IS15{>}{>}{<}XS11,06,14,,15{>}{<}SV09,1{>}{<}GLD{>}{<
}EI{>}{<}SX10,{<}IS10{>}+{<}IS15{>}{>}{<}EI{>}{<}SX14,{<}IS10
{>}{>}{<}SV15,{>}{<}IF{<}IS10{>}{240}"."{>}{<}XS10,06,14,,15{
>}{<}IF{<}VA|15{>}>3{>}{<}XS15,07,,12,13{>}{<}SX15,{<}IS12{>}
{>}{<}SX09,1{>}{<}EI{>}{<}EI{>}{<}IF({<}PV09{>}>0&{<}VA|14{>}
>6)!{<}VA|14{>}>8{>}{<}SX09,1{>}{<}XS14,08,,12,13{>}{<}SX14,{
<}IS12{>}{>}{<}EI{>}{<}IF{<}PV09{>}>0{>}{<}SX14,{<}IS14{>}+"~
1"{>}{<}EI{>}{<}IF{<}VA|15{>}>0{>}{<}SX14,{<}IS14{>}+"."+{<}I
S15{>}{>}{<}EI{>}{<}SX02,{<}IS02{>}+{<}IS14{>}{>}{<}EI{>}{<}L
BE{>}
{<}IF{<}VA|50{>}>0{>}{<}SX02,{<}IS02{>}+"\"{>}{<}GLA{>}{<}EI{
>}{<}SX50,{<}IS02{>}{>}{<}IF"\[255+252+142]"{238}({<}IS01{>}+
"[255+252+142]")>-1{>}{<}SX50,{<}IS50{>}+"\"{>}{<}EI{>}{<}PR@
50{>}{002}[cr|lf][cr|lf]{{;5lca}} CA trunc[ated] file using 8
{046}3 format RJH 11/30/2002[cr|lf]{002}{<}IF{<}VA|50{>}>0{>}[JM
_]2.trunc[Q2_][BX_]ca {<}PV50{>}[Q2_]{<}IF@NOT({<}ER{>}){>}{<
}PRca @50{>}{<}EI{>}{<}EI{>}{002}[cr|lf][cr|lf]{{;5lcd}} CD (
trunc[ate]) using 8.3 format RJH 11/30/2002[cr|lf]{002}{<}IF
{<}VA|50{>}>0{>}[JM_]2.trunc[Q2_]{<}IF":"{238}{<}IS50{>}==1{>
}{<}SX01,{<}VA@50:1{>}{>}[BX_]{<}PV01{>}:[Q2_]{<}IF{<}ER{>}{>
}{<}EX{>}{<}EI{>}{<}EI{>}[BX_]cd {<}PV50{>}[Q2_]{<}IF@NOT({<}
ER{>}){>}{<}PRcd @50{>}{<}EI{>}{<}EI{>}{002}[cr|lf][cr|lf]
-nd
XPLeNCODE

-----------------------------
Robert Holmgren
holmgren@xxxxxxxx
-----------------------------