mIRC Homepage
/bset -t &bvar -1 $chr(1245) $chr(1245) works
/bset &bvar -1 1245 1245 doesn't work..
/bset without the -t switch accepts byte number only. byte are 0-255 only, which I'm sure you know, so 1245 is not a valid byte number.
However, I checked and you probably should have been a bit clearer about it, executing /bset &bvar -1 1245 result in a binvar containing a single byte 221, which is a bug and I guess what you were reporting, this should be moved back to the bug report section.
The /bset command has never checked for valid byte range values. If you specify a value that is outside of the range 0-255, it rolls over. While I could change this now, ie. make it report an error and halt the script, it would break all existing scripts that expect this to work.
While it does roll over so that it stores the lowest 8 bits of the number, it's only doing that for the signed integer range. For 2^31 and above it stores 255, but scripts would be more likely to take advantage of this behavior if it worked at least up to the uint32 max:

//var %i 10 , %val $calc(2^31-5) | while (%i) { bset &v 1 %val | echo -a %val -> $bvar(&v,1) | dec %i | inc %val }

For the negative portion of the signed-int range, it does like it does for other non-numerics, and returns 45 from the hyphen's codepoint:

//bset &v 1 -2 | echo -a $bvar(&v,1-)
I personally don't mind the behavior, it's an extra, it doesn't prevent anyone from using /bset correctly.
© mIRC Discussion Forums