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.

dollar tcl, small error

Help for those learning Tcl or writing their own scripts.
Post Reply
t
testebr
Halfop
Posts: 86
Joined: Thu Dec 01, 2005 12:22 pm

dollar tcl, small error

Post by testebr »

Code: Select all

bind pub - !dollar dollar
package require http 2.3
proc dollar {n u h c a} {
set ID [::http::geturl http://www.bc.gov.br/htms/infecon/taxas/taxas.htm -timeout 10000]
set X [split [::http::data $ID] \n]
::http::cleanup $ID
regexp {([0-9],[0-9]{4}).*([0-9],[0-9]{4})} $X Z AZ BZ
putserv "PRIVMSG $c :Taxa de compra $AZ / Taxa de venda $BZ"
}
Tcl error [dollar]: can't read "AZ": no such variable

How to fix it?
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Perhaps you meant

Code: Select all

regexp {([0-9],[0-9]{3}).*([0-9],[0-9]{3})} $X Z AZ BZ
as there are only 3 digits after the comma and not 4.
t
testebr
Halfop
Posts: 86
Joined: Thu Dec 01, 2005 12:22 pm

Post by testebr »

thanks, my fault.
Post Reply