Showing results for 
Search instead for 
Do you mean 
Reply
Solved! Go to solution

Post Builder - Comment Formatting

I am trying to pass some variables to other software using comments at the begining of the program. Here is an example:

( MTRLX = "2.000" )
( MTRLY = "3.725" )

 

The trouble I am having is getting the value in quotations.  So far this is what I have:

if {[info exists mom_attr_PROGRAMVIEW_MTRLX]} {
MOM_output_literal "( MTRLX = $mom_attr_PROGRAMVIEW_MTRLX )"
} else {
MOM_output_literal "( MTRLX = N/A )"
}
if {[info exists mom_attr_PROGRAMVIEW_MTRLY]} {
MOM_output_literal "( MTRLY = $mom_attr_PROGRAMVIEW_MTRLY )"
} else {
MOM_output_literal "( MTRLY = N/A )"
}

 

This is what it outputs:

 

( MTRLX = 2.000 )
( MTRLY = 3.725 )

 

This gets the right information except the values need to be in " ".

 

Any one have a solution?

 

 

1 REPLY
Solution
Solution
Accepted by topic author Jwright
‎10-24-2016 08:43 AM

Re: Post Builder - Comment Formatting

You can use \ as escape character in Tcl

so with:

MOM_output_literal "( MTRLX = \"${mom_attr_PROGRAMVIEW_MTRLX}\" )"

you will get output:

( MTRLX = "2.000" )

 

Marek Pawlus, NCmatic

Production: NX 11.0.1
Development: C#, Tcl/Tk, CSE

Learn online





Solution Information