From: oc_forums on 17 Apr 2010 17:13 Hi All ! The following worked well with BLT in Tcl/Tk 8.4.7 and BLT : (it just multiplies the components of a vector by a constant) *************** package require BLT proc oc:blt:changeRatio {localRatio localDataList} { blt::vector create localVector -watchunset 1 localVector set $localDataList localVector expr {localVector * $localRatio} return $localVector(:) } set x [list 0.02 0.04 0.06 0.08 0.10 0.12 0.14 0.16 0.18 0.20] set result [oc:blt:changeRatio 1 $x] *************** But the following gives the error "can't read localVector(:)" with or without the option -watchunset (with rbc 0.1 in Tcl/Tk 8.5.8.1) ***************** package require rbc 0.1 proc oc:blt:changeRatio {localRatio localDataList} { # rbc::vector create localVector -watchunset 1 rbc::vector create localVector localVector set $localDataList localVector expr {localVector * $localRatio} return $localVector(:) } set x [list 0.02 0.04 0.06 0.08 0.10 0.12 0.14 0.16 0.18 0.20] set result [oc:blt:changeRatio 1 $x] ************ Has anyone had the same concern ? Thanks, Olivier
|
Pages: 1 Prev: XF Download Next: Best Way to mask input into a entry box |