This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

utimer & catch with help

Old posts that have not been replied to for several years.
Locked
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

utimer & catch with help

Post by Ofloo »

Code: Select all

set ::timemsg($fidx) [utimer 50 [list catch {putdcc $fidx "$::colors(0)$::fserv(idle)"}]]
what is wrong if i use catch then it doesn't respond any more .. but if i don't it shows an error once the idx is gone .. so ..

so i wana know how to use utimer with catch or how i would use {} and use multiple lines :p so i can use if {[valididx $fidx]} {...}
XplaiN but think of me as stupid
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

call another proc in the timer. and in the proc do the checks.
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

i tryed ur suggestion and the result was the same if i where to use

Code: Select all

......[list procname $idx]
=

Code: Select all

..... [list catch {commands ..}] 
so any one who might be able to give me short syntax example ..
XplaiN but think of me as stupid
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Re: utimer & catch with help

Post by user »

Ofloo wrote:

Code: Select all

set ::timemsg($fidx) [utimer 50 [list catch {putdcc $fidx "$::colors(0)$::fserv(idle)"}]]
Since "fidx" seems to be a local variable, you probably want variable substitution before the argument is passed to 'utimer'. The braces prevent it, so just get rid of them and replace them with a call to 'list':

Code: Select all

set ::timemsg($fidx) [utimer 50 [list catch [list putdcc $fidx "$::colors(0)$::fserv(idle)"]]]
Have you ever read "The Manual"?
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

tnx man works great
XplaiN but think of me as stupid
Locked