use-revolution digest, Vol 1 #478 - 9 msgs

Dave Calkins davecalk at
Tue Jun 18 00:45:00 EDT 2002

> I'd like to insert some html on both sides of the selected text in a
> field.
> "put "<b>" before the selectedchunk" works, but..
> put "</b>" after the selectedchunk still inserts it before. How do I get
> it after the selected text?
> The selectedChunk docs states something about the insertion point if no text
> is selected in a field. Being the start and end chars -1. My want to look
> into using the selectedtext

The selectedChunk will return not your text, but the character location of the text within your field.

ie. char 7 to 37 of field xxx



> put "<b>" & (the selectedtext of me) & "<b/>" into the selectedline

the only thing here that might be a problem with this is the selected text may or may not be a line. It could be part of a line, a line, or many lines.

This might be a little safer.

put "<b>" & (the selectedtext) & "<b/>" into the selection

Dave Calkins

More information about the Use-livecode mailing list