mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Sep 2014
Posts: 1
megawac Offline OP
Mostly harmless
OP Offline
Mostly harmless
Joined: Sep 2014
Posts: 1
I've been trying to write a compliant as possible JS irc-style-parser and got a bug filed today (via IRC) about the string
Code:
^C0,190%...^C


How should that be be parsed? The user was expecting
Code:
fore=0 back=1 txt=90%...
, however my implementation was parsing it as
Code:
fore=0 back=19 txt=0%...
(though 19 is obv not a valid MIRC). However if the message was instead
Code:
^C0,120%...^C
what the hell then...

Last edited by megawac; 21/09/14 12:58 AM.
Joined: Dec 2002
Posts: 5,411
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,411
Your parser looks like it is working correctly in this case. The mIRC color parser extracts two digits for the fore color and two digits for the back color. If a user thinks their text message might begin with a number, they should specify two digit fore/back color values so that it is clear to the parser.


Link Copied to Clipboard