Changeset 5590 for data/media
- Timestamp:
- Jul 28, 2009, 5:37:28 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
data/media/tcl/init.tcl
r5589 r5590 211 211 212 212 # define the modified version of unknown 213 proc unknown args { 214 global ::orxonox::errormessage_unknown ::orxonox::errormessage_unknown_length 215 216 set cmd [concat ::tcl::unknown $args] 217 if {[info tclversion] < 8.5} { 213 # we implement two versions, because tcl8.4 complains if this fork is moved inside [unknown] 214 if {[info tclversion] >= 8.5} { 215 # version >= 8.5 216 proc unknown args { 217 global ::orxonox::errormessage_unknown ::orxonox::errormessage_unknown_length 218 219 set cmd [concat ::tcl::unknown $args] 220 set errorcode [catch {eval $cmd} result options] 221 set resultlist [split $result] 222 set success 1 223 224 if {$errorcode && [llength $resultlist] >= $::orxonox::errormessage_unknown_length} { 225 for {set i 0} {$i < $::orxonox::errormessage_unknown_length} {incr i} { 226 if {[lindex $::orxonox::errormessage_unknown $i] != [lindex $resultlist $i]} { 227 set success 0 228 break 229 } 230 } 231 } else { 232 set success 0 233 } 234 235 if {!$success} { 236 return -code $errorcode -options $options $result 237 } else { 238 return [query $args] 239 } 240 } 241 } else { 242 # version < 8.5 243 proc unknown args { 244 global ::orxonox::errormessage_unknown ::orxonox::errormessage_unknown_length 245 246 set cmd [concat ::tcl::unknown $args] 218 247 set errorcode [catch {eval $cmd} result] 219 } else { 220 set errorcode [catch {eval $cmd} result options] 221 } 222 set resultlist [split $result] 223 set success 1 224 225 if {$errorcode && [llength $resultlist] >= $::orxonox::errormessage_unknown_length} { 226 for {set i 0} {$i < $::orxonox::errormessage_unknown_length} {incr i} { 227 if {[lindex $::orxonox::errormessage_unknown $i] != [lindex $resultlist $i]} { 228 set success 0 229 break 248 set resultlist [split $result] 249 set success 1 250 251 if {$errorcode && [llength $resultlist] >= $::orxonox::errormessage_unknown_length} { 252 for {set i 0} {$i < $::orxonox::errormessage_unknown_length} {incr i} { 253 if {[lindex $::orxonox::errormessage_unknown $i] != [lindex $resultlist $i]} { 254 set success 0 255 break 256 } 230 257 } 231 } 232 } else { 233 set success 0 234 } 235 236 if {!$success} { 237 if {[info tclversion] < 8.5} { 258 } else { 259 set success 0 260 } 261 262 if {!$success} { 238 263 return -code $errorcode $result 239 264 } else { 240 return -code $errorcode -options $options $result 241 } 242 } else { 243 return [query $args] 265 return [query $args] 266 } 244 267 } 245 268 }
Note: See TracChangeset
for help on using the changeset viewer.