@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4 5 6 7



Comments:

<0> tnx _Dejavu_
<1> I am trying to work with lreplace and I just cant figure out how to use it. I have tried many things. What I want to do is loop my list and append a value onto each item. [lreplace $mylist $i $i $thenewvalue] ... But I keep getting invalid command name.
<1> can anyone point me in the right direction on how to use this
<1> or recomend a better way to accomplish what im trying to do
<2> invalid command name what?
<1> invalid command name "test item1 item2 item3"
<1> test is the $thenewvalue
<3> i dont think you get that error from [lreplace $mylist $i $i $thenewvalue]
<2> yeah
<2> you got an extra eval or something
<3> yeah
<2> or a variable with [ ] in it
<2> or wait
<3> yeah
<2> your line is [lreplace $mylist $i $i $thenewvalue]
<1> yes



<2> you dont need the [ ]
<1> ok
<2> its trying to execute the return value of the lreplace
<1> ah!
<2> actually lreplace returns a list
<2> it doesnt modify it
<2> so you need
<2> set mylist [lreplace $mylist $i $i $thenewvalue]
<1> ahhh, no wonder.
<1> thank you very much
<4> is it possible to make an eggdrop login to a gameserver which runs through screens and make it obtain what is written in the gamelog ?
<4> screen -r Q4-28002 thats the way to start the screening as a user in linux
<4> but how do i make tcl do it ?
<5> anc- xtcl
<5> to run a tcl into the background
<4> ok nice
<5> =)
<4> Robb` that fileevent you talked about
<4> how does that work
<4> i have a log now. so i just need that new info from that log everytime it is updated
<5> like, you open a filestream.. to the log file
<4> never worked with fielstream
<4> filestream
<5> and.. fileevent $file readable proc
<4> proc GetData {chan} {
<4> if {![eof $chan]} {
<4> puts [gets $chan]
<4> }
<4> }
<4> fileevent $chan readable [list GetData $chan]
<5> yea kinda
<4> will that put out new data ?
<5> yea
<4> ok
<5> ;}
<4> but i dont understand how it can whatch over the file all the time
<4> this must be triggered by something ?
<4> or ?
<5> yea ofcourse
<6> either APIs or, most likely, checking the file often
<5> timer checking
<4> ah true
<5> timed*
<4> is it capable of remember how the file looked before then and put out new data if there is any ?
<4> or does it just put out all the data in this case
<5> it puts out the line that was written to the chan
<4> uhm what does that got to do with my log
<5> chan as in the filestream :p
<4> so chan will i replace with an open file ?
<4> :?
<4> i need some examples :/
<7> ...
<7> the log is a file?
<4> ? lsearch
<8> lsearch -> http://Tcl.Tk/man/tcl8.5/TclCmd/lsearch.htm
<6> read ?
<8> read -> http://Tcl.Tk/man/tcl8.5/TclCmd/read.htm
<9> write ?
<9> sup mr blackcat
<9> ahh
<9> die blackcat !DIE!



<8> R2_2k: #3416 (2471046 clicks) Tcl: Reset safetcl.
<9> ^ BL4DE
<9> ^?
<9> !?
<9> ^ test
<9> wtf
<6> ;)
<6> die
<9> ^?
<8> BL4DE: #6 (1217445 clicks) Tcl: Reset safetcl.
<9> ohh
<9> haha
<9> lol
<9> so
<9> how would you handle encrypted configs for a tcl app?
<6> eeh ?
<9> rock on tiz what i thought lol
<6> the best way to encrypt a tcl is to rename functions
<6> and modify the way they work
<9> how would renaming functions help if tcl is still readable by human ?
<6> well, readable wont help if u dont understand it ;)
<9> hehe ya
<6> had some webpage once with a LONG description on how to write extremly crappy code
<9> i can already write crappy code
<10> hehe
<9> anyone here do deving on linux?
<9> i know theres **** for tcl ide's what about a "comfortable" editor capable of syntax highlighting?
<3> R2_2K
<3> fireegl made a syntax for a linux editor
<4> ;set multiply 2
<4> ;set list "3 6 3 2 1 4"
<8> anc-: #21 (168 clicks) Tcl: 2
<8> anc-: #22 (146 clicks) Tcl: 3 6 3 2 1 4
<4> id like to multiply every second number in this case
<4> multiply decides if its every third or fourth or whatever number
<4> someone got a suggestion
<4> ?
<7> mh?
<4> mh ?
<7> yes whats so hard about that?
<7> do some magic m8 :)
<4> dont know might have stared me blind on it :/
<4> been coding the whole day
<9> something like : maybe : .tcl set bleh 1 ;foreach num $list { if {$bleh == 1} { puts expr $multiply * $num ; set bleh 0 } else { set bleh 1} }
<9> .tcl set bleh 1 ;foreach num $list { if {$bleh == 1} { puts expr $multiply * $num ; set bleh 0 } else { set bleh 1} }
<8> R2_2k: #34 (1111 clicks) Tcl error: wrong # args: should be "puts ?-nonewline? ?channelId? string"
<9> .tcl set bleh 1 ;foreach num $list { if {$bleh == 1} { puts [expr $multiply * $num] ; set bleh 0 } else { set bleh 1} }
<8> R2_2k: #35 (stdout) 6
<8> R2_2k: There's 6 lines, but I'm not gonna show you the rest of them! =P
<9> lies 6lines
<4> bleh ?
<9> i love bleh
<9> bleh tmp **** grr
<9> all good vars
<4> $multiply various from 1 to 100
<4> its huge lists
<7> its so easy :>
<4> :<
<9> ^"?
<7> comeone you can do it!
<4> ill make some food instead
<4> :I
<9> sounds good
<7> tz
<7> lets do it
<7> ill start
<7> proc funkymult { list num } {
<4> hehe
<4> well i think i might have found a way
<4> just need to split the list up first
<7> oO
<4> but food time now
<4> :)


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #tcl
or
Go to some related logs:

ahas hacker
Hablooo
Nero Wont Load
#linux-noob
maw3id
#nhl
#politics
colatapins
ameritrade streamer pink sheets bid ask
#gentoo



Home  |  disclaimer  |  contact  |  submit quotes