Cancel
Showing results for 
Search instead for 
Did you mean: 

NULL or \0 or \x0 in tcl

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

Hello!

I have a problem with output NULL symbol in tcl, for example:

 

MOM_output_literal "\0"

or

MOM_output_literal "\x0"

 

I see in output file

 

АЂ %

N001M63

..

 

And - no problems with any anothers symbols...

 

Thanks.

 

 

19 REPLIES

Re: NULL or \0 or \x0 in tcl

Pioneer
Pioneer

Something to do with the MOM intrepreter for TCL checking for something (within the parentheses)? and performing substitution?

 

anyway, do this any your output will be what you expect.

 

MOM_output_literal "\\0"


MOM_output_literal "\\x0"

Re: NULL or \0 or \x0 in tcl

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

Not worked. I insert \007 (Bond, James Bond) and later edit it to 00. Not so good solution..

Re: NULL or \0 or \x0 in tcl

Pioneer
Pioneer

2 \ not 1

 

"\\"      !!!!!!!!!

Re: NULL or \0 or \x0 in tcl

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

2, of course, 2..

 

MOM_output_literal "\\x0"

 

N35 \x0  - result 

 

Or - you have another result? 

Re: NULL or \0 or \x0 in tcl

Pioneer
Pioneer

From TCLers' WIKI"

 

 

 

Many languages have a special "null" value (be it null or NULL or nil or ...) that is different from all other values — sometimes it is not even equal to itself — and somehow represents "data missing". Tcl doesn't have this, among other reasons because it violates the everything is a string principle."

Re: NULL or \0 or \x0 in tcl

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

I read it. 

Re: NULL or \0 or \x0 in tcl

Esteemed Contributor
Esteemed Contributor

How about the following?

 

MOM_output_literal "[format "%c" 0]"

 

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX12.0

How to Get the Most from Your Signature in the Community

Re: NULL or \0 or \x0 in tcl

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

N35 АЂ

 

A same result for MOM_output_literal "\0"

Re: NULL or \0 or \x0 in tcl

Esteemed Contributor
Esteemed Contributor

Then there seems to be no other solution than outputting a marker and replacing it after the post run with the null character.

 

MOM_output_literal "NULL_CHAR"

' use regular Tcl/Tk commands to replace the marker with \0 in end_of_program

 

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX12.0

How to Get the Most from Your Signature in the Community

Learn online





Solution Information