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

hb_Translate()

HB_TRANSLATE()

Translate a string from one code page to the other

Syntax

      HB_TRANSLATE( <cSrcText>, [<cPageFrom>], [<cPageTo>] ) --> cDstText

Arguments

<cSrcText> Is the source string to translate.

<cPageFrom> Is the optional character code page ID of the source string. If not specified, the default code page is used.

<cPageTo> Is the optional character code page ID of the destination string. If not specified, the default code page is used.

Returns

HB_TRANSLATE() return destination string converted from the source string.

Description

HB_TRANSLATE() try to convert a source string from one code page into the other. If a code page ID is not recognized, or not linked in, the default code page is used. HB_TRANSLATE() is used usually to convert between the Dos and the Windows code pages of the same language.

NOTE: If the source code page and target code page does not have the same number of characters, a translation can not be done and the destination string is a copy of the source string.

NOTE: You must REQUEST every code page module you intend to use. For example: to use the Russian RU866 code page you must add the following to your program: REQUEST HB_CODEPAGE_RU866

Examples

      REQUEST HB_CODEPAGE_DE
      REQUEST HB_CODEPAGE_DEWIN
      PROCEDURE Main()
         LOCAL cTxt := "A" + Chr( 142 ) + "BC"
         ? "German CP-850 text:", cTxt
         ? "German Windows-1252 text:", hb_Translate( cTxt, "DE", "DEWIN" )
         RETURN

Compliance

This function is a Harbour Extension.

Platforms

All

Files

Libraty are rtl, codepage

Seealso

HB_LANGSELECT(), HB_CDPSELECT(), NATIONMSG(), REQUEST

hb_cdpSelect()

HB_CDPSELECT()

Select the active code page by language ID

Syntax

      HB_CDPSELECT( [<cNewLang>] ) --> cOldLang

Arguments

<cNewLang> The optional ID of the country language module. Possible values for <cNewLang> are below as defined in the Codepage library, sorted by language.

      Language              Codepage       <cNewLang>
      --------------------- -------------- ----------------------
      Bulgarian             866            BG866
      Bulgarian             ISO-8859-5     BGISO
      Bulgarian             MIK            BGMIK
      Bulgarian             Windows-1251   BGWIN
      Croatian              437            HR437
      Croatian              852            HR852
      Croatian              Windows-1250   HR1250
      Czech                 852            CS852
      Czech                 ISO-8859-2     CSISO
      Czech                 KAM            CSKAM
      Czech                 Windoes-1250   CSWIN
      English               437            EN
      French                850            FR
      German                850            DE
      German                ISO-8859-1     DEWIN
      Greek                 737            EL
      Greek                 Windows-1253   ELWIN
      Hungarian (ntxhu852)  852            HU852
      Hungarian (sixhu852)  852            HU852S
      Hungarian (ntxhu852)  ISO-8859-2     HUISO
      Hungarian (sixhu852)  ISO-8859-2     HUISOS
      Hungarian (ntxhu852)  Windows-1250   HUWIN
      Hungarian (sixhu852)  Windows-1250   HUWINS
      Italian               437            IT437
      Italian               850            IT850
      Italian               ISO-8859-1b    ITISB
      Italian               ISO-8859-1     ITISO
      Lithuanian            Windows-1257   LT
      Polish                852            PL852
      Polish                ISO-8859-2     PLISO
      Polish                Mazowia        PLMAZ
      Polish                Windows-1250   PLWIN
      Portuguese            850            PT850
      Portuguese            ISO-8859-1     PTISO
      Russian               866            RU866
      Russian               KOI-8          RUKOI8
      Russian               Windows-1251   RU1251
      Serbian               Windows-1251   SRWIN
      Slovak                852            SK852
      Slovak                ISO-8859-2     SKISO
      Slovak                Kamenicky      SKKAM
      Slovak                Windows-1250   SKWIN
      Slovenian             437            SL437
      Slovenian             852            SL852
      Slovenian             ISO-8859-2     SLISO
      Slovenian             Windows-1250   SLWIN
      Spanish               850            ES
      Spanish               ISO-8859-1     ESWIN
      Spanish Modern        ISO-8859-1     ESMWIN
      Swedish               850            SV850
      Swedish (Clipper)     437            SVCLIP
      Swedish               ISO-8859-1     SVWIN
      Turkish               857            TR857
      Turkish               Windows-1254   TRWIN
      Ukrainian             866            UA866
      Ukrainian             KOI-8U         UAKOI8
      Ukrainian             Windows-1251   UA1251

Returns

<cOldLang> The old language indentifier

Description

HB_CDPSELECT() set the active code page use by Harbour for sorting and comparing strings. The default code page use ASCII order (cLang == “EN”).

NOTE: You must REQUEST every code page module you intend to use. For example: to use the Russian RU866 code page you must add the following to your program: REQUEST HB_CODEPAGE_RU866

Examples

      REQUEST HB_CODEPAGE_HU852
      PROCEDURE Main()
         LOCAL cTxt := Chr( 71 ) + " > " + Chr( 144 ) + " is"
         ? hb_cdpSelect()                 // EN
         ? cTxt, Chr( 71 ) > Chr( 144 )   // G > É is .F.
         ? hb_cdpSelect( "HU852" )        // EN
         ? cTxt, Chr( 71 ) > Chr( 144 )   // G > É is .T.
         ? hb_cdpSelect( "EN" )           // HU852
         ? cTxt, Chr( 71 ) > Chr( 144 )   // G > É is .F.
         RETURN

Compliance

This function is a Harbour Extension.

Platforms

All

Files

Libraty are rtl, codepage

Seealso

HB_LANGNAME(), HB_LANGSELECT(), HB_TRANSLATE(), NATIONMSG(), REQUEST