MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: A module to write a module

  • To: mathgroup at
  • Subject: [mg48910] Re: A module to write a module
  • From: "Peltio" <peltio at>
  • Date: Wed, 23 Jun 2004 02:51:02 -0400 (EDT)
  • References: <c9pfkj$sr9$>
  • Reply-to: "Peltio" <peltioNOSP at>
  • Sender: owner-wri-mathgroup at

"Goyder Dr HGD" wrote

Sorry, I tripped on the cut&paste and left the /. out of the code in my
previous posting.
The code should read:

ModuleTemplate[a_] := NotebookWrite[SelectedNotebook[],
    MakeBoxes @@ ( Hold[
        (* Code with placeholders starts here *)
        ppp::usage = ps1;
        ppp[] := Module[
        (* Code with placeholders ends here *)
    ] /. (*Placeholders replacement *)
            {ppp -> a,
            ps1 -> StringJoin[ToString[a], "[]..."],
            ps2 -> StringJoin[ToString[a], " at Stage 1:"]}
    )], "Input"]

Also, replacing Hold[] with HoldComplete[] might help in treating certain
special cases (with Sequences and the like).

Invalid address in reply-to. Crafty demunging required to mail me.

  • Prev by Date: Printing Rotated Text from a Mac
  • Next by Date: Re: Problem rendering fonts (?) in mathematica
  • Previous by thread: A module to write a module
  • Next by thread: Re: A module to write a module