Apr 22, 2004 #1 6839470 Programmer Joined Mar 7, 2004 Messages 45 Location US I need an example code for left or right shift operator. anyone ?/.. like for (j=7; j>=0, j--) { if ( (1 << j) &rew_y) { puts "done" } } equivalent thing in tcl??
I need an example code for left or right shift operator. anyone ?/.. like for (j=7; j>=0, j--) { if ( (1 << j) &rew_y) { puts "done" } } equivalent thing in tcl??
Apr 22, 2004 #2 ulis Programmer Joined Oct 12, 2001 Messages 429 Location FR Tcl uses the same expressions as C but needs a expr command if the expression is ouside a if command. Code: set rew_y 7 for {set j 7} {j >= 0} {incr j -1} { if ( (1 << j) & rew_y(i) ) { puts "done" } } (not tested) More on the Tcl expressions at: http://mini.net/tcl/expr HTH ulis Upvote 0 Downvote
Tcl uses the same expressions as C but needs a expr command if the expression is ouside a if command. Code: set rew_y 7 for {set j 7} {j >= 0} {incr j -1} { if ( (1 << j) & rew_y(i) ) { puts "done" } } (not tested) More on the Tcl expressions at: http://mini.net/tcl/expr HTH ulis