// -*- ASCII:EDT -*- // StatusPath.edt // cuts out the middle of // Current File's Path (InfoA) // and Current Path (InfoB) // to be shown in the Status Line. // If both paths are the same, // InfoB shows the Project's name // (schlicht 20010310) ///////////////////////////////// // Temporarily store the Local Registers: Assign('tmp8','%!8'); Assign('tmp9','%!9'); // Trim %p: GetLength(9,"%p"); > IfNum(%!9,40,">",> !"LetRegNum(9,%!9-20); > ReplaceInString('%p',' ... ',15,%!9,0,9);",> !"LetReg(9,'%p');");> IfStr("%!9","","=",> "Assign('InfoA','*** new ***');",> "Assign('InfoA','%!9');"); // Trim %!P: IfStr("%p","%!P","=",> !"Assign('InfoB','---- %!n ----');",> !"GetLength(8,'%!P'); > IfNum(%!8,40,'>',> !'LetRegNum(8,%!8-20); > ReplaceInString(''%!P'','' ... '',15,%!8,0,8);',> !'LetReg(8,''%!P'');');> Assign('InfoB','%!8');> "); LetReg(8, |%$('tmp8')|); LetReg(9, |%$('tmp9')|); End; // If you are not pleased with the lengths, // here are the numbers that you might want to change: // 18: IfNum(%!9,40,">",> // ^^ if the path is shorter than 40 character // it will not be trimmed // 19: !"LetRegNum(9,%!9-20); > // ^^ the last 20 characters are shown // 20: ReplaceInString('%p',' ... ',15,%!9,0,9);",> // the first 15 character are shown ^^ // // To actually show the trimmed path, // you have to set Custom Info A and/or B // as %$('InfoA'); resp. %$('InfoB'); // (in Options|Appearance|Panels) // and you have to define the // "MDI Open Macro" and "MDI Activate Macro" as // [Exe('%B\Macros\StatusPath.edt);] // (in Options|Preferences|Events) // If one of them already is defined just // append it. // // R Schlicht w.m.l@gmx.net //////////////////////////////////////////////// $Id: StatusPath.edt,v 1.2 2001-11-13 18:40:17+01 standard Exp standard $