xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

ScreenMark()

Searches strings on the screen and changes their color.

Syntax

ScreenMark( <cSearch>, ;
            <xColor> , ;
            <lCase>  , ;
           [<lAll>]  , ;
           [<cPre>]  , ;
           [<cPost>]   ) --> lFound

Arguments

<cSearch>
This is a character string that is searched for on the screen.
<xColor>
This is either a single color value (see SetColor()), or its numeric color attribute (see ColorToN()). It defines the color for marking the search string.
<lCase>
A logical value must be passed. When <lCase> is .T. (true), the function performs a case sensitive search. With .F. (false), the search is case insensitive.
<lAll>
This parameter defaults to .F. (false) so that only the first occurance of <cSearch> is color marked. Passing .T. (true) marks all occurrances.
<cPre> and <cPost>
Optionally, delimiting characters for whole words can be specified. For example, the character sequence "is" appears two times in "This is". Using a prefix and postfix delimiter assures that only the word "is" is marked.

Return

The function returns .T. (true) when at lease one occurrance of the search string is color marked. Otherwise, .F. (false) is returned.

Note:  the function leaves the cursor position unchanged.

Info

See also:ClearEol(), ColorWin()
Category: CT:Video , Screen functions
Source:ct\scrmark.prg
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example displays a string and marks words in it

   PROCEDURE Main
      LOCAL cDelim := Chr( GetClearB() )
      CLS

      @ 10,10 SAY "This is the xHarbour compiler"

      ScreenMark( "is", "W+/R", .F., .T., cDelim, cDelim )

      ScreenMark( "xHarbour", "W+/B", .F. )
   RETURN

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe