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.

Replacing spaces with %20

Old posts that have not been replied to for several years.
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

Sir_Fz wrote:so why is it less time to repeat 1050 times than 5 times ?
The number of microseconds is not entirely accurate (because of other processes using the cpu at the same time) and for such low values the rounding may cause results like that. Let's say your code took about 1.5 microseconds...only a tiny difference in execution time might tip it over.
e
egghead
Master
Posts: 481
Joined: Mon Oct 29, 2001 8:00 pm
Contact:

Post by egghead »

user wrote: It's not been part of eggdrop for a while. But there's a proc called "time" in scripts/compat.tcl.
Thats the culprit indeed. Thanks.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

ok, thanx for the info :)
S
Sc0rp
Voice
Posts: 11
Joined: Tue Sep 09, 2003 5:06 pm

Re: Replacing spaces with %20

Post by Sc0rp »

strikelight wrote:
Sc0rp wrote:Ive written a little tcl script that gets the content of a php page Ive set..

everything works fine untill the 'thing' (username in this case) I want to retreive has spaces in it..
cus then the bot somehow replaces the space with a character which the webserver does not understand..
so.. what I want to do is replace a space with %20 which is a space for internet browsers when used in the address.. (duh :))
problem is im kinda new at tcl scripting and I dont know how to replace stuff..

so my question is HOW can I replace a space with %20 :)

Code: Select all


first reply worked just perfect.. thanks a lot mate :)
regsub -all " " $text "%20" text
or

Code: Select all

set text [string map {" " "%20"} $text]
I prefer the first method myself..

also, a better place to start before asking for commands, is the tcl manpages.
Locked