Nifty re-calc selstart routine needed
problem is simple bit somewhat cumbersome to explain
. user has a textbox containing a string
. user serially selects portions of the the string and click 'set'
. portions selected are tucked into an array where their info is stored (selLentgh, selText, selStart and more)
problem: textbox vbCrLf's the string if it is long enough - and this is ok, I want multiline - but: I cant seem to find a dynamic algorithm to strip the original big string from vbCrLf, and then re-calc the selStart values for the portions selected. this must be done before I start operating on the string portions put in the array.
I've figured this much -
. find how many / if any vbCrLf are in the string BEFORE the portion selected's selStart-value. decrease selStart-value by NumberOfVBCRLF * 2 (since vbCrLf is two chars) to arrive at the new selStart value for the portion.
. check whether the selected portions contain vbCrLf, if so decrease selLength value with the same formula as above.
I just can't seem to write it in code! regards everybody /lumen