The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » sci.math.* » sci.math.symbolic

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Maple procedures
Replies: 11   Last Post: Jul 22, 2004 10:13 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Joe Riel

Posts: 95
Registered: 12/8/04
Re: Maple procedures
Posted: Jun 23, 2004 4:10 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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);
"\n ...." = "\n"
catch "procedure name expected":
error "%1 is not a procedure name",p
finally interface('screenwidth'=width)
end try;

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

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.