xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

PosRange()

Retrieves the position of the first character out of a range found in a string.

Syntax

PosRange( <cRangeStart> , ;
          <cRangeEnd>   , ;
          <cString>     , ;
         [<lNotInRange>], ;
         [<nSkipChars>]   ) --> nPos

Arguments

<cRangeStart> and <cRangeEnd>
These are two single characters marking the begin and end of the range of characters to be included in the search.
<cString>
This is the character string to search for the first charatcer out of a range of characters.
<lNotInRange>
This parameter defaults to .F. (false) so that the first character within the defined range of characters is searched. Passing .T. (true) instructs the function to search for the first character not within the range.
<nSkipChars>
This numeric parameter defaults to 0 so that the function begins searching with the first character of <cString>. Passing a value > 0 instructs the function to ignore the first <nSkipChars> characters in the search.

Return

Depending on <lNotInRange>, the function returns the position of the first character in <cString>, that is (not) within the defined range, as a numeric value.

Note:  the function is designed for easily finding non-printable characters in a character string. In this case Chr(0) and Chr(31) mark the start and end of the range of characters to search for.

Info

See also:PosAlpha(), PosLower(), PosUpper(), RangeRem(), RangeRepl()
Category: CT:String manipulation , Character functions
Source:ct\pos1.c
LIB:xhb.lib
DLL:xhbdll.dll


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