Page 1 of 1

hilighting text

Posted: Wed Oct 12, 2011 3:32 am
by marksmithhfx
Hi, does anyone know how to hilite (or hilight) an arbitrary portion of text in a field under script control? So, for example, if i want to hilite from char 5 to char 10 in field 1 what command could I use to do that? It is probably something very very obvious that I am overlooking so thanks for your suggestions.

-- Mark

Re: hilighting text

Posted: Wed Oct 12, 2011 4:03 am
by dglass
select character 5 to 10 of field 1

Re: hilighting text

Posted: Wed Oct 12, 2011 1:26 pm
by AndyP
Nearly... try

select character 5 to 10 of fld "field 1"
put the selectedtext into fld "field 2"

Re: hilighting text

Posted: Thu Oct 13, 2011 2:02 am
by marksmithhfx
Thanks guys... I was overthinking this one. I was looking everywhere for a "hilite" command and couldn't find it... so "select" is the ticket.

Thanks

-- Mark

Re: hilighting text

Posted: Thu Oct 13, 2011 6:00 am
by WaltBrown
Mark,
I've used backColor character by character to track multistage parsing of large texts for version changes, keywords, phrases, proper names, etc. It can get cumbersome, but I needed to track many separate iterative parsing processes and it was easier than setting up a database or XML trees, once I had the subroutines built.
Walt

Re: hilighting text

Posted: Sun Oct 16, 2011 11:52 pm
by marksmithhfx
HI Walt, something interesting I've noted (which is somewhat of a limitation in LC). When you highlight some text in a normal editing field and then do a right mouse click to popup a menu (this tested on a Mac), the highlighting disappears (and no attempt to get it back on my part has been successful). This does not conform to the way most applications function in such a situation. Normally the text remains highlighted while the popup has the focus.

Have you seen a way to circumvent this problem?

PS thanks for the advice re: highlighting keywords, phrases, proper names, etc. I'll keep the technique in mind (though it sounds painful :( )

Re: hilighting text

Posted: Mon Oct 17, 2011 12:56 am
by Dixie
Hi Mark...

I have attached a stack that will get you started with keeping the highlight of the text in conjunction with a popUp menu...

be well

Dixie

Re: hilighting text

Posted: Mon Oct 17, 2011 4:12 am
by marksmithhfx
Dixie wrote:Hi Mark...

I have attached a stack that will get you started with keeping the highlight of the text in conjunction with a popUp menu...

be well

Dixie
Oh how clever!! Now why didn't I think of that :) Dixie stikes again. Thanks for posting!

Re: hilighting text

Posted: Thu Oct 20, 2011 1:50 am
by WaltBrown
I'll try Dixie's stack, but what I saw was that if you set the backColor by character, word, or line, the result when you tested for the backColor of a word was inconsistent, almost as if characters, words, and lines had separate backColor settings. I don't have a clear enough understanding of the dynamics yet to offer a decent explanation.
Walt