| View previous topic :: View next topic |
| Author |
Message |
llama Voice
Joined: 09 Feb 2006 Posts: 3
|
Posted: Thu Feb 09, 2006 2:23 pm Post subject: regsubing $s |
|
|
| I've made a quote script but I'm having a little trouble with it. If someone does the trigger to show a quote, and the quote has a $ in it, I get an error... say if the line was "blah blah $700 blah blah" ... it would error out on the partyline with "[12:08] can't read "700": no such variable" .. I've tried regsub -all {$} line "\\\$" line .. and I've tried regsub -all {\$} line "\\\$" line, but neither seem to work.. anyone have any suggestions? |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Thu Feb 09, 2006 7:35 pm Post subject: |
|
|
regsub manual page _________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Thu Feb 09, 2006 8:38 pm Post subject: |
|
|
I don't think you need regsub, you probably have a string/list issue in your script. Or the quote has been added inside the Tcl script without skipping $. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
llama Voice
Joined: 09 Feb 2006 Posts: 3
|
Posted: Fri Feb 10, 2006 1:41 am Post subject: |
|
|
| Its read to a list so I can lindex the author/date added.. I didn't think that would cause a problem but apparently it does.. should I string map it instead? |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Fri Feb 10, 2006 10:40 am Post subject: |
|
|
| Code: | set list {
"bla bla $blo bli bla"
"foo $bar fee moo"
}
# and use:
foreach bla $list {
# using $bla will work perfectly
} |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
llama Voice
Joined: 09 Feb 2006 Posts: 3
|
Posted: Fri Feb 10, 2006 4:39 pm Post subject: |
|
|
| I'll try it, thanks ! |
|
| Back to top |
|
 |
|