mIRC Home    About    Download    Register    News    Help

Print Thread
#134939 06/11/05 09:42 AM
Joined: Oct 2005
Posts: 54
B
Babel fish
OP Offline
Babel fish
B
Joined: Oct 2005
Posts: 54
That would be usefull wouldn't it?
IE.
alias newnick {
/nick $replace($1-,$space,_)
}
laugh
small thought


Chat NSN
My Server: sleepystickman.ircxpro.com
Joined: Jun 2003
Posts: 5,024
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Jun 2003
Posts: 5,024
$chr(32).

Regards,


Mentality/Chris
Joined: Jun 2004
Posts: 65
S
Babel fish
Offline
Babel fish
S
Joined: Jun 2004
Posts: 65
alias space {
return $chr(32)
}

Joined: Apr 2003
Posts: 701
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
Have you actually tried that?
//echo -s $len($space) <-> $len($chr(32))

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Yep, doesn't work. $space returns nothing because mIRC treats spaces with no other data as $null.

//echo -a This $+ $space $+ is $+ $space $+ fun.
Thisisfun.

Doesn't work. smile


Invision Support
#Invision on irc.irchighway.net
Joined: Oct 2005
Posts: 3
E
Self-satisified door
Offline
Self-satisified door
E
Joined: Oct 2005
Posts: 3
Quote:
Have you actually tried that?
//echo -s $len($space) <-> $len($chr(32))


It should be //echo -s $len($!space) <-> $len($!chr(32))


Which would return 6 <-> 8...

Yes but $chr(32) is just a lot easier than $space. As above you can make an alias

alias space { return $chr(32) }

Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Quote:
It should be //echo -s $len($!space) <-> $len($!chr(32))

Kelder and Riamus2's point was that the $space alias definition you suggest acually returns nothing, not even a space.
All that echo command of yours does is return how long the texts "$space" and "$chr(32)" are in characters.

If you actually tried your code before posting it you might actually find that it doesn't work.

Just to spell it out for the blindingly dense: "alias space { return $chr(32) }" does not return a space, it returns nothing, $null, nada.

Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
The $space identifier would work if it were added to the program code (as opposed to a custom identifier). Presumably, the $chr() identifier just uses the chr() (or equivalent) command from whatever language mIRC is written in. Something like this:

function chr (ascii as int) { return chr(ascii) }

The $space identifier would be the same. Like this:

function space { return chr(32) }

(Sorry if I'm stating the obvious. :P )

-genius_at_work

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
However, why would we need that? $chr(32) is easy to remember since it is used frequently. It's also known by all current scripters and new scripters learn it without a problem. It also leads new scripters into how to work with characters that cannot be used at certain times (like a comma in some commands). I don't see any need for such an identifier.

If you really want it for yourself, use this:
Code:
alias space {
  return  
}


That will return your space. It will also work for doing multiple spaces.


Invision Support
#Invision on irc.irchighway.net
Joined: Dec 2002
Posts: 83
D
Babel fish
Offline
Babel fish
D
Joined: Dec 2002
Posts: 83
for multiple spaces, you can use $chr(160) smile

Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
You could use that, but it's not a good solution.

$chr(160) is not a hard space on all fonts, on some fonts it represents another character. That means if you use that to output lines to a channel or something, people could see it for gibberish instead of spaces.


Gone.

Link Copied to Clipboard