head 1.2; access; symbols; locks mys:1.2; strict; comment @# @; 1.2 date 2000.04.11.21.41.24; author mys; state Exp; branches; next 1.1; 1.1 date 99.11.09.21.32.05; author mys; state Exp; branches; next ; desc @@ 1.2 log @*** empty log message *** @ text @# Copyright (C) 1999 - Martin Strauss - under terms of GPL #################################################################### # Setzt backslash's fuer eine Stringuebergabe ein proc backslash {s} { set begin_s "" set end_s $s set pos 0 while {$pos != 10000} { set key "" set pos "10000" set kpos [string first "\"" $end_s] if {$pos > $kpos} then { if {$kpos != -1} then { set pos $kpos set key "\\\"" }} set kpos [string first "\\" $end_s] if {$pos > $kpos} then { if {$kpos != -1} then { set pos $kpos set key "\\\\" }} set kpos [string first "\n" $end_s] if {$pos > $kpos} then { if {$kpos != -1} then { set pos $kpos set key "\\n" }} set kpos [string first "\t" $end_s] if {$pos > $kpos} then { if {$kpos != -1} then { set pos $kpos set key "\\t" }} set kpos [string first "\[" $end_s] if {$pos > $kpos} then { if {$kpos != -1} then { set pos $kpos set key "\\\[" }} set kpos [string first "\]" $end_s] if {$pos > $kpos} then { if {$kpos != -1} then { set pos $kpos set key "\\\]" }} set kpos [string first "\{" $end_s] if {$pos > $kpos} then { if {$kpos != -1} then { set pos $kpos set key "\\\{" }} set kpos [string first "\}" $end_s] if {$pos > $kpos} then { if {$kpos != -1} then { set pos $kpos set key "\\\}" }} if {$pos != 10000} then { set begin_s $begin_s[string range $end_s 0 [expr $pos - 1]]$key set end_s "[string range $end_s [expr $pos + 1] end]" } else {return "$begin_s$end_s"} }} @ 1.1 log @Initial revision @ text @d1 67 a67 67 # Copyright (C) 1999 - Martin Strauss - under terms of GPL #################################################################### # Setzt backslash's fuer eine Stringuebergabe ein proc backslash {s} { set begin_s "" set end_s $s set pos 0 while {$pos != 10000} { set key "" set pos "10000" set kpos [string first "\"" $end_s] if {$pos > $kpos} then { if {$kpos != -1} then { set pos $kpos set key "\\\"" }} set kpos [string first "\\" $end_s] if {$pos > $kpos} then { if {$kpos != -1} then { set pos $kpos set key "\\\\" }} set kpos [string first "\n" $end_s] if {$pos > $kpos} then { if {$kpos != -1} then { set pos $kpos set key "\\n" }} set kpos [string first "\t" $end_s] if {$pos > $kpos} then { if {$kpos != -1} then { set pos $kpos set key "\\t" }} set kpos [string first "\[" $end_s] if {$pos > $kpos} then { if {$kpos != -1} then { set pos $kpos set key "\\\[" }} set kpos [string first "\]" $end_s] if {$pos > $kpos} then { if {$kpos != -1} then { set pos $kpos set key "\\\]" }} set kpos [string first "\{" $end_s] if {$pos > $kpos} then { if {$kpos != -1} then { set pos $kpos set key "\\\{" }} set kpos [string first "\}" $end_s] if {$pos > $kpos} then { if {$kpos != -1} then { set pos $kpos set key "\\\}" }} if {$pos != 10000} then { set begin_s $begin_s[string range $end_s 0 [expr $pos - 1]]$key set end_s "[string range $end_s [expr $pos + 1] end]" } else {return "$begin_s$end_s"} }} @