Skip to main content

Locate and Highlight text in an entry field

  • March 21, 2011
  • 10 replies
  • 0 views

[Migrated content. Thread originally posted on 21 March 2011]

Hi fellow extend-ers,

Does anyone know how to highlight certain text in an entry field programmatically e.g. search for a specific word in a multiline text box and then highlight the text found and go to the line it is on ? Any sample programs out there.

Thanks in advance.

Julie

10 replies

  • Author
  • Rocketeer
  • 19312 replies
  • March 21, 2011

[Migrated content. Thread originally posted on 21 March 2011]

Hi fellow extend-ers,

Does anyone know how to highlight certain text in an entry field programmatically e.g. search for a specific word in a multiline text box and then highlight the text found and go to the line it is on ? Any sample programs out there.

Thanks in advance.

Julie
i don't know if it is possible.

But when SHIFT Left-key is possible with "W$KEYBUF" i would use it.
Search the End/Beginning for the Text you want to highlight, set the Position of your cursor and then use "W$KEYBUF" to simulate x (length of the word) times the or Button to highlight your text.


  • Author
  • Rocketeer
  • 19312 replies
  • March 24, 2011

[Migrated content. Thread originally posted on 21 March 2011]

Hi fellow extend-ers,

Does anyone know how to highlight certain text in an entry field programmatically e.g. search for a specific word in a multiline text box and then highlight the text found and go to the line it is on ? Any sample programs out there.

Thanks in advance.

Julie
Thank-you. I will give it a go and post back.

Cheers.

  • Author
  • Rocketeer
  • 19312 replies
  • March 24, 2011

[Migrated content. Thread originally posted on 21 March 2011]

Hi fellow extend-ers,

Does anyone know how to highlight certain text in an entry field programmatically e.g. search for a specific word in a multiline text box and then highlight the text found and go to the line it is on ? Any sample programs out there.

Thanks in advance.

Julie
Thank-you. I will give it a go and post back.

Cheers.

  • Author
  • Rocketeer
  • 19312 replies
  • April 14, 2011

[Migrated content. Thread originally posted on 21 March 2011]

Hi fellow extend-ers,

Does anyone know how to highlight certain text in an entry field programmatically e.g. search for a specific word in a multiline text box and then highlight the text found and go to the line it is on ? Any sample programs out there.

Thanks in advance.

Julie
i searched somthing other for entry fields and found in the documentation:


SELECTION-TEXT (alphanumeric)
This property replaces the text currently selected in the control with the value assigned to SELECTION-TEXT. If no text is currently selected, the value is inserted at the current cursor location. When inquired, this property returns the text currently selected, or spaces if nothing is selected. Note that you can determine the exact text that is selected by using the LENGTH option when inquiring on SELECTION-TEXT. The following example displays a message box with the currently selected text in quotes:

77 SEL-TEXT PIC X(100).
77 SEL-LEN PIC 9(3).

INQUIRE ENTRY-FIELD-1, SELECTION-TEXT IN SEL-TEXT,
LENGTH IN SEL-LEN
IF SEL-LEN = ZERO
DISPLAY MESSAGE BOX, "Nothing selected"
ELSE
DISPLAY MESSAGE BOX,
QUOTE, SEL-TEXT(1 : SEL-LEN), QUOTE
END-IF

If the selection spans multiple lines, any "soft" returns added internally by the control to manage word-wrapping are omitted from the returned value. Any "hard" returns (those inserted by the user via the or key) are represented by the two-character sequence h"0D" h"0A" (carriage-return, line-feed).

  • Author
  • Rocketeer
  • 19312 replies
  • July 12, 2011

[Migrated content. Thread originally posted on 21 March 2011]

Hi fellow extend-ers,

Does anyone know how to highlight certain text in an entry field programmatically e.g. search for a specific word in a multiline text box and then highlight the text found and go to the line it is on ? Any sample programs out there.

Thanks in advance.

Julie
Hi there,

I was on a big project so was side tracked a little but am back onto this. I have found that if I know the cursor-row and cursor-col I can position the cursor nicely. Now to highlight the word.

Using W$KEYBUF I suppose as suggested, how do you pass it the SHIFT Left arrow key?

A lot of the doco talks about ctrl etc.

Thanks in advance.

Kind Regards

  • Author
  • Rocketeer
  • 19312 replies
  • July 12, 2011

[Migrated content. Thread originally posted on 21 March 2011]

Hi fellow extend-ers,

Does anyone know how to highlight certain text in an entry field programmatically e.g. search for a specific word in a multiline text box and then highlight the text found and go to the line it is on ? Any sample programs out there.

Thanks in advance.

Julie
Hi there,

I was on a big project so was side tracked a little but am back onto this. I have found that if I know the cursor-row and cursor-col I can position the cursor nicely. Now to highlight the word.

Using W$KEYBUF I suppose as suggested, how do you pass it the SHIFT Left arrow key?

A lot of the doco talks about ctrl etc.

Thanks in advance.

Kind Regards

  • Author
  • Rocketeer
  • 19312 replies
  • July 12, 2011

[Migrated content. Thread originally posted on 21 March 2011]

Hi fellow extend-ers,

Does anyone know how to highlight certain text in an entry field programmatically e.g. search for a specific word in a multiline text box and then highlight the text found and go to the line it is on ? Any sample programs out there.

Thanks in advance.

Julie
Hi there,

I was on a big project so was side tracked a little but am back onto this. I have found that if I know the cursor-row and cursor-col I can position the cursor nicely. Now to highlight the word.

Using W$KEYBUF I suppose as suggested, how do you pass it the SHIFT Left arrow key?

A lot of the doco talks about ctrl etc.

Thanks in advance.

Kind Regards

  • Author
  • Rocketeer
  • 19312 replies
  • July 12, 2011

[Migrated content. Thread originally posted on 21 March 2011]

Hi fellow extend-ers,

Does anyone know how to highlight certain text in an entry field programmatically e.g. search for a specific word in a multiline text box and then highlight the text found and go to the line it is on ? Any sample programs out there.

Thanks in advance.

Julie
never tested it, what about to record the key you need and then load it x times?

Op-code "4" turns on the keystroke recording mechanism.


Op-code "9" causes a previously recorded file to be "played back." The keystrokes recorded in that file are treated as input from the user.

  • Author
  • Rocketeer
  • 19312 replies
  • July 14, 2011

[Migrated content. Thread originally posted on 21 March 2011]

Hi fellow extend-ers,

Does anyone know how to highlight certain text in an entry field programmatically e.g. search for a specific word in a multiline text box and then highlight the text found and go to the line it is on ? Any sample programs out there.

Thanks in advance.

Julie
Thanks. I tried recording it but the shift key did not register as a key just the right arrow {kr}.

I am thinking also that cursor-row and cursor-col to position the cursor will not work either.. testing this in a multi-line entry-file where the text to be found is not visible (e.g. on lines below those displayed).. the entry-field does not scroll. sigh! This seems way harder than it should.

  • Author
  • Rocketeer
  • 19312 replies
  • July 14, 2011

[Migrated content. Thread originally posted on 21 March 2011]

Hi fellow extend-ers,

Does anyone know how to highlight certain text in an entry field programmatically e.g. search for a specific word in a multiline text box and then highlight the text found and go to the line it is on ? Any sample programs out there.

Thanks in advance.

Julie
Thanks. I tried recording it but the shift key did not register as a key just the right arrow {kr}.

I am thinking also that cursor-row and cursor-col to position the cursor will not work either.. testing this in a multi-line entry-file where the text to be found is not visible (e.g. on lines below those displayed).. the entry-field does not scroll. sigh! This seems way harder than it should.