mIRC Home    About    Download    Register    News    Help

Print Thread
Removing control codes #201765 04/07/08 02:22 AM
Joined: May 2008
Posts: 329
A
AWEstun Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: May 2008
Posts: 329
I'm trying to revent control code and the box (contrl-k) symbol in the string. This sort of works, but not always:

var %userbio = $strip($replacex($gettok($6-,-1,35),,),-burcmo)


I registered; you should too.
Re: Removing control codes [Re: AWEstun] #201766 04/07/08 03:26 AM
Joined: Oct 2005
Posts: 1,741
G
genius_at_work Offline
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
$strip(%text) will remove ctrl+ b u r k o (asc: 2, 31, 22, 3, 15)

$strip(%text,b) will remove ctrl+b
$strip(%text,u) will remove ctrl+u

etc.

-genius_at_work

Re: Removing control codes [Re: genius_at_work] #201769 04/07/08 04:09 AM
Joined: May 2008
Posts: 329
A
AWEstun Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: May 2008
Posts: 329
This works:

var %userbio = $strip($gettok($6-,-1,35))

but how do I strip out the  (multiple) that are left.


I registered; you should too.
Re: Removing control codes [Re: AWEstun] #201771 04/07/08 05:51 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Try
Code:
var %userbio = $gettok($6-,-1,35)
%userbio = $strip(%userbio)

In theory, what you have shouldn't have any of those control blocks in it, as the start and end control blocks for each part that is being stripped should be removed.

Re: Removing control codes [Re: RusselB] #201777 04/07/08 12:37 PM
Joined: May 2008
Posts: 329
A
AWEstun Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: May 2008
Posts: 329
That doesnt work either. Also tried:

$remove(%userbio,)

but that didnt work either.


I registered; you should too.
Re: Removing control codes [Re: AWEstun] #201778 04/07/08 12:52 PM
Joined: Aug 2003
Posts: 144
M
Miguel_A Offline
Vogon poet
Offline
Vogon poet
M
Joined: Aug 2003
Posts: 144
Hi.

You need to ue the $chr(nr) off the character.
To know the nr off the $chr identifier you need to use $asc(character) them it will return a number... that number is to be used in $chr. Example:.

Code:
//echo -s $asc()
167
//echo -s $chr(167)



them $remove( text, $chr(nr))

good luck

Re: Removing control codes [Re: Miguel_A] #201779 04/07/08 01:34 PM
Joined: May 2008
Posts: 329
A
AWEstun Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: May 2008
Posts: 329
Originally Posted By: Miguel_A
Hi.

You need to ue the $chr(nr) off the character.
To know the nr off the $chr identifier you need to use $asc(character) them it will return a number... that number is to be used in $chr. Example:.

Code:
//echo -s $asc()
167
//echo -s $chr(167)



them $remove( text, $chr(nr))

good luck


I tried:

var %userbio = $strip($gettok($6-,-1,35))
var %userbio = $remove(%userbio,$chr(11))

but it's not removing the ctrl-k symbol.


I registered; you should too.
Re: Removing control codes [Re: AWEstun] #201780 04/07/08 01:46 PM
Joined: Oct 2005
Posts: 1,741
G
genius_at_work Offline
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
$chr(11) is not the color control code.

ctrl+__

b= 2
u= 31
r= 22
k= 3
o= 15

Maybe the mutilated server you are on is using different control code characters.

-genius_at_work

Re: Removing control codes [Re: genius_at_work] #201782 04/07/08 02:43 PM
Joined: May 2008
Posts: 329
A
AWEstun Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: May 2008
Posts: 329
Originally Posted By: genius_at_work
$chr(11) is not the color control code.

ctrl+__

b= 2
u= 31
r= 22
k= 3
o= 15

Maybe the mutilated server you are on is using different control code characters.

-genius_at_work


It doesn't matter how F'd up the server is, as I'm extracting the infoline and trying to strip codes from with with mIRC.

11 is ctrl-k

source: http://www.nthelp.com/ascii.htm


I registered; you should too.
Re: Removing control codes [Re: AWEstun] #201785 04/07/08 03:58 PM
Joined: Jan 2004
Posts: 1,230
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,230
As he tried to tell you, $chr(11) is NOT the color code!

Try doing:

//echo -s $asc(x)

where you us the ctrl-K in place of the X, and you'll see that it returns 3 and not 11. The color code before the color number is $chr(3) Ctrl-C not the Ctrl-K you entered. You'll find that Ctrl-U puts in a $chr(31) not the $chr(21) you'd expect, etc.

Re: Removing control codes [Re: maroon] #201790 04/07/08 04:36 PM
Joined: May 2008
Posts: 329
A
AWEstun Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: May 2008
Posts: 329
Originally Posted By: maroon
As he tried to tell you, $chr(11) is NOT the color code!

Try doing:

//echo -s $asc(x)

where you us the ctrl-K in place of the X, and you'll see that it returns 3 and not 11. The color code before the color number is $chr(3) Ctrl-C not the Ctrl-K you entered. You'll find that Ctrl-U puts in a $chr(31) not the $chr(21) you'd expect, etc.


Well, THANK GOD you jumped in and clearified his post! We need more people like you! Have you considered cloning and/or DNA storage?


I registered; you should too.