Harbour All Functions – R

RangeRem

RangeRepl

RAt

Rate

RD / RMDIR / DirRemove

ReadKey

ReadVar()

RecCount

RecNo
RecSize

RemAll

RemLeft
RemRight
ReplAll
Replicate

ReplLeft

ReplRight

RestToken
Right

RLock

Round

Row

RToD

RTrim

Advertisements

String Functions

AddASCII

AfterAtNum

AllTrim
Asc

ASCIISum

ASCPos
At

AtAdjust

AtNum
AtRepl
AtToken

BeforAtNum

Chr

CharAdd
CharAnd
CharEven
CharHist
CharList
CharMirr
CharMix
CharNoList
CharNot
CharOdd
CharOne
CharOnly
CharOr
CharPix
CharRela
CharRelRep
CharRem
CharRepl
CharRLL
CharRLR
CharSHL
CharSHR
CharSList
CharSort
CharSub
CharSwap
CharWin
CharXOR

CountLeft
CountRight
Descend
Empty
hb_At
hb_RAt
hb_ValToStr
IsAlpha
IsDigit
IsLower
IsUpper

JustLeft
JustRight

Left
Len
Lower
LTrim

NumAt
NumToken
PadLeft
PadRight

PadC
PadL
PadR

POSALPHA
POSCHAR
POSDEL
POSDIFF
POSEQUAL
POSINS
POSLOWER
POSRANGE
POSREPL
POSUPPER

RangeRem
RangeRepl

RAt

RemAll

RemLeft
RemRight
ReplAll

Replicate

ReplLeft

ReplRight

RestToken

Right
RTrim

SaveToken

SetAtLike
Space
Str

StrDiff

StrFormat

StrSwap

StrTran
StrZero
SubStr

TabExpand
TabPack

Token

TokenAt
TokenEnd
TokenExit
TokenInit
TokenLower
TokenNext
TokenNum
TokenSep
TokenUpper

Transform
Trim
Upper
Val

ValPos
WordOne
WordOnly
WordRem
WordRepl
WordSwap

WordToChar


SubStr()

SubStr()

Returns a substring from a main string

Syntax

      SubStr( <cString>,  <nStart>,  [<nLen>] ) --> cReturn

Arguments

<cString> Character expression to be parsed

<nStart> Start position

<nLen> Number of characters to return

Returns

<cReturn> Substring of evaluation

Description

This functions returns a character string formed from <cString>, starting at the position of <nStart> and continuing on for a length of <nLen> characters. If <nLen> is not specified, the value will be all remaining characters from the position of <nStart>.

The value of <nStart> may be negative. If it is, the direction of operation is reversed from a default of left-to-right to right-to-left for the number of characters specified in <nStart>. If the number of characters from <nStart> to the end of the string is less than <nLen> the rest are ignored.

Examples

      ? SubStr( "HELLO HARBOUR" ,   7,  4 )      // HARB
      ? SubStr( "HELLO HARBOUR" ,  -3,  3 )      // OUR
      ? SubStr( "HELLO HARBOUR" ,   7    )      // HARBOUR

Compliance

Clipper

Platforms

All(64K)

Files

Library is core

Seealso

Left(), At(), Right()

RAt()

RAT()

Searches for a substring from the right side of a string.

Syntax

      RAT( <cSearch>, <cString> ) --> nPos

Arguments

<cSearch> Substring to search for

<cString> Main string

Returns

RAT() return the location of beginning position.

Description

This function searches through <cString> for the first existence of <cSearch>. The search operation is performed from the right side of <cString> to the left. If the function is unable to find any occurrence of <cSearch> in <cString>, the return value is 0.

Examples

      ? 'RAt( "cde", "abcdefgfedcba" ) = ' +;
         RAt( "cde", "abcsefgfedcba" )

Compliance

Clipper

Platforms

All  (64K)

Files

Library is rtl

Seealso

AT(), SUBSTR(), RIGHT()

Left()

LEFT()

Extract the leftmost substring of a character expression

Syntax

      LEFT( <cString>, <nLen> ) --> cReturn

Arguments

<cString> Main character to be parsed

<nLen> Number of bytes to return beginning at the leftmost position

Returns

<cReturn> Substring of evaluation

Description

This functions returns the leftmost <nLen> characters of <cString>. It is equivalent to the following expression:

SUBSTR( <cString>, 1, <nLen> )

Examples

      ? LEFT( "HELLO HARBOUR", 5 )    // HELLO

Compliance

Clipper

Platforms

All

Files

Library is rtl

Seealso

SUBSTR(), RIGHT(), AT(), RAT()

hb_RAt()

hb_RAt()

Searches for last occurrence a substring of a string.

Syntax

      hb_RAt( <cSearch>,  <cString>,  [<nStart>],  [<nEnd>]  ) --> nPos

Arguments

<cSearch> Substring to search for

<cString> Main string

<nStart> First position to search in cString, by default 1.

<nEnd> End position to search, by default cString length

Returns

hb_RAt() return the location of beginning position of last occurrence a substring of a string.

Description

This function searches for last occurrence a <cSearch> in <cString>. If the function is unable to find any occurrence of <cSearch> in <cString>, the return value is 0. 3rd and 4th parameters define inclusive range for 2nd parameter on which operation is performed. If 3rd and 4th parameters is not specified, then hb_RAt() is equal to RAt().

Examples

      LOCAL cString
      LOCAL cSearch
      LOCAL i,  y,  r,  nLen

      ? 'hb_RAt( "cde",  "abcdefgfedcba" ) = ',  ;
         hb_RAt( "cde",  "abcdefgfedcba" ) // -> 3

      cString := "acdefcdeedcb"
      cSearch := "cde"
      nLen := Len( cString )
      FOR y := 1 TO nLen
         FOR i := 1 TO nLen
            r := hb_RAt( cSearch,  cString,  y,  i )
            IF r != 0
            ? 'hb_RAt( "' + cSearch + '",  "' + cString + '",  ' + hb_ntos( y ) + ',  ' + hb_ntos( i ) + ' ) = ' + ;
               hb_ntos( r )
            ENDIF
         NEXT
      NEXT

Compliance

Clipper

Platforms

All(64K)

Files

Library is core

Seealso

hb_At(), SubStr(), Right(), RAt()

SP_SL_SETLPI

SL_SETLPI()

  Short:
  ------
  SL_SETLPI() Sets the lines per inch for the laserjet

  Returns:
  --------
  cCode => control string to send to the printer

  Syntax:
  -------
  SL_SETLPI(nLPI)

  Description:
  ------------
  Sets the lines per inch for the laserjet to <nLpi>
  which  can be:

  1 - 1 line/inch
  2 - 2 line/inch
  3 - 3 line/inch
  4 - 4 line/inch
  6 - 6 line/inch
  8 - 8 line/inch
  12-12 line/inch
  16-16 line/inch
  24-24 line/inch
  48-48 line/inch

  Examples:
  ---------
   cCode := SL_SETLPI(6)     // sets LPI to 6 - the default

   ?cCode

  Notes:
  -------
  Does not send anything to the printer - instead
  returns a control string that you send to the printer. String can be
  sent with ? or ?? or  QOUT() or QQOUT().

  For HP and compatible(PCL) Laserjet printers.

  Source:
  -------
  S_HPLAS.PRG