egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TCL error

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
COBRa
Halfop


Joined: 04 Jan 2013
Posts: 49

PostPosted: Wed Mar 26, 2014 5:14 pm    Post subject: TCL error Reply with quote

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
View user's profile Send private message
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 792
Location: Tennessee, USA

PostPosted: Wed Mar 26, 2014 8:07 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber