cancel
Showing results for
Did you mean:
cancel
Showing results for
Did you mean:

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

1-Newbie

## How can I export an equation into a text string

Hi,

I have an equation that I manipulate in Mathcad and I would like to communicate the resulting expression to an acquaintance as text.

How do I copy/paste my equation as string of ASCII characters?

e.g. expression from math region:

I would like the string that I copy to look similar to this: a^2*(b*x+c)/c

The clipboard content is: "(* (^ a 2) (@PARENS (/ (+ (* b x) c) c)))"

Is this functionality not present by design?

1 ACCEPTED SOLUTION

Accepted Solutions
19-Tanzanite
(To:ccziezerski)

Sorry, but there is no way to do what you want.

6 REPLIES 6
19-Tanzanite
(To:ccziezerski)

Sorry, but there is no way to do what you want.

4-Participant
(To:RichardJ)

Actually, the problem might be solvable!

Text has a perfect LISP syntax.

What you need is some kind of lisp to vba code converter as i see...

23-Emerald II
(To:ccziezerski)
 ccziezerski wrote: Hi, I have an equation that I manipulate in Mathcad and I would like to communicate the resulting expression to an acquaintance as text. How do I copy/paste my equation as string of ASCII characters? e.g. expression from math region: I would like the string that I copy to look similar to this: a^2*(b*x+c)/c The clipboard content is: "(* (^ a 2) (@PARENS (/ (+ (* b x) c) c)))" Is this functionality not present by design?

That's interesting. I tried looking at the clipboard contents with Mathcad 14 and all I can see is an image of the equation. Is this a Prime thing or does the capability exist to show this in Mathcad 14/15?

If it's possible to paste that string into a variable, then it shouldn't be *too* hard to write a function to convert the prefix notation into infix notation.

One other way of doing it (not sure if it would work in Prime as it doesn't have components(??)) would be to Tag the region(s) containing the equation(s) of interest, do a region search (within a component) for the tag, get the regions; xml string and then convert that string (which is in prefix form, albeit heaving xml-ed) to infix notation. ... although if such a conversion function existed, then it should be just a matter of manually finding the tagged region in a text editor, copying it and pasting into a Mathcad worksheet containing the converter function.

It should really be a built-in capabilty, after all, Mathcad already knows how to do this to display the equation in the first place.

Stuart

PS. There have been many, long-standing requests to do back-and-Forth (programming joke) conversion between Mathcad's display and standard programming formats.

19-Tanzanite
(To:StuartBruff)
 That's interesting. I tried looking at the clipboard contents with Mathcad 14 and all I can see is an image of the equation. Is this a Prime thing or does the capability exist to show this in Mathcad 14/15?

It's a Prime thing.

 One other way of doing it (not sure if it would work in Prime as it doesn't have components(??)) would be to Tag the region(s) containing the equation(s) of interest, do a region search (within a component) for the tag, get the regions; xml string and then convert that string (which is in prefix form, albeit heaving xml-ed) to infix notation. ... although if such a conversion function existed, then it should be just a matter of manually finding the tagged region in a text editor, copying it and pasting into a Mathcad worksheet containing the converter function.

Prime does not have tags for regions, does not have components, and the XML is full of non-printing characters (look at a .mcdx file in Notepad, and it bears little resemblance to a .xmcd file). Aside from that, what you suggest should work perfectly

 PS. There have been many, long-standing requests to do back-and-Forth (programming joke) conversion between Mathcad's display and standard programming formats.

A real gem (perhaps a Ruby?) of a joke.

1-Newbie
(To:StuartBruff)

Hi All,