DMUG-Archiv 2000

Frühere

 

Chronologischer Index

 

Spätere

Vorherige

 

Thematischer Index

 

Nächste

AW: Print in Message Window

Hallo,

super, wie flexibel Mathematica ist.

Ein kleiner Verbesserungsvorschlag. Damit nicht für jedes Argument von
MyPrint eine neue Zeile verbraten wird, bzw. MyPrint sich ähnlich verhält
wie Print habe ich es um eine StringJoin[ToString  /@ ins]] Sequenz
erweitert.

\!\(\*
  RowBox[{
    StyleBox[\(MyPrint[arg__]\  := \ 
        Module[{ins\  = \ {arg}}, 
          NotebookWrite[FrontEnd`MessagesNotebook[], 
            Cell[RowBox[
                ToBoxes[
                  StringJoin[ToString\  /@ \ ins]]], \ "\<Print\>"]]\ ]\),
      FormatType->StandardForm,
      FontFamily->"Century Gothic"], 
    "\[IndentingNewLine]", \(MyPrint["\<Hallo \>", 7, \[Pi], Pi, 10\&8]\), 
    "\[IndentingNewLine]", \(Unprotect[Print]\), 
    "\[IndentingNewLine]", \(Print = MyPrint\), 
    "\[IndentingNewLine]", \(Protect[Print]\)}]\)

Gruß, Peter Klamser

-----Ursprüngliche Nachricht-----
Von: Jens-Peer Kuska [mailto:kuska@XXXXXXX.de]
Gesendet: Montag, 27. November 2000 18:10
An: Georg Ch. Mellau
Cc: Deutsche Mathematica News Group
Betreff: Re: Print in Message Window


Hallo,

die Variante:

MyPrint[arg__] := Block[{$Output = OutputStream["stderr", 2]},
Print[arg]]

wird wohl eher nicht gefallen, was ist aber mit

MyPrint2[arg__] := Module[{ins = {arg}},
    NotebookWrite[FrontEnd`MessagesNotebook[], 
      Cell[RowBox[ToBoxes /@ ins], "Print"]]
    ]

und

Block[{Print = MyPrint2},
  Print[x, Pi, "Hallo"]]

??
Besonders r"ude Menschen w"urden hier Print=MyPrint2 global setzen.

Gruss
  Jens


"Georg Ch. Mellau" wrote:
> 
> Hallo,
> 
> ich habe ein Problem :
> 
> Ich moechte das ALLE Mathematica Print[...]  Befehle in den
> Message Fenster landen. Die Methode
> 
> SetOptions[mynotebook,
> PrintAction -> "PrintToConsole"];
> 
> funktioniert nicht, meistens wird doch ins Notebook gedruckt.
> 
> Gibt es hier überhaupt eine  Loesung ?
> 
> MfG
> 
> Georg Mellau
Verweise:
Re: Print in Message Window
Jens-Peer Kuska, 27.11.2000

Frühere

 

Chronologischer Index

 

Spätere

Vorherige

 

Thematischer Index

 

Nächste

DMUG-Archiv, http://www.mathematica.ch/dmug-liste.html; Letzte Änderung: 19.04.2004 18:21