Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X
I am using Creo Parametric Release 7.0 and Datecode7.0.5.0
I would like to write a relation like this STD_LUM - 2" x 4" but if I write String Parameter using Quotation mark the results comes like this STD_LUM - 2 ' ' x 4 ' '
SIZE = "STD_LUM - " + itos(W) + "''" + " x " + itos(H) + "''"
Here are the errors that I faced
Results not came as per my expectation.
Solved! Go to Solution.
Most likely you have an inconsistency in the quotation marks you are using. If you want the resultant string to contain a double quotation mark it's best to enclose the strings in single quotation marks. Either will work, you just have to be careful. For example, to get what you're trying to do, the relation will look like:
SIZE = "STD_LUM-" + ITOS ( W ) + '" X ' + ITOS ( H ) + '"'
You have to make sure any quote you want to have in the string is enclosed by the "other type".
If I wanted to have both feet and inches in the type of thing you're doing, it would be something like
txtMeasure = "LENGTH = " + ITOS ( lenFeet ) + "'" + ITOS ( lenInches ) + '"'
Most likely you have an inconsistency in the quotation marks you are using. If you want the resultant string to contain a double quotation mark it's best to enclose the strings in single quotation marks. Either will work, you just have to be careful. For example, to get what you're trying to do, the relation will look like:
SIZE = "STD_LUM-" + ITOS ( W ) + '" X ' + ITOS ( H ) + '"'
You have to make sure any quote you want to have in the string is enclosed by the "other type".
If I wanted to have both feet and inches in the type of thing you're doing, it would be something like
txtMeasure = "LENGTH = " + ITOS ( lenFeet ) + "'" + ITOS ( lenInches ) + '"'