| View previous topic :: View next topic |
| Author |
Message |
testebr Halfop
Joined: 01 Dec 2005 Posts: 86
|
Posted: Wed Apr 09, 2008 6:30 pm Post subject: dollar tcl, small error |
|
|
| Code: | 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? |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Wed Apr 09, 2008 6:57 pm Post subject: |
|
|
Perhaps you meant
| Code: | | 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. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
testebr Halfop
Joined: 01 Dec 2005 Posts: 86
|
Posted: Wed Apr 09, 2008 7:16 pm Post subject: |
|
|
| thanks, my fault. |
|
| Back to top |
|
 |
|