Message Boards Message Boards

0
|
2390 Views
|
0 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Define a new output format based on an existing output format, e.g. Fortran

Posted 5 years ago

Hallo .!

I would like to define a new output format based on an existing output format (e.g. FortranForm), and I'll call it "PascalForm". My first idea ...

1.

Format[x_, PascalForm] := Format[x, FortranForm]

2.

Format[x_ ^ y_, PascalForm] := StringForm["power(\`\`,\`\`)", x, y]

fails twice.

to 1. with ... Format::nosym: x_ does not contain a symbol to attach a rule to. >>

to 2. with ... SetDelayed::write: Tag Power in y_ (x_) is Protected. >>

Do you have an idea that could work? Or does someone know the suitable documents to my task? Or is it the depths of internet already a difficult to find solution for me?

Thank you for your help.

Greetings Bernd

POSTED BY: Bernd Rueffer
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract