Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Did I find a bug with Textboxes?
Message
De
13/08/2001 15:34:50
 
 
À
10/08/2001 19:43:12
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00542582
Message ID:
00543214
Vues:
14
>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform