| |
| |
| |
|
Page: 1 2
Comments:
<0> but its inside another proc... <0> i just dont want to write two procs to test it here :P <1> ah :) <0> but something is wrong <0> ;proc filter var { upvar $var locvar; set locvar [string trim $locvar] } <2> Gotisch: #2311 (359 clicks) Tcl: <0> ;set a " test "; filter a; set a <2> Gotisch: #2312 (607 clicks) Tcl: test <0> ;set a " test "; puts [string length $a]; filter a; string length $a <2> Gotisch: #2313 (stdout) 6 <2> Gotisch: #2313 (866 clicks) Tcl: 4
<0> ok so this works :> <0> ;expr round(2.3) <2> Gotisch: #2317 (7766 clicks) Tcl: 2 <0> ;expr round(22.3423) <2> Gotisch: #2318 (193 clicks) Tcl: 22 <0> ;expr round(22.5423) <2> Gotisch: #2319 (194 clicks) Tcl: 23 <0> ;expr round(s) <2> Gotisch: #2320 (262 clicks) Tcl error: syntax error in expression "round(s)": variable references require preceding $ <0> duh! <0> ;expr round(a) <2> Gotisch: #2322 (245 clicks) Tcl error: syntax error in expression "round(a)": variable references require preceding $ <3> .tcl string length Njct2NUez75cKk+5pWC/FIq85Y4PX9VV3FbhLZO9FVU <2> poci: #2323 (214 clicks) Tcl: 43 <0> .tcl lreplace <2> Gotisch: #2324 (218 clicks) Tcl error: wrong # args: should be "lreplace list first last ?element element ...?" <0> .tcl string is numeric 123 <2> Gotisch: #2325 (539 clicks) Tcl error: bad cl*** "numeric": must be alnum, alpha, ascii, control, boolean, digit, double, false, graph, integer, lower, print, punct, space, true, upper, wordchar, or xdigit <0> .tcl string is digit 123 <2> Gotisch: #2326 (238 clicks) Tcl: 1 <0> .tcl string is digit 123a <2> Gotisch: #2327 (231 clicks) Tcl: 0 <0> .tcl string is double 123a <2> Gotisch: #2328 (260 clicks) Tcl: 0 <0> .tcl string is double 123.23 <2> Gotisch: #2329 (269 clicks) Tcl: 1 <0> ;proc filter tofilter { <0> set list1 [split $tofilter] <0> set size [lindex $list1 end] <0> if {[string is double $size]} { <0> set tofilter [join [lreplace $list1 end end [expr {round($size)}]]] <0> } <0> return $tofilter <0> } <0> ;filter "this is a test 12.3" <2> Gotisch: #2332 (547 clicks) Tcl error: can't read "locvar": no such variable <0> proc filter2 tofilter { <0> set list1 [split $tofilter] <0> set size [lindex $list1 end] <0> if {[string is double $size]} { <0> set tofilter [join [lreplace $list1 end end [expr {round($size)}]]]
<0> } <0> return $tofilter } <0> ;filter2 "this is a test 12.3" <2> Gotisch: #2335 (6740 clicks) Tcl error: invalid command name "filter2" <0> i hate that bot <0> ;clock scan "00:00" <2> Gotisch: #2370 (234 clicks) Tcl: 1138039200 <0> clock format 1138039200 <2> Gotisch: #2371 (288 clicks) Tcl: Tue Jan 24 12:00:00 AM US/Central 2006 <0> now it happened <0> mysql blocked <0> bot waited for thread <0> and timed out <4> hi <0> .tcl clock format 1091061714 <2> Gotisch: #2477 (24349 clicks) Tcl: Thu Jul 29 06:41:54 AM US/Central 2004 <4> is there a way to replace all spaces in a string with another char? <5> ;set t "gh dg d gfd g fd gfsd " <2> badaas: #2527 (141 clicks) Tcl: gh dg d gfd g fd gfsd <5> ;string map { ^} $t <2> badaas: #2528 (24720 clicks) Tcl error: char map list unbalanced <5> ;string map {" " "^"} $t <2> badaas: #2529 (300 clicks) Tcl: gh^dg^d^gfd^g^fd^gfsd^ <5> ;set t <2> badaas: #2530 (127 clicks) Tcl: gh dg d gfd g fd gfsd <5> ;regsub -all -- { } $t {\^} t <2> badaas: #2531 (8716 clicks) Tcl: 7 <5> ;set t <2> badaas: #2532 (131 clicks) Tcl: gh\^dg\^d\^gfd\^g\^fd\^gfsd\^ <4> nice <4> thanks man <5> np <6> ;regsub -all -- {\s} $t {\^} <2> yoe: #2545 (59984 clicks) Tcl: gh\^dg\^d\^gfd\^g\^fd\^gfsd\^ <6> ;regsub -all -- {\s} $t {^} <2> yoe: #2546 (232 clicks) Tcl: gh\^dg\^d\^gfd\^g\^fd\^gfsd\^ <6> weird <6> ;regsub -all -- {\s} $t "^" <2> yoe: #2548 (211 clicks) Tcl: gh\^dg\^d\^gfd\^g\^fd\^gfsd\^ <7> ;$t <2> anc: #2549 (7233 clicks) Tcl error: invalid command name "gh\^dg\^d\^gfd\^g\^fd\^gfsd\^" <0> ;scan /001 %c <2> Gotisch: #2550 (194 clicks) Tcl: 47 <0> / <0> ;scan \001 %c <2> Gotisch: #2552 (161 clicks) Tcl: 1 <0> <4> is there a way to see which trigger called the procedure?
Return to
#tcl or Go to some related
logs:
#stocks #red #beginner irc.irchighway.net #sk8videos #nhl #online #beginner sql server linked table datetime ms access #politics #nhl
|
|