mIRC Homepage
Posted By: ThaDoggFather Space wrapping?? - 16/06/04 08:30 PM
I am using Invincible script, and this is the problem:

I want to write something like this:

[21:54:19] @Nick : wadfhadf hdafhdf
[21:54:21] @Nick : Blabla blabla
[21:54:27] @Nick : Hehehehe hehehe

and I can't get something like this (up), instead i get:

[21:54:19] @Nick : wadfhadf hdafhdf
[21:54:21] @Nick : Blabla blabla
[21:54:27] @Nick : Hehehehe hehehe

The thing is that when I use more than two spaces between words, the script automatically makes that a one line between words. confused
Posted By: Cobra Re: Space wrapping?? - 16/06/04 09:52 PM
firstly, i see no difference between those 2 examles
pehraps this fourm has the same problem unless u use pre tags or
Code:
 and 


but thats not realy relevent

mIRC is a space dependent language .. this is one of the largest (at least from my own personal experence talking to users) complaints about the language itself

although mIRC is a very very nice language, even taking this one shortcomeing into acount .. there is no work around to this problem that i've been able to come up with yet myself.

so to the best of my knowledge u cant work with more than one adjacent space in a string within mIRC.

sorry,

Cobra^
Posted By: Danthemandoo Re: Space wrapping?? - 17/06/04 02:14 AM
$chr(160)

i know its probably not a great idea to use it, but it works perfectly as a space for me. You can have as many as you want.
Every $chr(160) counts as one space.
So:
blah $chr(160) blah
will give
blah(3 spaces)blah

if you just want 2 spaces, you can do
blah $+ $chr(160) blah

remember to turn OFF/uncheck SJIS/JIS conversion in IRC/Messages else it'll crash mIRC 6.15
Posted By: FiberOPtics Re: Space wrapping?? - 17/06/04 10:12 AM
Hi,

Note that $chr(160) might not be a space in some fonts, but I've never encountered it.

The following alias might be handy for you:
Code:
 
alias space return $str($chr(160),$iif($1,$1,1)) 

Usage: $space or $space(N)

Example: //echo -a This $space is a string $space(4) to check out the spaces.


The remarks from Danthemandoo still stand, so $space will actually be 3 spaces in total, which is an extra of 2. If you really only want only 1 extra space then like he said you have to use $+

Example: //echo -a This $+ $space shows just 1 extra space (total of 2)

Greets
© mIRC Discussion Forums