TCL string operations
TCL string operations
(OP)
Is it possible to make the postprocessor to analyze the symbols in string and change them if needed? For example:
source string: "THIS_IS_AN_EXAMPLE"
produced string: "THIS IS AN EXAMPLE"
As you see, the underscore is changed to space.
BTW. How to output in the end of the program the very first tool which was used there in the program? MOM_first_tool puts only the last operation's tool.
source string: "THIS_IS_AN_EXAMPLE"
produced string: "THIS IS AN EXAMPLE"
As you see, the underscore is changed to space.
BTW. How to output in the end of the program the very first tool which was used there in the program? MOM_first_tool puts only the last operation's tool.





RE: TCL string operations
regsub -all {_} $text_string " " text_string
RE: TCL string operations
To get 1st tool at the end I would do something like this
In MOM_start_of_program
global i0wa_first_tool_change
set i0wa_first_tool_change 0
In MOM_first_tool
global i0wa_first_tool_change
global i0wa_first_tool
global mom_tool_number
if {i0wa_first_tool_change == 0} {
set i0wa_first_tool $mom_tool_number
set i0wa_first_tool_change 1
}
You could also use mom_tool_name
Then just declare and output i0wa_first_tool where required.
Be careful that any custom variables are unique. I add AED_ in front of all my variables to ensure they are.
Hope That Helps
Cheers
Steve Griffiths
If you want to make apple pie from scratch, first you must create the universe!
RE: TCL string operations
RE: TCL string operations
RE: TCL string operations
RE: TCL string operations
RE: TCL string operations
RE: TCL string operations
Question to <b>shags72</b>:
Your solution works perfect, thank You very much!
But could You also say what code of symbol "-" (minus) because if I try to change underscore to minus then I get an error in
regsub -all {_} $text_string " " text_string bla-bla-bla, that "-" is used incorrectly.
BTW (as always, offtop) it seems that there is no problem to get the machining time in the end of the program, but what about getting the machining time in the very beginning? is it possible?
PS I am very sorry for my bad English.
RE: TCL string operations
http://ftp.ugs.com/
htt
RE: TCL string operations
RE: TCL string operations
RE: TCL string operations
RE: TCL string operations