working on a picwin script, I have an area I've designated to text. This needs to fit a certain Width and Height.

In order to achieve what you'd expect from a common non-picture window, you have to use $wrap(text,font,size,width,N) where N = 0 is total number of wraps to achieve fitting the string within those bounds. if N is non-zero, it returns the Nth segment of text that will fit within the specified width.

This does work perfect, however, there is no control code backlog, so something like "[k]4really long line" will return lines with N > 1 without prefixing it with whatever control codes remained activated during the previous break calculation.

This results in broken output, when trying to duplicate how /echo behaves.

this is an example ofwhat would happen ifthis is where lineswere broken.

Here is a very simplistic example to create a relatively small window and illustrate this.

Just enter whatever you want as a test into the editbox (ensuring it would force a wrap) include control codes, and notice that new wrap positions aren't given old control code states to keep the line going as expected.

If this isn't a bug, then it'd be a nice feature suggestion to add a .prop for this feature let's say $wrap().cc for instance

This is probably not a bug as it has worked this way for so long, I even found a suggestion for it.

I agree mIRC should provide a way to make this easier, but it can be scripted with the $controlat() identifier, which would also be very nice to see, maybe it could even suffice to work around this problem:

I tried out your $controlat identifier, It seems to be more complex than needed for this situation and leaves a bunch of global variables. It's also rather quite slow since it's re-calculating every time off of $1-.

I had already come up with a solution to this for a temporary fix (or permanent if this isn't deemed a bug, or $wrap().cc feature doesn't get added) which basically just backlogs the state of each control code within each return of $wrap() and sets them locally, and prepends each line with what control codes remained active.