mIRC Homepage
Posted By: DaveC $RETURN(xyz) or /RETURN(xyz) - 03/07/05 08:44 AM
I dont know how possable it is due to the way lines are processed,

but the idea is that rather than issuing a /RETURN xyz you can issue a $RETURN(xyz) or just /RETURN(xyz)
xyz is the return value of course,

Reason? Well i just realised that consecutive spaces in a returned value are swallowed up

example
Code:
alias example {
  var %returnvalue = $replace(a...e,.,$chr(32))
  echo -a Len of returnvalue pre return is $len(%returnvalue)
  return %returnvalue
}


//echo -a Len of returnvalue post return is $len($example)
Len of returnvalue pre return is 5
Len of returnvalue post return is 3
Posted By: Sat Re: $RETURN(xyz) or /RETURN(xyz) - 03/07/05 10:24 AM
I agree, I've run into this problem as well, and it would be great if there was a way around this behaviour of (especially) /return.

However, I'd much rather see some kind of command prefix that prevents double consecutive spaces from being stripped off, for any command.. That would solve this problem, and more.

I suggest the ^ character, e.g.
Code:
  ^return %returnvalue
because of the close relation to "halting default text", although I can already hardly wait for some people to post that they already use ^commands in their scripts. grin Anyway, it could also be a command on itself, instead of a prefix.

The idea is then that if this prefix is present, the parameters would still be tokenized, but all double consecutive spaces minus one (as well as all leading/trailing spaces) would be made part of the next parameter (or previous one, if there are no more) instead of being stripped off. This is clean, simple to use and backwards compatible, and it should be fairly easy to implement..

Additionally, I'd like $rawmsg to work for every event that uses $1- (especially "on INPUT"), instead of just for events triggered by text from IRC servers, but that's another story.
Posted By: qwerty Re: $RETURN(xyz) or /RETURN(xyz) - 04/07/05 10:49 AM
I like the prefix idea, since it could work for any command.
© mIRC Discussion Forums