Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Did I find a bug with Textboxes?
Message
From
13/08/2001 15:34:50
 
 
To
10/08/2001 19:43:12
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00542582
Message ID:
00543214
Views:
18
>It does, but only if you don't take into account invisible characters, such as CRLF. In my opinion, that alone is a bug.

Those need to be there. If you do a LEN('david' + chr(13) + chr(10) 'marlin') you'd want the CRLF in there too, what if you were doing a Stuff(), or Subsstr() and needed to know those 2 characters were there? Same with this.

>If in this case, you change the value of seltext, it doesn't work - it changes seltext plus some offset.

Try something like this:
* Add the passed tags to the value where the text is selected
* Notice how the line feeds are stripped out, they were causeing problems
lcNewString = tcTag + substr(strtran(.Value, chr(10)), .SelStart + 1, .SelLength) + tcCloseTag
.Value = STUFF(strtran(.Value, chr(10)), .SelStart + 1, .SelLength, lcNewString)
.SelLength = len(lcNewString)
I've written HTML editors in VFP before, and this is just a snippet of code from a button like you are describing.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform