Axel Vogt wrote:
I like that: before i had a dirty solution in Excel
with copy & paste. But it was simple to remove just
the _trailing 7 characters_ for lines of the body.
Hmmm, that is simpler. It also points out an error in my previous
version, lines with out line numbers are not properly indented. Here is
the fix (apologies for multiple versions):
PrintProc := proc(p::name,lines::{posint,posint..posint})
local width;
option `Copyright (C) 2004 by Joseph S. Riel. All rights reserved.`; description "Print like showstat, but without line numbers";
width := interface('screenwidth'=infinity);
try
printf("%s",
StringTools:-RegSubs(
"\n ...." = "\n"
,debugopts('procdump'=
`if`(nargs=1,p,[args]))))
catch "procedure name expected":
error "%1 is not a procedure name",p
finally interface('screenwidth'=width)
end try;
NULL
end:
This works with procedures that have up to 999 numbered lines. It is
unlikely that Maple procedures will be longer, however, if you need to
handle them, use "\n( |[1-9])...." for the regexp, that will take you
out to 9999. I haven't bothered testing beyond that.
Joe Riel
option `Copyright (C) 2004 by Joseph S. Riel. All rights reserved.`;
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 293 |
Nodes: | 16 (2 / 14) |
Uptime: | 231:04:53 |
Calls: | 6,624 |
Files: | 12,171 |
Messages: | 5,319,316 |