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

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

Using Variables in text?

Johnruehlz
7-Bedrock

Using Variables in text?

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?

6 REPLIES 6

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).

Johnruehlz
7-Bedrock
(To:MJG)

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.

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.

 

Sorry I'm using MathCad 15 I'm looking for a string variable in text

Perhaps you want to use a combination of inserting areas (Math/Text region):

 

Pic_1.png

 

 

 

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

Top Tags