Harbour All Functions – H

HardCR

HBClass()

HB_ANSITOOEM()

hb_At

hb_cdpSelect

HB_ColorIndex

HB_DiskSpace

HB_EOL

HB_FEof

hb_FLock

hb_FUnlock

hb_gcAll
hb_gcAlloc
hb_gcCollectAll
hb_gcFree
hb_gcItemRef

hb_GetEnv

hb_HAllocate

hb_Hash
hb_HAutoAdd
hb_HBinary
hb_HCaseMatch
hb_HClone
hb_HCopy
hb_HDefault
hb_HDel
hb_HDelAt
hb_HEval
hb_HFill
hb_HGet
hb_HGetDef
hb_HHasKey
hb_HKeyAt
hb_HKeys
hb_HMerge
hb_HPairAt
hb_HPos
hb_HScan
hb_HSet

hb_HSetAutoAdd()
hb_HSetBinary() 
hb_HSetCaseMatch()

hb_HSort
hb_HValueAt
hb_HValues

hb_idleAdd
hb_idleDel
hb_idleState

hb_inetAddress
hb_inetCleanup
hb_inetClearError
hb_inetClearPeriodCallback
hb_inetClearTimeLimit
hb_inetClearTimeout
hb_inetClose
hb_inetConnect
hb_inetConnectIP
hb_inetCount
hb_inetCreate
hb_inetCRLF
hb_inetDataReady
hb_inetDGram
hb_inetDGramBind
hb_inetDGramRecv
hb_inetDGramSend
hb_inetErrorCode
hb_inetErrorDesc
hb_inetFD
hb_inetGetAlias
hb_inetGetHosts
hb_inetGetRcvBufSize
hb_inetGetSndBufSize
hb_inetInit
hb_inetIsSocket
hb_inetPeriodCallback
hb_inetPort
hb_inetRecv
hb_inetRecvAll
hb_inetRecvEndblock
hb_inetRecvLine
hb_inetSend
hb_inetSendAll
hb_inetServer
hb_inetSetRcvBufSize
hb_inetSetSndBufSize
hb_inetstatus
hb_inetTimeLimit
hb_inetTimeout

HB_IsByRef()

hb_keyPut

hb_langErrMsg
hb_langMessage
hb_langName
hb_langSelect

hb_mathErBlock
hb_mathErMode
hb_mathGetErrMode
hb_mathGetHandler
hb_mathGetLastError
hb_mathIsMathErr
hb_mathResetError
hb_mathSetErrMode
hb_mathSetHandler

hb_MemoRead
hb_MemoWrit

hb_RAt

hb_PIsByRef

hb_PValue

hb_SetKeyCheck
hb_SetKeyGet
hb_SetKeySave

hb_setListenerAdd

hb_setListenerNotify
hb_setListenerRemove

hb_SetMacro

hb_Translate

hb_ValToStr

Header

HexaToDec

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


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()

At()

 

AT()

Locates the position of a substring in a main string.

Syntax

      AT( <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

AT() return the starting position of the first occurrence of the substring in the main string

Description

This function searches the string <cString> for the characters in the first string <cSearch>. If the substring is not contained within the second expression, the function will return 0. The third and fourth parameters lets you indicate a starting and end offset to search in.

Examples

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

Compliance

This function is sensitive to HB_CLP_STRICT settings during the compilation of src/rtl/at.c

<nStart> and <nEnd> are Harbour extensions and do not exist if HB_CLP_STRICT is defined. In that case, the whole string is searched.

Platforms

All

Files

Library is rtl

Seealso

RAT()