I would like to write in the file like this:
set FH [open $ tmpFileName W] Puts $ FH "set one [create_object]", puts $ $ FH "$ one proc1_inside_a" $ FH "$ a proc2_inside_a" $ FH off but its error message gets , Because a variable will be created when the tmpFileName file is executed. So I get an error like this: "a" can not be read: there is no such variable Do you help me in solving this can do? /p>
You just need to use a different quote mechanism to allow double quote commands and variable replacements . The braces will keep their content literally (stop the replacement) [FT [$ tmpFileName] Open $ FH {Set [create_object]} $ $ FH puts {$ a proc1_inside_a} $ FAH { $ a proc2_inside_a } About $ FH Documentation is available:
- TCL is very low - Compare rule 4 versus rule 6
- - Lessons 5 and 6 are applicable
No comments:
Post a Comment