|
-
Oct 15th, 2002, 08:50 AM
#1
Thread Starter
Member
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
-
Oct 15th, 2002, 09:22 AM
#2
Frenzied Member
You can replace the string part you get with vbcrlf stripped out of them
try this in the emidiate pane
VB Code:
amy = "aa" & vbcrlf & " bb" 'press enter
?amy ' press enter
amy = replace (amy,vbcrlf," ") 'press enter
?amy'press enter
Code:
If Question = Incomplete Then
AnswerNextOne
Else
ReplyIfKnown
End If
cu Swatty
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|