Heyhoo,
now i need to compare a String like “[INTENSITY]” to $line. ATM i want to do it like
if { [string compare "[INTENSITY]" $line] == 0 } { }
but i think there is a problem with the “[” and the “]”. But how could i escape it ?
I could not find a good book or a really good website online.
Next Question is i created an array like
set data [split $file_data "\n"]
why i coulnd say array stat $data ???
Hope you could help me again.
For the first item, use
{}as string delimiters to prevent command substitution (which is what happens with [] in a double-quoted string)On the second item,
splitcreates a list, not an array. Index into it withlindex:The best website for tcl info is the Tcler’s Wiki at http://wiki.tcl.tk/