mIRC Homepage
Posted By: asdfasdf on text -> echo multiple spaces - 25/01/09 12:08 PM
Hi my dear mIRC friends, I need your help. frown



I've got an on text event and use haltdef to halt mIRC's default text because I'd like to echo it myself.


Both the halting and the echoing works well - almost:
When echoing $1-, multiple spaces aren't shown.

a[SPACE][SPACE][SPACE]b will turn into a[SPACE]b - but I want it to show all three spaces there.

So I looped through $mid($1-,%i,1) and apparently $1- doesn't even hold multiple spaces already.

If it did then I'd use a work-around with control characters to echo them but unfortunately it doesn't.


So yeah, wondering if anyone has messed with this before or got any hints or ideas or even a solution.


Thanks.
smile
Posted By: qwerty Re: on text -> echo multiple spaces - 25/01/09 12:30 PM
The following articles provide the most complete description of the problem as well as workarounds:

The spaces problem, part 1: the art of preserving spaces
The spaces problem, part 2: workarounds and their disadvantages
Posted By: asdfasdf Re: on text -> echo multiple spaces - 25/01/09 12:37 PM
Hey qwerty,

thanks a lot for that quick reply, going to check it out,
hope I will be able to solve my problem with that information, thank you.

smile
Posted By: asdfasdf Re: on text -> echo multiple spaces - 25/01/09 12:51 PM
Alright, awesome, done it via
$regsubex($gettok($rawmsg,2-,58),/(?<= )(?= )/g,$str($chr(2),2))
now, never knew about $rawmsg before, thanks again. <3

Edit: Also found the spaces.dll which I'm about to check out, awesome.
© mIRC Discussion Forums