| View previous topic :: View next topic |
| Author |
Message |
COBRa Halfop
Joined: 04 Jan 2013 Posts: 49
|
Posted: Wed Mar 26, 2014 5:14 pm Post subject: TCL error |
|
|
hi im writing a script to give me a better number output im using this code to achieve it
| Code: | proc isy:sizeconvert { totalsize } {
set tsize $totalsize
set tsize "[format "%.2f" $tsize]\00315MB\003"
if {$totalsize >= 1024 && $totalsize < 1048576} {
set tsize [expr $totalsize / 1024] ·
set tsize "[format "%.2f" $tsize]\00315GB\003"
}
if {$totalsize >= 1048576} {
set tsize [expr $totalsize / 1024 / 1024];
set tsize "[format "%.2f" $tsize]\00315TB\003"
}
return $tsize
} |
and the output line is this
| Code: | | set sizecount [isy:sizeconvert [lindex $row 3]] |
but when i action the script i receive this error
Tcl error [isy:group]: wrong # args: should be "set varName ?newValue?"
any help would be appreciated |
|
| Back to top |
|
 |
SpiKe^^ Owner

Joined: 12 May 2006 Posts: 792 Location: Tennessee, USA
|
Posted: Wed Mar 26, 2014 8:07 pm Post subject: |
|
|
This may be the error line... | Code: | | set tsize [expr $totalsize / 1024] · |
Make that more like this maybe... | Code: | | set tsize "[expr $totalsize / 1024] ·" |
Better yet, what's the deal with the · anyway?? just get rid of that... | Code: | | set tsize [expr $totalsize / 1024] |
_________________ SpiKe^^
Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
. |
|
| Back to top |
|
 |
|