Skip to main content
1-Visitor
October 12, 2017
Question

Using Variables in text?

  • October 12, 2017
  • 2 replies
  • 7119 views

Hello all first of thank you all for being quick to answer my questions since I'm a mathcad newbie.

But to the question is there a way to place a variable in a text string so when the variable changes the text changes too?

2 replies

1-Visitor
October 12, 2017

You can include a math region within a text region.  Or, you can convert a number to a string and concatenate it with other strings.
Capture.PNG

 

If you want the actual contents of a text region to change, it might be possible with scripted components in Mathcad 15 (or prior).

1-Visitor
October 12, 2017

Well all I'm doing is retrieving contents from an Excel files the values I wish to change and actually already strings. I'm just puting a header in for the answers I display so if the Excel says "Point 1" "Point 2" I want the header to say Answers from "Point 1" to "Point 2" the only time the variable would actually change is if the excel file changed.

25-Diamond I
October 12, 2017

Its still not clear what exactly you are looking for.

 

Either a string variable, then Fred and MJG may already have given you hints how to implement it

or a true, stand alone text. For the latter there is no solution, at least not in Prime. In Mathcad 15 (you did not state which version of Mathcad you are dealing with) you could help yourself with scripted textboxes, but as yo many other  things they are not inmplemented in Prime.

 

23-Emerald I
October 12, 2017

You can imbed a math expression in a text block.  So changing the value of a number in text is do-able.  Rewriting text because of a variable change would be a challenge.

mathintext.PNG