Hello Everyone,
I have been trying to figure out why the below expr doesn't work, but to no avail, and am hoping that one of you could shed some light on the issue.
if {$pointX < [expr ([lindex $x $m]-[lindex $x $l]) * ($pointY-[lindex $y $l])]} {
puts "hello"
}
when
[lindex $x $m] = 5
[lindex $x $l] = 1
$pointY = 3
[lindex $y $l] = 2
However, when I substitute the actual numeric value:
if {$pointX < [expr ([lindex $x $m]-1) * ($pointY-2)]} {
puts "hello"
}
The code works.
Does expr have problem evaluating [lindex... as an operand?
Thanks very much in advance.
I have been trying to figure out why the below expr doesn't work, but to no avail, and am hoping that one of you could shed some light on the issue.
if {$pointX < [expr ([lindex $x $m]-[lindex $x $l]) * ($pointY-[lindex $y $l])]} {
puts "hello"
}
when
[lindex $x $m] = 5
[lindex $x $l] = 1
$pointY = 3
[lindex $y $l] = 2
However, when I substitute the actual numeric value:
if {$pointX < [expr ([lindex $x $m]-1) * ($pointY-2)]} {
puts "hello"
}
The code works.
Does expr have problem evaluating [lindex... as an operand?
Thanks very much in advance.