Harbour Reference Guide

Based on Harbour 3.2.0dev (r1410281506)

Documentation created with Giovanni Di Maria's hbd2htm.exe.

This document contains the functions of Harbour, taken from all .HBD files.


Index


    Category: API Application

  1. Do
  2. hb_PValue
  3. PCount
  4. ProcFile
  5. ProcLine
  6. ProcName

    Category: API Array

  7. AAdd
  8. AClone
  9. ACopy
  10. ADel
  11. AEval
  12. AFill
  13. AIns
  14. Array
  15. AScan
  16. ASize
  17. ASort
  18. ATail

    Category: API Classes

  19. HBClass

    Category: API Conversion

  20. Bin2I
  21. Bin2L
  22. Bin2U
  23. Bin2W
  24. Descend
  25. I2Bin
  26. L2Bin
  27. U2Bin
  28. W2Bin
  29. Word

    Category: API Database

  30. AFields*
  31. Alias
  32. Bof
  33. dbAppend
  34. dbClearFilter
  35. dbCloseAll
  36. dbCloseArea
  37. dbCommit
  38. dbCommitAll
  39. dbCreate
  40. dbDelete
  41. Dbf
  42. dbFilter
  43. dbGoBottom
  44. dbGoto
  45. dbGoTop
  46. dbRecall
  47. dbRLock
  48. dbRLockList
  49. dbRUnlock
  50. dbSeek
  51. dbSelectArea
  52. dbSetDriver
  53. dbSetFilter
  54. dbSkip
  55. dbStruct
  56. dbUnlock
  57. dbUnlockAll
  58. dbUseArea
  59. Deleted
  60. Eof
  61. FCount
  62. FieldGet
  63. FieldName
  64. FieldPos
  65. FieldPut
  66. FLock
  67. Found
  68. Header
  69. IndexExt
  70. IndexKey
  71. IndexOrd
  72. LastRec
  73. LUpdate
  74. NetErr
  75. ordBagExt
  76. ordBagName
  77. ordCondSet
  78. ordCreate
  79. ordDestroy
  80. ordFor
  81. ordKey
  82. RecCount
  83. RecNo
  84. RecSize
  85. RLock
  86. Select
  87. Used
  88. __dbCopyStruct
  89. __dbCopyXStruct
  90. __dbCreate
  91. __dbDelim
  92. __dbSDF
  93. __dbStructFilter
  94. __FLedit*

    Category: API Date/Time

  95. CDoW
  96. CMonth
  97. CToD
  98. Date
  99. Day
  100. Days
  101. DoW
  102. DToC
  103. DToS
  104. ElapTime
  105. Month
  106. Seconds
  107. Secs
  108. Time
  109. Year

    Category: API Environment

  110. GetE
  111. GetEnv
  112. hb_eol
  113. hb_GetEnv
  114. OS
  115. RUN
  116. Set
  117. SetMode
  118. SetTypeahead
  119. Tone
  120. Version
  121. __Run
  122. __SetCentury

    Category: API Error

  123. Break
  124. ErrorSys

    Category: API Events

  125. hb_SetKeyCheck
  126. hb_SetKeyGet
  127. hb_SetKeySave
  128. SetKey
  129. __Quit
  130. __SetFunction
  131. __Wait

    Category: API Execute and Execution

  132. dbEval
  133. Eval

    Category: API FileSys

  134. ADir
  135. CurDir
  136. DirChange
  137. DirRemove
  138. DiskSpace
  139. FClose
  140. FCreate
  141. FErase
  142. FError
  143. File
  144. FOpen
  145. FRead
  146. FReadStr
  147. FRename
  148. FSeek
  149. FWrite
  150. hb_DiskSpace
  151. hb_FEof
  152. hb_FLock
  153. hb_FUnlock
  154. IsDisk
  155. MakeDir
  156. __Dir*

    Category: API Garbage Collector

  157. hb_gcAll
  158. hb_gcAlloc
  159. hb_gcCollectAll
  160. hb_gcFree
  161. hb_gcItemRef

    Category: API Hash table

  162. hb_HAllocate
  163. hb_Hash
  164. hb_HAutoAdd
  165. hb_HBinary
  166. hb_HCaseMatch
  167. hb_HClone
  168. hb_HCopy
  169. hb_HDefault
  170. hb_HDel
  171. hb_HDelAt
  172. hb_HEval
  173. hb_HFill
  174. hb_HGet
  175. hb_HGetDef
  176. hb_HHasKey
  177. hb_HKeyAt
  178. hb_HKeys
  179. hb_HMerge
  180. hb_HPairAt
  181. hb_HPos
  182. hb_HScan
  183. hb_HSet
  184. hb_HSort
  185. hb_HValueAt
  186. hb_HValues

    Category: API Idle states

  187. hb_idleAdd
  188. hb_idleDel
  189. hb_idleState

    Category: API INET

  190. hb_inetAccept
  191. hb_inetAddress
  192. hb_inetCleanup
  193. hb_inetClearError
  194. hb_inetClearPeriodCallback
  195. hb_inetClearTimeLimit
  196. hb_inetClearTimeout
  197. hb_inetClose
  198. hb_inetConnect
  199. hb_inetConnectIP
  200. hb_inetCount
  201. hb_inetCreate
  202. hb_inetCRLF
  203. hb_inetDataReady
  204. hb_inetDGram
  205. hb_inetDGramBind
  206. hb_inetDGramRecv
  207. hb_inetDGramSend
  208. hb_inetErrorCode
  209. hb_inetErrorDesc
  210. hb_inetFD
  211. hb_inetGetAlias
  212. hb_inetGetHosts
  213. hb_inetGetRcvBufSize
  214. hb_inetGetSndBufSize
  215. hb_inetInit
  216. hb_inetIsSocket
  217. hb_inetPeriodCallback
  218. hb_inetPort
  219. hb_inetRecv
  220. hb_inetRecvAll
  221. hb_inetRecvEndblock
  222. hb_inetRecvLine
  223. hb_inetSend
  224. hb_inetSendAll
  225. hb_inetServer
  226. hb_inetSetRcvBufSize
  227. hb_inetSetSndBufSize
  228. hb_inetstatus
  229. hb_inetTimeLimit
  230. hb_inetTimeout

    Category: API Internal

  231. CLIPINIT
  232. __mvDbgInfo
  233. __SetHelpK
  234. __TextRestore
  235. __TextSave
  236. __XHelp

    Category: API Language and Nation

  237. hb_cdpSelect
  238. hb_langErrMsg
  239. hb_langMessage
  240. hb_langName
  241. hb_langSelect
  242. hb_Translate
  243. IsAffirm
  244. IsNegative
  245. Language and Nation MSG

    Category: API Macro

  246. hb_SetMacro

    Category: API Math

  247. Abs
  248. Exp
  249. hb_matherBlock
  250. hb_matherMode
  251. Int
  252. Log
  253. Max
  254. Min
  255. Mod
  256. Round
  257. Sqrt

    Category: API Objects

  258. __objAddData
  259. __objAddInline
  260. __objAddMethod
  261. __objDelData
  262. __objDelInline
  263. __objDelMethod
  264. __objDerivedFrom
  265. __objGetMethodList
  266. __objGetMsgList
  267. __objGetValueList
  268. __objHasData
  269. __objHasMethod
  270. __objModInline
  271. __objModMethod
  272. __objSetValueList

    Category: API RDD

  273. FieldBlock
  274. FieldWBlock

    Category: API Strings

  275. AllTrim
  276. Asc
  277. At
  278. Chr
  279. HardCR
  280. hb_At
  281. hb_MemoRead
  282. hb_MemoWrit
  283. hb_RAt
  284. hb_ValToStr
  285. IsAlpha
  286. IsDigit
  287. IsLower
  288. IsUpper
  289. Left
  290. Lower
  291. LTrim
  292. MemoRead
  293. MemoTran
  294. MemoWrit
  295. PadC
  296. PadL
  297. PadR
  298. RAt
  299. Replicate
  300. Right
  301. RTrim
  302. Space
  303. Str
  304. StrTran
  305. StrZero
  306. SubStr
  307. Transform
  308. Trim
  309. Upper
  310. Val

    Category: API Terminal

  311. Col
  312. DevOutPict
  313. hb_ColorIndex
  314. MaxCol
  315. MaxRow
  316. RESTORE SCREEN
  317. Row
  318. SAVE SCREEN
  319. __TypeFile

    Category: API User interface

  320. AChoice
  321. Alert
  322. Browse
  323. dbEdit*
  324. dbSkipper
  325. hb_keyPut
  326. Inkey
  327. LastKey
  328. MCol
  329. MENU TO
  330. MRow
  331. NextKey
  332. OutErr
  333. OutStd
  334. ReadKey*
  335. ReadVar
  336. TBrowseDB
  337. __AtPrompt
  338. __Input
  339. __Keyboard
  340. __MenuTo
  341. __NoNoAlert
  342. __XRestScreen
  343. __XSaveScreen

    Category: API Variable management

  344. Empty
  345. hb_PIsByRef
  346. Len
  347. MemVarBlock
  348. Type
  349. ValType
  350. __mvClear
  351. __mvExist
  352. __mvGet
  353. __mvPrivate
  354. __mvPublic
  355. __mvPut
  356. __mvRelease
  357. __mvScope
  358. __mvXRelease

    Category: Array

  359. ft_AAddition
  360. ft_AAvg
  361. ft_ADesSort
  362. ft_AEMaxLen
  363. ft_AEMinLen
  364. ft_AMedian
  365. ft_ANoMatches
  366. ft_ArEdit
  367. ft_ASum
  368. ft_RestArr
  369. ft_SaveArr

    Category: C level API Environment

  370. hb_setListenerAdd
  371. hb_setListenerNotify
  372. hb_setListenerRemove

    Category: C level API Idle states

  373. hb_idleState

    Category: C level API Math

  374. hb_mathGetErrMode
  375. hb_mathGetHandler
  376. hb_mathGetLastError
  377. hb_mathIsMathErr
  378. hb_mathResetError
  379. hb_mathSetErrMode
  380. hb_mathSetHandler

    Category: Class Data

  381. CLASS VAR
  382. VAR

    Category: Class Definition

  383. CLASS
  384. ENDCLASS

    Category: Class Method

  385. ERROR HANDLER
  386. MESSAGE
  387. METHOD
  388. ON ERROR

    Category: Command Database

  389. COPY STRUCTURE
  390. COPY STRUCTURE EXTENDED
  391. CREATE
  392. CREATE FROM
  393. PACK
  394. ZAP

    Category: Command Environment

  395. SET ALTERNATE
  396. SET BELL
  397. SET CENTURY
  398. SET CONSOLE
  399. SET DATE
  400. SET DECIMALS
  401. SET DEFAULT
  402. SET DEVICE
  403. SET EPOCH
  404. SET FIXED
  405. SET FUNCTION
  406. SET INTENSITY
  407. SET KEY
  408. SET MESSAGE
  409. SET PATH
  410. SET PRINTER
  411. SET WRAP

    Category: Command FileSys

  412. COPY FILE
  413. DELETE FILE
  414. DIR
  415. ERASE
  416. RENAME
  417. TYPE

    Category: Command Legacy

  418. LABEL FORM
  419. REPORT FORM

    Category: Command Printer

  420. EJECT

    Category: Command RDD

  421. FIELD

    Category: Command User interface

  422. @...GET
  423. @...PROMPT
  424. @...SAY
  425. KEYBOARD

    Category: Command Variable management

  426. LOCAL
  427. MEMVAR

    Category: Conversion

  428. ft_Byt2Bit
  429. ft_Byt2Hex
  430. ft_D2E
  431. ft_Dec2Bin
  432. ft_Descend
  433. ft_E2D
  434. ft_EscCode
  435. ft_Hex2Dec
  436. ft_InvClr
  437. ft_NToW
  438. ft_Sqzn
  439. ft_SToD
  440. ft_Unsqzn
  441. ft_XToY

    Category: Conversion Tools

  442. BinToDec
  443. DecToBin
  444. DecToHexa
  445. DecToOctal
  446. HexaToDec
  447. IsBin
  448. IsDec
  449. IsHexa
  450. IsOctal
  451. OctalToDec

    Category: CT video functions (Harbour ex

  452. ScreenText

    Category: CT3 date and time functions

  453. AddMonth
  454. BoM
  455. BoQ
  456. BoY
  457. CToDoW
  458. CToMonth
  459. DaysInMonth
  460. DaysToMonth
  461. DMY
  462. DoY
  463. EoM
  464. EoQ
  465. EoY
  466. IsLeap
  467. LastDayOM
  468. MDY
  469. NToCDoW
  470. NToCMonth
  471. Quarter
  472. Week

    Category: CT3 general functions

  473. CSetArgErr
  474. ctcexit
  475. ctcinit
  476. ctexit
  477. ctinit

    Category: CT3 math functions

  478. Acos
  479. Asin
  480. Atan
  481. Atn2
  482. Ceiling
  483. Cos
  484. Cosh
  485. Cot
  486. DToR
  487. Fact
  488. Floor
  489. FV
  490. GetPrec
  491. Log10
  492. Payment
  493. Periods
  494. Pi
  495. PV
  496. Rate
  497. RToD
  498. SetPREC
  499. Sign
  500. Sin
  501. Sinh
  502. Tan
  503. Tanh

    Category: CT3 miscellaneous functions

  504. XToC

    Category: CT3 number and bit manipulatio

  505. BitToC
  506. CToBit
  507. CToF
  508. CToN
  509. Exponent
  510. FToC
  511. Mantissa
  512. NToC

    Category: CT3 numeric functions

  513. Celsius
  514. Fahrenheit
  515. Infinity

    Category: CT3 printer functions

  516. PrintReady
  517. PrintStat

    Category: CT3 string functions

  518. AddAscii
  519. AfterAtNum
  520. AsciiSum
  521. AscPos
  522. AtAdjust
  523. AtNum
  524. AtRepl
  525. AtToken
  526. BeforAtNum
  527. CharAdd
  528. CharAnd
  529. CharEven
  530. CharHist
  531. CharList
  532. CharMirr
  533. CharMix
  534. CharNoList
  535. CharNot
  536. CharOdd
  537. CharOne
  538. CharOnly
  539. CharOr
  540. CharRelA
  541. CharRelRep
  542. CharRem
  543. CharRepl
  544. CharRll
  545. CharRlr
  546. CharShl
  547. CharShr
  548. CharSList
  549. CharSort
  550. CharSub
  551. CharSwap
  552. CharXor
  553. CountLeft
  554. CountRight
  555. CSetAtMupa
  556. CSetRef
  557. JustLeft
  558. NumAt
  559. NumToken
  560. PadLeft
  561. PadRight
  562. PosAlpha
  563. PosChar
  564. PosDel
  565. PosDiff
  566. PosEqual
  567. PosIns
  568. PosLower
  569. PosRange
  570. PosRepl
  571. PosUpper
  572. RangeRem
  573. RANGEREPL
  574. RemAll
  575. RemLeft
  576. RemRight
  577. ReplAll
  578. ReplLeft
  579. ReplRight
  580. RestToken
  581. SaveToken
  582. SetAtLike
  583. StrDiff
  584. StrSwap
  585. TabExpand
  586. TabPack
  587. Token
  588. TokenAt
  589. TokenEnd
  590. TokenExit
  591. TokenInit
  592. TokenLower
  593. TokenNext
  594. TokenNum
  595. TokenSep
  596. TokenUpper
  597. ValPos
  598. WordOne
  599. WordOnly
  600. WordRem
  601. WordRepl
  602. WordSwap
  603. WordToChar

    Category: CT3 switch and state functions

  604. KSetCaps
  605. KSetIns
  606. KSetNum
  607. KSetScroll

    Category: CT3 video functions

  608. CharWin
  609. ColorRepl
  610. ColorToN
  611. ColorWin
  612. Enhanced
  613. InvertAttr
  614. InvertWin
  615. SayScreen
  616. ScreenAttr
  617. ScreenMix
  618. Standard
  619. Unselected
  620. UnTextWin

    Category: Date

  621. ADays
  622. AMonths
  623. BoM
  624. BoY
  625. DaysInMonth
  626. DoY
  627. EoM
  628. EoY
  629. IsLeapYear
  630. WoY

    Category: Date/Time

  631. ft_AcctAdj
  632. ft_AcctMonth
  633. ft_AcctQtr
  634. ft_AcctWeek
  635. ft_AcctYear
  636. ft_AddWkDy
  637. ft_Calendar
  638. ft_Civ2Mil
  639. ft_DateCnfg
  640. ft_DayOfYr
  641. ft_DayToBoW
  642. ft_DoY
  643. ft_Easter
  644. ft_ElapMin
  645. ft_Elapsed
  646. ft_ElTime
  647. ft_FDay
  648. ft_LDay
  649. ft_MAdd
  650. ft_Mil2Civ
  651. ft_Mil2Min
  652. ft_Min2Dhm
  653. ft_Min2Mil
  654. ft_Month
  655. ft_Qtr
  656. ft_Sys2Mil
  657. ft_Week
  658. ft_Workdays
  659. ft_WoY
  660. ft_Year

    Category: Document

  661. 1st document to read
  662. Harbour Extensions
  663. The Garbage Collector
  664. The idle states

    Category: Document Compiler

  665. Compiler Options
  666. Macro compiler

    Category: Dos Tools

  667. CD
  668. MD
  669. RD

    Category: DOS/BIOS

  670. ft_ChDir
  671. ft_Default
  672. FT_DOSVER
  673. ft_DskFree
  674. ft_DskSize
  675. ft_FlopTst
  676. ft_IAmIdle
  677. ft_inp
  678. ft_int86
  679. ft_IsPrint
  680. ft_IsShare
  681. ft_MkDir
  682. ft_outp
  683. ft_Peek
  684. ft_Poke
  685. ft_Reboot
  686. ft_RmDir
  687. ft_SetDate
  688. ft_SetTime
  689. ft_SysMem
  690. ft_TempFil

    Category: Environment

  691. ft_GetE
  692. ft_Linked
  693. ft_Origin
  694. ft_RestSets
  695. ft_SaveSets
  696. ft_SetCentury

    Category: Event

  697. ft_Idle
  698. ft_OnTick

    Category: File I/O

  699. ft_DFClose
  700. ft_DFSetup
  701. ft_DispFile
  702. ft_FAppend
  703. ft_FBof
  704. ft_FDelete
  705. ft_FEof
  706. ft_FError
  707. ft_FGoBot
  708. ft_FGoto
  709. ft_FGoTop
  710. ft_FInsert
  711. ft_FLastRe
  712. ft_FReadLn
  713. ft_FRecNo
  714. ft_FSelect
  715. ft_FSkip
  716. ft_FUse
  717. ft_FWriteLn

    Category: Game

  718. ft_Pegs

    Category: General

  719. gt_ClrFlag
  720. gt_IsFlag
  721. gt_NewFlag
  722. gt_SetFlag

    Category: Harbour Tools

  723. TFileRead

    Category: Harbour Tools string functions

  724. JustRight

    Category: HBCT Date and Time Functions

  725. SetDate
  726. SetTime
  727. TimeValid
  728. WaitPeriod

    Category: HBCT video functions

  729. CharPix
  730. NToColor
  731. SetFont
  732. VGAPalette
  733. VideoType

    Category: Keyboard/Mouse

  734. ft_Alt
  735. ft_CapLock
  736. ft_Ctrl
  737. ft_LastKey
  738. ft_LastKey
  739. ft_MButPrs
  740. ft_MButRel
  741. ft_MCOnOff
  742. ft_MCursor
  743. ft_MDblClk
  744. ft_MDefCrs
  745. ft_MGetCoord
  746. ft_MGetPage
  747. ft_MGetPos
  748. ft_MGetSens
  749. ft_MGetX
  750. ft_MGetY
  751. ft_MHideCrs
  752. ft_MInit
  753. ft_MInRegion
  754. ft_MMickeys
  755. ft_MReset
  756. ft_MSetCoord
  757. ft_MSetPage
  758. ft_MSetPos
  759. ft_MSetSens
  760. ft_MShowCrs
  761. ft_MVersion
  762. ft_MXLimit
  763. ft_MYLimit
  764. ft_NumLock
  765. ft_PrtScr
  766. ft_PutKey
  767. ft_ScanCode
  768. ft_SetRate
  769. ft_Shift
  770. ft_SInkey

    Category: Math

  771. ft_GCD
  772. ft_NetPV
  773. ft_Rand1
  774. ft_Round

    Category: Menus/Prompts

  775. ft_Adder
  776. ft_Blink
  777. ft_BrwsWhl
  778. ft_ClrSel
  779. ft_DispMsg
  780. ft_Fill
  781. ft_Menu1
  782. ft_Menu2
  783. ft_MenuTo
  784. ft_Pending
  785. ft_PickDay
  786. ft_Prompt
  787. FT_SLEEP
  788. ft_XBox

    Category: NetWare

  789. ft_NWLStat
  790. ft_NWSemClose
  791. ft_NWSemEx
  792. ft_NWSemLock
  793. ft_NWSemOpen
  794. ft_NWSemSig
  795. ft_NWSemUnlock
  796. ft_NWSemWait
  797. ft_NWUID

    Category: Run time errors

  798. BASE/1003
  799. BASE/1068
  800. BASE/1068
  801. BASE/1068
  802. BASE/1069
  803. BASE/1072
  804. BASE/1073
  805. BASE/1074
  806. BASE/1075
  807. BASE/1076
  808. BASE/1076
  809. BASE/1076
  810. BASE/1077
  811. BASE/1078
  812. BASE/1078
  813. BASE/1079
  814. BASE/1081
  815. BASE/1082
  816. BASE/1085
  817. BASE/1089
  818. BASE/1090
  819. BASE/1092
  820. BASE/1093
  821. BASE/1094
  822. BASE/1095
  823. BASE/1096
  824. BASE/1097
  825. BASE/1098
  826. BASE/1099
  827. BASE/1100
  828. BASE/1101
  829. BASE/1102
  830. BASE/1103
  831. BASE/1104
  832. BASE/1105
  833. BASE/1106
  834. BASE/1107
  835. BASE/1108
  836. BASE/1110
  837. BASE/1110
  838. BASE/1112
  839. BASE/1113
  840. BASE/1114
  841. BASE/1115
  842. BASE/1116
  843. BASE/1117
  844. BASE/1120
  845. BASE/1122
  846. BASE/1124
  847. BASE/1126
  848. BASE/1132
  849. BASE/1133
  850. BASE/2010
  851. BASE/2012
  852. BASE/2017
  853. BASE/2020
  854. BASE/3001
  855. BASE/3002
  856. BASE/3003
  857. BASE/3004
  858. BASE/3005
  859. BASE/3007
  860. BASE/3008
  861. BASE/3009
  862. BASE/3010
  863. BASE/3011
  864. BASE/3012
  865. BASE/3101
  866. BASE/3102
  867. BASE/3103
  868. TERM/2013
  869. TOOLS/4001

    Category: String

  870. ft_At2
  871. ft_BitClr
  872. ft_BitSet
  873. ft_ByteAnd
  874. ft_ByteNeg
  875. ft_ByteNot
  876. ft_ByteOr
  877. ft_ByteXor
  878. ft_Color2N
  879. ft_FindITh
  880. ft_IsBit
  881. ft_IsBitOn
  882. ft_Metaph
  883. ft_N2Color
  884. ft_NoOccur
  885. ft_PChr
  886. ft_Proper
  887. ft_RAt2

    Category: String Tools

  888. gt_AsciiSum
  889. gt_AscPos
  890. gt_AtDiff
  891. gt_CharEven
  892. gt_CharMix
  893. gt_CharOdd
  894. gt_ChrCount
  895. gt_ChrFirst
  896. gt_ChrTotal
  897. gt_StrCount
  898. gt_StrCSPN
  899. gt_StrDiff
  900. gt_StrExpand
  901. gt_StrLeft
  902. gt_StrPBRK
  903. gt_StrRight
  904. StrFormat

    Category: TBrowse class

  905. TBrowseNew

    Category: Video

  906. ft_Adapter
  907. ft_CLS
  908. ft_GetMode
  909. ft_GetVCur
  910. ft_GetVPg
  911. ft_PopVid
  912. ft_PushVid
  913. ft_RestAtt
  914. ft_RevAttr
  915. ft_RevChr
  916. ft_RgnStack
  917. ft_RstRgn
  918. ft_SaveAtt
  919. ft_SavRgn
  920. ft_SetAttr
  921. ft_SetMode
  922. ft_SetVcur
  923. ft_SetVpg
  924. ft_Shadow
  925. ft_VidStr
  926. ft_WrtChr

    Category: Zip Functions

  927. hb_GetZipComment
  928. hb_SetBuffer
  929. hb_SetDiskZip
  930. hb_SetZipComment
  931. hb_UnzipFile
  932. hb_ZipDeleteFiles
  933. hb_ZipFile
  934. hb_ZipFileByPKSpan
  935. hb_ZipFileByTDSpan
  936. hb_ZipTestPK





Do

Lang:hvm.txt
Component:harbour
Doc. source:.\doc\en\hvm.txt
Template:Function
Category:API
Subcategory:Application
Oneliner:Calls a procedure or a function
Syntax:Do( <xFuncProc> [, <xArguments...>] ) --> <xRetVal>
Arguments:<xFuncProc> = Either a string with a function/procedure name to be called or a codeblock to evaluate. <xArguments> = arguments passed to a called function/procedure or to a codeblock.
Returns:<xRetVal> A value that was returned from called function.
Description:This function can be called either by the harbour compiler or by user. The compiler always passes the item of IT_SYMBOL type that stores the name of procedure specified in DO <proc> WITH ... statement. If called procedure/function doesn't exist then a runtime error is generated. This function can be used as replacement of macro operator. It is also used internally to implement DO <proc> WITH <args...> In this case <xFuncProc> is of type HB_SYMB.
Examples:cbCode := {| x | MyFunc( x ) } Do( cbCode, 1 ) cFunction := "MyFunc" xRetVal := Do( cFunction, 2 ) // Old style (slower): DO &cFunction WITH 3
Status:
Compliance:C
Files:Library is core
See also:
Back to index


hb_PValue

Lang:hvm.txt
Component:harbour
Doc. source:.\doc\en\hvm.txt
Template:Function
Category:API
Subcategory:Application
Oneliner:Retrieves the value of an argument.
Syntax:hb_PValue( <nArg> ) --> <xExp>
Arguments:A number that indicates the argument to check.
Returns:<xExp> Returns the value stored by an argument.
Description:This function is useful to check the value stored in an argument.
Examples:PROCEDURE Test( nValue, cString ) IF PCount() == 2 ? hb_PValue( 1 ), nValue ? hb_PValue( 2 ), cString ENDIF RETURN
Status:R
Compliance:H
Files:Library is core
See also:PCount()
Back to index


PCount

Lang:hvm.txt
Component:harbour
Doc. source:.\doc\en\hvm.txt
Template:Function
Category:API
Subcategory:Application
Oneliner:Retrieves the number of arguments passed to a function.
Syntax:PCount() --> <nArgs>
Arguments:None
Returns:<nArgs> A number that indicates the number of arguments passed to a function or procedure.
Description:This function is useful to check if a function or procedure has received the required number of arguments.
Examples:PROCEDURE Test( xExp ) IF PCount() == 0 ? "This function needs a parameter" ELSE ? xExp ENDIF RETURN
Status:R
Compliance:C
Files:Library is core
See also:hb_PValue()
Back to index


ProcFile

Lang:hvm.txt
Component:harbour
Doc. source:.\doc\en\hvm.txt
Template:Function
Category:API
Subcategory:Application
Oneliner:This function allways returns an empty string.
Syntax:ProcFile( <xExp> ) --> <cEmptyString>
Arguments:<xExp> is any valid type.
Returns:<cEmptyString> Return an empty string
Description:This function is added to the RTL for full compatibility. It always returns an empty string.
Examples:PROCEDURE Main() ? ProcFile() ? ProcFile( NIL ) ? ProcFile( 2 ) RETURN
Status:R
Compliance:C
Files:Library is core
See also:ProcName(), ProcLine()
Back to index


ProcLine

Lang:hvm.txt
Component:harbour
Doc. source:.\doc\en\hvm.txt
Template:Function
Category:API
Subcategory:Application
Oneliner:Gets the line number of the current function on the stack.
Syntax:ProcLine( <nLevel> ) --> <nLine>
Arguments:<nLevel> is the function level required.
Returns:<nLine> The line number of the function that it is being executed.
Description:This function looks at the top of the stack and gets the current line number of the executed function if no arguments are passed. Otherwise it returns the line number of the function or procedure at <nLevel>.
Examples:PROCEDURE Main() ? ProcLine( 0 ) ? ProcName( 2 ) RETURN
Status:R
Compliance:C
Files:Library is core
See also:ProcName(), ProcFile()
Back to index


ProcName

Lang:hvm.txt
Component:harbour
Doc. source:.\doc\en\hvm.txt
Template:Function
Category:API
Subcategory:Application
Oneliner:Gets the name of the current function on the stack
Syntax:ProcName( <nLevel> ) --> <cProcName>
Arguments:<nLevel> is the function level required.
Returns:<cProcName> The name of the function that it is being executed.
Description:This function looks at the top of the stack and gets the current executed function if no arguments are passed. Otherwise it returns the name of the function or procedure at <nLevel>.
Examples:// This test will show the functions and procedures in stack. // before executing it. PROCEDURE Main() LOCAL n := 1 DO WHILE ! Empty( ProcName( n ) ) ? ProcName( n++ ) ENDDO RETURN
Status:R
Compliance:C
Files:Library is core
See also:ProcLine(), ProcFile()
Back to index


AAdd

Lang:array.txt
Component:harbour
Doc. source:.\doc\en\array.txt
Template:Function
Category:API
Subcategory:Array
Oneliner:Dynamically add an element to an array
Syntax:AAdd( <aArray>[, <xValue>] ) --> Value
Arguments:<aArray> The name of an array <xValue> Element to add to array <aArray>
Returns:<Value> if specified <xValue>, <xValue> will return , otherwise this function returns a NIL value.
Description:This function dynamically increases the length of the array named <aArray> by one element and stores the value of <xValue> to that newly created element. <xValue> may be an array reference pointer, which in turn may be stored to an array's subscript position.
Examples:LOCAL aArray := {} LOCAL x AAdd( aArray, 10 ) FOR x := 1 TO 10 AAdd( aArray, x ) NEXT // Result is: { 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }
Status:R
Compliance:C
Files:Library is core
See also:AIns(), ASize()
Back to index


AClone

Lang:array.txt
Component:harbour
Doc. source:.\doc\en\array.txt
Template:Function
Category:API
Subcategory:Array
Oneliner:Duplicate a multidimensional array
Syntax:AClone( <aSource> ) --> aDuplicate
Arguments:<aSource> Name of the array to be cloned.
Returns:<aDuplicate> A new array pointer reference complete with nested array values.
Description:This function makes a complete copy of the array expressed as <aSource> and return a cloned set of array values. This provides a complete set of arrays values for all dimensions within the original array <aSource>
Examples:LOCAL aOne, aTwo aOne := { "Harbour", " is ", "POWER" } aTwo := AClone( aOne ) // Result: aTwo is { "Harbour", " is ", "POWER" } aOne[ 1 ] := "The Harbour Compiler" // Result: // aOne is { "The Harbour Compiler", " is ", "POWER" } // aTwo is { "Harbour", " is ", "POWER" }
Status:R
Compliance:CA-Cl*pper will return NIL if the parameter is not an array.
Files:Library is core
See also:ACopy(), ADel(), AIns(), ASize()
Back to index


ACopy

Lang:array.txt
Component:harbour
Doc. source:.\doc\en\array.txt
Template:Function
Category:API
Subcategory:Array
Oneliner:Copy elements from one array to another
Syntax:ACopy( <aSource>, <aTarget>, [<nStart>], [<nCount>], [<nTargetPos>] ) --> aTarget
Arguments:<aSource> is the array to copy elements from. <aTarget> is the array to copy elements to. <nStart> is the beginning subscript position to copy from <aSource> <nCount> the number of subscript elements to copy from <aSource>. <nTargetPos> the starting subscript position in <aTarget> to copy elements to.
Returns:<aTarget> an array pointer reference
Description:This function copies array elements from <aSource> to <aTarget>. <nStart> is the beginning element to be copied from <aSource>; the default is 1. <nCount> is the number of elements to be copied from <aSource>; the default is the entire array. <nTargetPos> is the subscript number in the target array, <aTarget>, to which array elements are to be copied; the default is 1 This function will copy all data types in <aSource> to <aTarget>. If an array element in <aSource> is a pointer reference to another array, that array pointer will be copied to <aTarget>; not all subdimensions will be copied from one array to the next. This must be accomplished via the AClone() function. Note: If array <aSource> is larger then <aTarget>, array elements will start copying at <nTargetPos> and continue copying until the end of array <aTarget> is reached. The ACopy() function doesn't append subscript positions to the target array, the size of the target array <aTarget> remains constant.
Examples:LOCAL nCount := 2, nStart := 1, aOne, aTwo aOne := { "Harbour", " is ", "Power" } aTwo := { "Clipper", " was ", "Power" } ACopy( aOne, aTwo, nStart, nCount )
Status:R
Compliance:C
Files:Library is core
See also:AClone(), ADel(), AEval(), AFill(), AIns(), ASort()
Back to index


ADel

Lang:array.txt
Component:harbour
Doc. source:.\doc\en\array.txt
Template:Function
Category:API
Subcategory:Array
Oneliner:Delete an element form an array.
Syntax:ADel( <aArray>, <nPos> ) --> aTarget
Arguments:<aArray> Name of array from which an element is to be removed. <nPos> Subscript of the element to be removed.
Returns:<aTarget> an array pointer reference.
Description:This function deletes the element found at <nPos> subscript position in the array <aArray>. All elements in the array <aArray> below the given subscript position <nPos> will move up one position in the array. In other words, what was formerly the sixth subscript position will become the fifth subscript position. The length of the array <aArray> will remain unchanged, as the last element in the array will become a NIL data type.
Examples:LOCAL aArray := { "Harbour", "is", "Power" } ADel( aArray, 2 ) // Result: aArray is { "Harbour", "Power" }
Status:R
Compliance:C
Files:Library is core
See also:ACopy(), AIns(), AFill()
Back to index


AEval

Lang:array.txt
Component:harbour
Doc. source:.\doc\en\array.txt
Template:Function
Category:API
Subcategory:Array
Oneliner:Evaluates the subscript element of an array
Syntax:AEval( <aArray>, <bBlock>, [<nStart>], [<nCount>] ) --> aArray
Arguments:<aArray> Is the array to be evaluated. <bBlock> Is a code block to evaluate for each element processed. <nStart> The beginning array element index to evaluate. <nCount> The number of elements to process.
Returns:<aArray> an array pointer reference.
Description:This function will evaluate and process the subscript elements in <aArray>. A code block passed as <bBlock> defines the operation to be executed on each element of the array. All elements in <aArray> will be evaluated unless specified by a beginning subscript position in <nStart> for <nCount> elements. Two parameters are passed to the code block <bBlock>. The individual elements in an array are the first parameter and the subscript position is the second. AEval() does not replace a FOR...NEXT loop for processing arrays. If an array is an autonomous unit, AEval() is appropriate. If the array is to be altered or if elements are to be reevaluated, a FOR...NEXT loop is more appropriate.
Examples:
Status:R
Compliance:C
Files:Library is core
See also:Eval(), dbEval()
Back to index


AFill

Lang:array.txt
Component:harbour
Doc. source:.\doc\en\array.txt
Template:Function
Category:API
Subcategory:Array
Oneliner:Fill an array with a specified value
Syntax:AFill( <aArray>, <xValue>, [<nStart>], [<nCount>] ) --> aTarget
Arguments:<aArray> Name of array to be filled. <xValue> Expression to be globally filled in <aArray> <nStart> Subscript starting position <nCount> Number of subscript to be filled
Returns:<aTarget> an array pointer.
Description:This function will fill each element of an array named <aArray> with the value <xValue>. If specified, <nStart> denotes the beginning element to be filled and the array elements will continue to be filled for <nCount> positions. If Not specified, the value of <nStart> will be 1, and the value of <nCount> will be the value of Len( <aArray> ); thus, all subscript positions in the array <aArray> will be filled with the value of <xValue>. This function will work on only a single dimension of <aArray>. If there are array pointer references within a subscript <aArray>, those values will be lost, since this function will overwrite those values with new values.
Examples:LOCAL aTest := { NIL, 0, 1, 2 } AFill( aTest, 5 )
Status:R
Compliance:C
Files:Library is core
See also:AAdd(), AEval(), dbStruct(), Directory()
Back to index


AIns

Lang:array.txt
Component:harbour
Doc. source:.\doc\en\array.txt
Template:Function
Category:API
Subcategory:Array
Oneliner:Insert a NIL value at an array subscript position.
Syntax:AIns( <aArray>, <nPos> ) --> aTarget
Arguments:<aArray> Array name. <nPos> Subscript position in <aArray>
Returns:<aTarget> an array pointer reference.
Description:This function inserts a NIL value in the array named <aArray> at the <nPos>th position. All array elements starting with the <nPos>th position will be shifted down one subscript position in the array list and the last item in the array will be removed completely. In other words, if an array element were to be inserted at the fifth subscript position, the element previously in the fifth position would now be located at the sixth position. The length of the array <aArray> will remain unchanged.
Examples:LOCAL aArray := { "Harbour", "is", "Power!", "!!!" } AIns( aArray, 4 )
Status:R
Compliance:C
Files:Library is core
See also:AAdd(), ACopy(), ADel(), AEval(), AFill(), ASize()
Back to index


Array

Lang:array.txt
Component:harbour
Doc. source:.\doc\en\array.txt
Template:Function
Category:API
Subcategory:Array
Oneliner:Create an uninitialized array of specified length
Syntax:Array( <nElements> [, <nElements>...] ) --> aArray
Arguments:<nElements> is the number of elements in the specified dimension.
Returns:<aArray> an array of specified dimensions.
Description:This function returns an uninitialized array with the length of <nElements>. Nested arrays are uninitialized within the same array pointer reference if additional parameters are specified. Establishing a memory variable with the same name as the array may destroy the original array and release the entire contents of the array. This depends, of course, on the data storage type of either the array or the variable with the same name as the array.
Examples:PROCEDURE Main() LOCAL aArray := Array( 10 ) LOCAL x FOR x := 1 TO Len( aArray ) aArray[ x ] := Array( x ) NEXT // Result is: { { NIL }, { NIL, NIL }, ... } RETURN
Status:R
Compliance:C(array)
Files:Library is core
See also:AAdd(), ADel(), AFill(), AIns()
Back to index


AScan

Lang:array.txt
Component:harbour
Doc. source:.\doc\en\array.txt
Template:Function
Category:API
Subcategory:Array
Oneliner:Scan array elements for a specified condition
Syntax:AScan( <aTarget>, <xSearch>, [<nStart>], [<nCount>] ) --> nStoppedAt
Arguments:<aTarget> Array to be scanned. <xSearch> Expression to search for in <aTarget> <nStart> Beginning subscript position at which to start the search. <nCount> Number of elements to scan with <aTarget>.
Returns:<nStoppedAt> A numeric value of subscript position where <xSearch> was found, or 0 if <xSearch> is not found.
Description:This function scan the content of array named <aTarget> for the value of <xSearch>. The return value is the position in the array <aTarget> in which <xSearch> was found. If it was not found, the return value will be 0. If specified, the beginning subscript position at which to start scanning may be set with the value passed as <nStart>. The default is 1. If specified, the number of array elements to scan may be set with the value passed as <nCount>. The default is the number of elements in the array <aTarget>. If <xSearch> is a code block, the operation of the function is slightly different. Each array subscript pointer reference is passed to the code block to be evaluated. The scanning routine will continue until the value obtained from the code block is a logical true (.T.) or until the end of the array has been reached.
Examples:LOCAL aDir := Directory( "*.prg" ) AScan( aDir,,, {| x, y | x[ 1 ] := "test.prg" } )
Status:R
Compliance:This function is not CA-Cl*pper compatible. CA-Cl*pper AScan() is affected by the SET EXACT ON/OFF Condition
Files:Library is core
See also:AEval()
Back to index


ASize

Lang:array.txt
Component:harbour
Doc. source:.\doc\en\array.txt
Template:Function
Category:API
Subcategory:Array
Oneliner:Adjust the size of an array
Syntax:ASize( <aArray>, <nLen> ) --> aTarget
Arguments:<aArray> Name of array to be dynamically altered <nLen> Numeric value representing the new size of <aArray>
Returns:<aTarget> an array pointer reference to <aTarget>.
Description:This function will dynamically increase or decrease the size of <aArray> by adjusting the length of the array to <nLen> subscript positions. If the length of the array <aArray> is shortened, those former subscript positions are lost. If the length of the array is lengthened a NIL value is assigned to the new subscript position.
Examples:LOCAL aArray := { 1 } // Result: aArray is { 1 } ASize( aArray, 3 ) // Result: aArray is { 1, NIL, NIL } ASize( aArray, 1 ) // Result: aArray is { 1 }
Status:R
Compliance:If HB_COMPAT_C53 is defined, the function generates an Error, else it will return the array itself.
Files:Library is core
See also:AAdd(), ADel(), AFill(), AIns()
Back to index


ASort

Lang:array.txt
Component:harbour
Doc. source:.\doc\en\array.txt
Template:Function
Category:API
Subcategory:Array
Oneliner:Sort an array
Syntax:ASort( <aArray>, [<nStart>], [<nCount>], [<bSort>] ) --> aArray
Arguments:<aArray> Array to be sorted. <nStart> The first element to start the sort from, default is 1. <nCount> Number of elements starting from <nStart> to sort, default is all elements. <bSort> Code block for sorting order, default is ascending order {| x, y | x < y }. The code block should accept two parameters and must return .T. if the sort is in order, .F. if not.
Returns:<aArray> reference to the now sorted <aArray> or NIL if the passed <aArray> is not an array.
Description:ASort() sort all or part of a given array. If <bSort> is omitted, the function expect <aArray> to be one dimensional array containing single data type (one of: Character, Date, Logical, Numeric) and sort this array in ascending order: Character are sorted by their ASCII value, Dates are sorted chronologically, Logical put .F. values before .T., Numeric are sorted by their value. If <bSort> is specified, it is used to handle the sorting order. With each time the block is evaluate, two array elements are passed to the code block, and <bSort> must return a logical value that state if those elements are in order (.T.) or not (.F.). Using this block you can sort multidimensional array, descending orders or even (but why would you want to do that) sort array that contain different data type.
Examples:// sort numeric values in ascending order ASort( { 3, 1, 4, 42, 5, 9 } ) // result: { 1, 3, 4, 5, 9, 42 } // sort character strings in descending lexical order aKeys := { "Ctrl", "Alt", "Delete" } bSort := {| x, y | Upper( x ) > Upper( y ) } ASort( aKeys,,, bSort ) // result: { "Delete", "Ctrl", "Alt" } // sort two-dimensional array according to 2nd element of each pair aPair := { { "Sun", 8 }, { "Mon", 1 }, { "Tue", 57 }, { "Wed", -6 } } ASort( aPair,,, {| x, y | x[ 2 ] < y[ 2 ] } ) // result: { { "Wed", -6 }, { "Mon", 1 }, { "Sun", 8 }, { "Tue", 57 } }
Status:R
Compliance:C(arrayblock)
Files:Library is core
See also:AScan(), Eval(), SORT
Back to index


ATail

Lang:array.txt
Component:harbour
Doc. source:.\doc\en\array.txt
Template:Function
Category:API
Subcategory:Array
Oneliner:Returns the rightmost element of an array
Syntax:ATail( <aArray> ) --> Element
Arguments:<aArray> is the array.
Returns:<Element> the expression of the last element in the array.
Description:This function return the value of the last element in the array named <aArray>. This function does not alter the size of the array or any of the subscript values.
Examples:LOCAL aArray := { "Harbour", "is", "Supreme", "Power" } ? ATail( aArray ) // Result is "Power"
Status:R
Compliance:C
Files:Library is core
See also:Len(), Array(), ASize(), AAdd()
Back to index


HBClass

Lang:tclass.txt
Component:harbour
Doc. source:.\doc\en\tclass.txt
Template:Function
Category:API
Subcategory:Classes
Oneliner:HBClass() is used in the creation of all classes
Syntax:oClass := HBClass():New( "TMyClass" ) -or- HBClass() is usually accessed by defining a class with the commands defined in hbclass.ch: CREATE CLASS HBGetList // Calls HBClass() to create the HBGetList class ... ENDCLASS
Arguments:
Returns:An instance of the HBClass Class. This special object's :New() method can then create the classes you define.
Description:HBClass is a class that ... The class methods are as follows: New() Create a new instance of the class
Examples:FUNCTION TestObject() LOCAL oObject oObject := HBClass():New( "TMyClass" ) oObject:End() RETURN NIL
Status:R
Compliance:Object Oriented syntax in Harbour is compatible with CA-Cl*pper. However CA-Cl*pper only allowed creation of objects from a few standard classes, and did not let the programmer create new classes. In Harbour, you can create your own classes--complete with Methods, Instance Variables, Class Variables and Inheritance. Entire applications can be designed and coded in Object Oriented style.
Files:Library is core
See also:__objHasData(), Object Oriented Programming, CLASS
Back to index


Bin2I

Lang:binnum.txt
Component:harbour
Doc. source:.\doc\en\binnum.txt
Template:Function
Category:API
Subcategory:Conversion
Oneliner:Convert signed short encoded bytes into Harbour numeric
Syntax:Bin2I( <cBuffer> ) --> nNumber
Arguments:<cBuffer> is a character string that contain 16 bit encoded signed short integer (least significant byte first). The first two bytes are taken into account, the rest if any are ignored.
Returns:Bin2I() return numeric integer (or 0 if <cBuffer> is not a string).
Description:Bin2I() is one of the low level binary conversion functions, those functions convert between Harbour numeric and a character representation of numeric value. Bin2I() take two bytes of encoded 16 bit signed short integer and convert it into standard Harbour numeric value. You might ask what is the need for such functions, well, first of all it allow you to read/write information from/to a binary file (like extracting information from DBF header), it is also a useful way to share information from source other than Harbour (C for instance). Bin2I() is the opposite of I2Bin()
Examples:// Show DBF last update date #include "fileio.ch" PROCEDURE Main() LOCAL nHandle, cYear, cMonth, cDay nHandle := FOpen( "test.dbf" ) IF nHandle != F_ERROR FSeek( nHandle, 1 ) cYear := cMonth := cDay := " " FRead( nHandle, @cYear , hb_BLen( cYear ) ) FRead( nHandle, @cMonth, hb_BLen( cMonth ) ) FRead( nHandle, @cDay , hb_BLen( cDay ) ) ? "Last update:", Bin2I( cYear ), Bin2I( cMonth ), Bin2I( cDay ) FClose( nHandle ) ELSE ? "Can not open file" ENDIF RETURN
Status:R
Compliance:C
Files:Library is core
See also:Bin2L(), Bin2U(), Bin2W(), I2Bin(), L2Bin(), W2Bin(), Word(), U2Bin(), FRead()
Back to index


Bin2L

Lang:binnum.txt
Component:harbour
Doc. source:.\doc\en\binnum.txt
Template:Function
Category:API
Subcategory:Conversion
Oneliner:Convert signed long encoded bytes into Harbour numeric
Syntax:Bin2L( <cBuffer> ) --> nNumber
Arguments:<cBuffer> is a character string that contain 32 bit encoded signed long integer (least significant byte first). The first four bytes are taken into account, the rest if any are ignored.
Returns:Bin2L() return numeric integer (or 0 if <cBuffer> is not a string).
Description:Bin2L() is one of the low level binary conversion functions, those functions convert between Harbour numeric and a character representation of numeric value. Bin2L() take four bytes of encoded 32 bit signed long integer and convert it into standard Harbour numeric value. You might ask what is the need for such functions, well, first of all it allow you to read/write information from/to a binary file (like extracting information from DBF header), it is also a useful way to share information from source other than Harbour (C for instance). Bin2L() is the opposite of L2Bin()
Examples:// Show number of records in DBF #include "fileio.ch" PROCEDURE Main() LOCAL nHandle, cBuffer := Space( 4 ) nHandle := FOpen( "test.dbf" ) IF nHandle != F_ERROR FSeek( nHandle, 4 ) FRead( nHandle, @cBuffer, hb_BLen( cBuffer ) ) ? "Number of records in file:", Bin2L( cBuffer ) FClose( nHandle ) ELSE ? "Can not open file" ENDIF RETURN
Status:R
Compliance:C
Files:Library is core
See also:Bin2I(), Bin2U(), Bin2W(), I2Bin(), L2Bin(), W2Bin(), Word(), U2Bin(), FRead()
Back to index


Bin2U

Lang:binnum.txt
Component:harbour
Doc. source:.\doc\en\binnum.txt
Template:Function
Category:API
Subcategory:Conversion
Oneliner:Convert unsigned long encoded bytes into Harbour numeric
Syntax:Bin2U( <cBuffer> ) --> nNumber
Arguments:<cBuffer> is a character string that contain 32 bit encoded unsigned long integer (least significant byte first). The first four bytes are taken into account, the rest if any are ignored.
Returns:Bin2U() return numeric integer (or 0 if <cBuffer> is not a string).
Description:Bin2U() is one of the low level binary conversion functions, those functions convert between Harbour numeric and a character representation of numeric value. Bin2U() take four bytes of encoded 32 bit unsigned long integer and convert it into standard Harbour numeric value. You might ask what is the need for such functions, well, first of all it allow you to read/write information from/to a binary file (like extracting information from DBF header), it is also a useful way to share information from source other than Harbour (C for instance). Bin2U() is the opposite of U2Bin()
Examples:// Show number of records in DBF #include "fileio.ch" PROCEDURE Main() LOCAL nHandle, cBuffer := Space( 4 ) nHandle := FOpen( "test.dbf" ) IF nHandle != F_ERROR FSeek( nHandle, 4 ) FRead( nHandle, @cBuffer, hb_BLen( cBuffer ) ) ? "Number of records in file:", Bin2U( cBuffer ) FClose( nHandle ) ELSE ? "Can not open file" ENDIF RETURN
Status:R
Compliance:XPP
Files:Library is core
See also:Bin2I(), Bin2L(), Bin2W(), I2Bin(), L2Bin(), W2Bin(), Word(), U2Bin(), FRead()
Back to index


Bin2W

Lang:binnum.txt
Component:harbour
Doc. source:.\doc\en\binnum.txt
Template:Function
Category:API
Subcategory:Conversion
Oneliner:Convert unsigned short encoded bytes into Harbour numeric
Syntax:Bin2W( <cBuffer> ) --> nNumber
Arguments:<cBuffer> is a character string that contain 16 bit encoded unsigned short integer (least significant byte first). The first two bytes are taken into account, the rest if any are ignored.
Returns:Bin2W() return numeric integer (or 0 if <cBuffer> is not a string).
Description:Bin2W() is one of the low level binary conversion functions, those functions convert between Harbour numeric and a character representation of numeric value. Bin2W() take two bytes of encoded 16 bit unsigned short integer and convert it into standard Harbour numeric value. You might ask what is the need for such functions, well, first of all it allow you to read/write information from/to a binary file (like extracting information from DBF header), it is also a useful way to share information from source other than Harbour (C for instance). Bin2W() is the opposite of W2Bin()
Examples:// Show header length of a DBF #include "fileio.ch" PROCEDURE Main() LOCAL nHandle, cBuffer := Space( 2 ) nHandle := FOpen( "test.dbf" ) IF nHandle != F_ERROR FSeek( nHandle, 8 ) FRead( nHandle, @cBuffer, hb_BLen( cBuffer ) ) ? "Length of DBF header in bytes:", Bin2W( cBuffer ) FClose( nHandle ) ELSE ? "Can not open file" ENDIF RETURN
Status:R
Compliance:C
Files:Library is core
See also:Bin2I(), Bin2L(), Bin2U(), I2Bin(), L2Bin(), W2Bin(), Word(), U2Bin(), FRead()
Back to index


Descend

Lang:string.txt
Component:harbour
Doc. source:.\doc\en\string.txt
Template:Function
Category:API
Subcategory:Conversion
Oneliner:Inverts an expression of string, logical, date or numeric type.
Syntax:Descend( <xExp> ) --> xExpInverted
Arguments:<xExp> is any valid expression.
Returns:Inverted value of the same type as passed.
Description:This function converts an expression in his inverted form. It is useful to build descending indexes.
Examples:// Seek for Smith in a descending index dbSeek( Descend( "SMITH" ) )
Status:R
Compliance:C
Files:Library is core
See also:INDEX, SEEK
Back to index


I2Bin

Lang:binnum.txt
Component:harbour
Doc. source:.\doc\en\binnum.txt
Template:Function
Category:API
Subcategory:Conversion
Oneliner:Convert Harbour numeric into signed short encoded bytes
Syntax:I2Bin( <nNumber> ) --> cBuffer
Arguments:<nNumber> is a numeric value to convert (decimal digits are ignored).
Returns:I2Bin() return two bytes character string that contain 16 bit encoded signed short integer (least significant byte first).
Description:I2Bin() is one of the low level binary conversion functions, those functions convert between Harbour numeric and a character representation of numeric value. I2Bin() take a numeric integer value and convert it into two bytes of encoded 16 bit signed short integer. You might ask what is the need for such functions, well, first of all it allow you to read/write information from/to a binary file (like extracting information from DBF header), it is also a useful way to share information from source other than Harbour (C for instance). I2Bin() is the opposite of Bin2I()
Examples:// Update DBF "last update" date #include "fileio.ch" PROCEDURE Main() LOCAL nHandle, cYear, cMonth, cDay USE test ? "Original update date is:", LUpdate() CLOSE nHandle := FOpen( "test.dbf", FO_READWRITE ) IF nHandle != F_ERROR FSeek( nHandle, 1 ) cYear := I2Bin( 68 ) cMonth := I2Bin( 8 ) cDay := I2Bin( 1 ) FWrite( nHandle, cYear , 1 ) // write only the first byte FWrite( nHandle, cMonth, 1 ) FWrite( nHandle, cDay , 1 ) FClose( nHandle ) USE test ? "New update date is:", LUpdate() CLOSE ELSE ? "Can not open file" ENDIF RETURN
Status:R
Compliance:C
Files:Library is core
See also:Bin2I(), Bin2L(), Bin2U(), Bin2W(), L2Bin(), W2Bin(), Word(), U2Bin(), FWrite()
Back to index


L2Bin

Lang:binnum.txt
Component:harbour
Doc. source:.\doc\en\binnum.txt
Template:Function
Category:API
Subcategory:Conversion
Oneliner:Convert Harbour numeric into signed long encoded bytes
Syntax:L2Bin( <nNumber> ) --> cBuffer
Arguments:<nNumber> is a numeric value to convert (decimal digits are ignored).
Returns:L2Bin() return four bytes character string that contain 32 bit encoded signed long integer (least significant byte first).
Description:L2Bin() is one of the low level binary conversion functions, those functions convert between Harbour numeric and a character representation of numeric value. L2Bin() take a numeric integer value and convert it into four bytes of encoded 32 bit signed long integer. You might ask what is the need for such functions, well, first of all it allow you to read/write information from/to a binary file (like extracting information from DBF header), it is also a useful way to share information from source other than Harbour (C for instance). L2Bin() is the opposite of Bin2L()
Examples:
Status:R
Compliance:C
Files:Library is core
See also:Bin2I(), Bin2L(), Bin2U(), Bin2W(), I2Bin(), W2Bin(), Word(), U2Bin(), FWrite()
Back to index


U2Bin

Lang:binnum.txt
Component:harbour
Doc. source:.\doc\en\binnum.txt
Template:Function
Category:API
Subcategory:Conversion
Oneliner:Convert Harbour numeric into unsigned long encoded bytes
Syntax:U2Bin( <nNumber> ) --> cBuffer
Arguments:<nNumber> is a numeric value to convert (decimal digits are ignored).
Returns:U2Bin() return four bytes character string that contain 32 bit encoded unsigned long integer (least significant byte first).
Description:U2Bin() is one of the low level binary conversion functions, those functions convert between Harbour numeric and a character representation of numeric value. U2Bin() take a numeric integer value and convert it into four bytes of encoded 32 bit unsigned long integer. You might ask what is the need for such functions, well, first of all it allow you to read/write information from/to a binary file (like extracting information from DBF header), it is also a useful way to share information from source other than Harbour (C for instance). U2Bin() is the opposite of Bin2U()
Examples:
Status:R
Compliance:XPP
Files:Library is core
See also:Bin2I(), Bin2L(), Bin2U(), Bin2W(), I2Bin(), L2Bin(), W2Bin(), Word(), FWrite()
Back to index


W2Bin

Lang:binnum.txt
Component:harbour
Doc. source:.\doc\en\binnum.txt
Template:Function
Category:API
Subcategory:Conversion
Oneliner:Convert Harbour numeric into unsigned short encoded bytes
Syntax:W2Bin( <nNumber> ) --> cBuffer
Arguments:<nNumber> is a numeric value to convert (decimal digits are ignored).
Returns:W2Bin() return two bytes character string that contain 16 bit encoded unsigned short integer (least significant byte first).
Description:W2Bin() is one of the low level binary conversion functions, those functions convert between Harbour numeric and a character representation of numeric value. W2Bin() take a numeric integer value and convert it into two bytes of encoded 16 bit unsigned short integer. You might ask what is the need for such functions, well, first of all it allow you to read/write information from/to a binary file (like extracting information from DBF header), it is also a useful way to share information from source other than Harbour (C for instance). W2Bin() is the opposite of Bin2W()
Examples:
Status:R
Compliance:XPP
Files:Library is core
See also:Bin2I(), Bin2L(), Bin2U(), Bin2W(), I2Bin(), L2Bin(), Word(), U2Bin(), FWrite()
Back to index


Word

Lang:binnum.txt
Component:harbour
Doc. source:.\doc\en\binnum.txt
Template:Function
Category:API
Subcategory:Conversion
Oneliner:Converts double to integer values.
Syntax:Word( <nDouble> ) --> <nInteger>
Arguments:<nDouble> is a numeric double value.
Returns:Word() return an integer in the range +-32767
Description:This function converts double values to integers to use within the CALL command
Examples:
Status:R
Compliance:The CA-Cl*pper NG states that Word() will only work when used in CALL commands parameter list, otherwise it will return NIL, in Harbour it will work anywhere.
Files:Library is core
See also:CALL
Back to index


AFields*

Lang:rddmisc.txt
Component:harbour
Doc. source:.\doc\en\rddmisc.txt
Template:Function
Category:API
Subcategory:Database
Oneliner:Fills referenced arrays with database field information
Syntax:AFields( <aNames>, [<aTypes>], [<aLen>], [<aDecs>] ) --> <nFields>
Arguments:<aNames> Array of field names <aTypes> Array of field names <aLens> Array of field names <aDecs> Array of field names
Returns:<nFields> Number od fields in a database or work area
Description:This function will fill a series of arrays with field names, field types, field lengths, and number of field decimal positions for the currently selected or designed database. Each array parallels the different descriptors of a file's structure. The first array will consist of the names of the fields in the current work area. All other arrays are optional and will be filled with the corresponding data. This function will return zero if no parameters are specified or if no database is available in the current work area. Otherwise, the number of fields or the length of the shortest array argument, whichever is smaller, will be returned. AFields() is a compatibility function, it is superseded by dbStruct() which returns one multidimensional array. NOTE: The destination arrays must be initialized to a given size, usually FCount(), before calling this function.
Examples:PROCEDURE Main() LOCAL aNames, aTypes, aLens, aDecs, nCount, nFields, i USE Test nCount := FCount() ? "Number of fields:", nCount PrintFields( nCount ) // Information for all fields PrintFields( 4 ) // Information for first 4 fields RETURN PROCEDURE PrintFields( nCount ) LOCAL aNames, aTypes, aLens, aDecs, nFields, i aNames := Array( nCount ) aTypes := Array( nCount ) aLens := Array( nCount ) aDecs := Array( nCount ) nFields := AFields( aNames, aTypes, aLens, aDecs ) ? "Number of items :", nFields FOR i := 1 TO nFields ? i, PadR( aNames[ i ], 12 ), aTypes[ i ] ?? aLens[ i ], aDecs[ i ] NEXT ? RETURN
Status:R
Compliance:C
Files:Library is rdd
See also:dbStruct()
Back to index


Alias

Lang:rddmisc.txt
Component:harbour
Doc. source:.\doc\en\rddmisc.txt
Template:Function
Category:API
Subcategory:Database
Oneliner:Returns the alias name of a work area
Syntax:Alias( [<nWorkArea>] ) --> <cWorkArea>
Arguments:<nWorkArea> Number of a work area
Returns:<cWorkArea> Name of alias
Description:This function returns the alias of the work area indicated by <nWorkArea> If <nWorkArea> is not provided, the alias of the current work area is returned.
Examples:PROCEDURE Main() USE test SELECT 0 ? iif( Alias() == "", "No Name", Alias() ) ? test->( Alias() ) ? Alias( 1 ) RETURN
Status:R
Compliance:C
Files:Library is rdd
See also:Dbf()
Back to index


Bof

Lang:rddmisc.txt
Component:harbour
Doc. source:.\doc\en\rddmisc.txt
Template:Function
Category:API
Subcategory:Database
Oneliner:Test for the beginning-of-file condition
Syntax:Bof() --> <lBegin>
Arguments:
Returns:Bof() Logical true (.T.) or false (.F.)
Description:This function determines if the beginning of the file marker has been reached. If so, the function will return a logical true (.T.); otherwise, a logical false (.F.) will be returned. By default, Bof() will apply to the currently selected database unless the function is preceded by an alias
Examples:PROCEDURE Main() USE test NEW ? "Is Bof()", Bof() dbGoTop() WHILE ! Bof() dbSkip( -1 ) ENDDO ? "Is Bof()", Bof() USE RETURN
Status:R
Compliance:C
Files:Library is rdd
See also:Eof(), Found(), LastRec()
Back to index


dbAppend

Lang:rdddb.txt
Component:harbour
Doc. source:.\doc\en\rdddb.txt
Template:Function
Category:API
Subcategory:Database
Oneliner:Appends a new record to a database file.
Syntax:dbAppend( [<lLock>] ) --> NIL
Arguments:<lLock> Toggle to release record locks
Returns:dbAppend() always returns NIL
Description:This function add a new record to the end of the database in the selected or aliased work area. All fields in that database will be given empty data values - character fields will be filled with blank spaces, date fields with hb_SToD(), numeric fields with 0, logical fields with .F., and memo fields with NULL bytes. The header of the database is not updated until the record is flushed from the buffer and the contents are written to the disk. Under a networking enviroment, dbAppend() performs an additional operation: It attrmps to lock the newly added record. If the database file is currently locked or if a locking assignment if made to LastRec() + 1, NetErr() will return a logical true (.T.) immediately after the dbAppend() function. This function does not unlock the locked records. If <lLock> is passed a logical true (.T.) value, it will release the record locks, which allows the application to main- tain multiple record locks during an appending operation. The default for this parameter is a logical false (.F.).
Examples:PROCEDURE Main() LOCAL cName := "Harbour", nId := 10 USE test test->( dbAppend() ) REPLACE test->Name WITH cName, test->Id WITH nId USE RETURN
Status:R
Compliance:C
Files:Library is rdd
See also:dbUnlock(), dbUnlockAll()
Back to index


dbClearFilter

Lang:rdddb.txt
Component:harbour
Doc. source:.\doc\en\rdddb.txt
Template:Function
Category:API
Subcategory:Database
Oneliner:Clears the current filter condiction in a work area
Syntax:dbClearFilter() --> NIL
Arguments:
Returns:dbClearFilter() always returns NIL
Description:This function clears any active filter condiction for the current or selected work area.
Examples:PROCEDURE Main() USE test SET FILTER TO Left( test->Name, 2 ) == "An" dbEdit() Test->( dbClearFilter() ) USE RETURN
Status:R
Compliance:C
Files:Library is rdd
See also:dbSetFilter(), dbFilter()
Back to index


dbCloseAll

Lang:rdddb.txt
Component:harbour
Doc. source:.\doc\en\rdddb.txt
Template:Function
Category:API
Subcategory:Database
Oneliner:Close all open files in all work areas.
Syntax:dbCloseAll() --> NIL
Arguments:
Returns:dbCloseAll() always return NIL
Description:This function close all open databases and all associated indexes. In addition, it closes all format files and moves the work area pointer to the first position
Examples:PROCEDURE Main() USE test NEW dbEdit() USE test1 NEW dbEdit() dbCloseAll() USE RETURN
Status:R
Compliance:C
Files:Library is rdd
See also:dbUseArea(), dbCloseArea()
Back to index


dbCloseArea

Lang:rdddb.txt
Component:harbour
Doc. source:.\doc\en\rdddb.txt
Template:Procedure
Category:API
Subcategory:Database
Oneliner:Close a database file in a work area.
Syntax:dbCloseArea()
Arguments:
Returns:
Description:This function will close any database open in the selected or aliased work area.
Examples:PROCEDURE Main() USE test dbEdit() Test->( dbCloseArea() ) USE RETURN
Status:R
Compliance:C
Files:Library is rdd
See also:dbUseArea(), dbCloseAll()
Back to index


dbCommit

Lang:rdddb.txt
Component:harbour
Doc. source:.\doc\en\rdddb.txt
Template:Procedure
Category:API
Subcategory:Database
Oneliner:Updates all index and database buffers for a given workarea
Syntax:dbCommit()
Arguments:
Returns:
Description:This function updates all of the information for a give, selected, or active workarea. This operation includes all database and index buffers for that work area only. This function does not update all open work areas.
Examples:PROCEDURE Main() LOCAL cName := Space( 40 ) LOCAL nId := 0 USE test EXCLUSIVE NEW // @ 10, 10 GET cName @ 11, 10 GET nId READ // IF Updated() APPEND BLANK REPLACE tests->Name WITH cName REPLACE tests->Id WITH nId tests->( dbCommit() ) ENDIF RETURN
Status:R
Compliance:C
Files:Library is rdd
See also:dbCloseAll(), dbCommitAll(), dbUnlock()
Back to index


dbCommitAll

Lang:rdddb.txt
Component:harbour
Doc. source:.\doc\en\rdddb.txt
Template:Procedure
Category:API
Subcategory:Database
Oneliner:Flushes the memory buffer and performs a hard-disk write
Syntax:dbCommit()
Arguments:
Returns:
Description:This function performs a hard-disk write for all work areas. Before the disk write is performed, all buffers are flushed. open work areas.
Examples:PROCEDURE Main() LOCAL cName := Space( 40 ) LOCAL nId := 0 USE test EXCLUSIVE NEW USE testid NEW INDEX testid // @ 10, 10 GET cName @ 11, 10 GET nId READ // IF Updated() APPEND BLANK REPLACE tests->Name WITH cName REPLACE tests->Id WITH nId IF ! testid->( dbSeek( nId ) ) APPEND BLANK REPLACE tests->Id WITH nId ENDIF ENDIF dbCommitAll() RETURN
Status:R
Compliance:C
Files:Library is rdd
See also:dbCloseAll(), dbCommit(), dbUnlock()
Back to index


dbCreate

Lang:rdddb.txt
Component:harbour
Doc. source:.\doc\en\rdddb.txt
Template:Procedure
Category:API
Subcategory:Database
Oneliner:Creates an empty database from a array.
Syntax:dbCreate( <cDatabase>, <aStruct>, [<cDriver>], [<lOpen>], [<cAlias>] )
Arguments:<cDatabase> Name of database to be create <aStruct> Name of a multidimensional array that contains the database structure <cDriver> Name of the RDD <lOpenNew> 3-way toggle to Open the file in New or Current workarea: <table> NIL The file is not opened. True It is opened in a New area. False It is opened in the current area. </table> <cAlias> Name of database Alias
Returns:
Description:This function creates the database file specified as <cDatabase> from the multidimensional array <aStruct>. If no file extension is use with <cDatabase> the .dbf extension is assumed. The array specified in <aStruct> must follow a few guidelines when being built prior to a call to dbCreate(): - All subscripts values in the second dimension must be set to proper values - The fourth subscript value in the second dimension - which contains the decimal value-must he specified. even 1kw nonnumeric fields. - The second subscript value in the second dimension-which contains the field data type-must contain a proper value: C, D, L, M or N It is possible to use additional letters (or clarity (e.g., 'Numeric' for 'N'): however, the first letter of this array element must be a proper value. The dbCreate( ) function does not use the decimal field to calculate the length of a character held longer than 256. Values up to the maximum length of a character field (which is 65519 bytes) are stored directly in the database in the length attribute if that database was created via this function. However, a file containing fields longer than 256 bytes is not compatible with any interpreter. The <cDriver> parameter specifies the name of the Replaceable Database Driver to use to create the database. If it is not specified, then the Replaceable Database Driver in the current work area is used. The <lOpenNew> parameter specifies if the already created database is to be opened, and where. If NIL, the file is not opened. If True, it is opened in a New area, and if False it is opened in the current area (closing any file already occupying that area). The <cAlias> parameter specifies the alias name for the new opened database.
Examples:PROCEDURE Main() LOCAL nI, aStruct := { ; { "CHARACTER", "C", 25, 0 }, ; { "NUMERIC", "N", 8, 0 }, ; { "DOUBLE", "N", 8, 2 }, ; { "DATE", "D", 8, 0 }, ; { "LOGICAL", "L", 1, 0 }, ; { "MEMO1", "M", 10, 0 }, ; { "MEMO2", "M", 10, 0 } } REQUEST DBFCDX dbCreate( "testdbf", aStruct, "DBFCDX", .T., "MYALIAS" ) RETURN
Status:R
Compliance:This function is not CA-Cl*pper compliant
Files:Library is rdd Header is dbstruct.ch
See also:AFields()*, dbStruct()
Back to index


dbDelete

Lang:rdddb.txt
Component:harbour
Doc. source:.\doc\en\rdddb.txt
Template:Procedure
Category:API
Subcategory:Database
Oneliner:Mark a record for deletion in a database.
Syntax:dbDelete()
Arguments:
Returns:
Description:This function marks a record for deletion in the selected or aliased work area. If the DELETED setting is on, the record will still be visible until the record pointer in that work area is moved to another record. In a networking situation, this function requires that the record be locked prior to issuing the dbDelete() function.
Examples:nId := 10 USE testid INDEX testid NEW IF testid->( dbSeek( nId ) ) IF testid->( RLock() ) dbDelete() ENDIF ENDIF USE
Status:R
Compliance:C
Files:Library is rdd
See also:dbRecall()
Back to index


Dbf

Lang:rdddb.txt
Component:harbour
Doc. source:.\doc\en\rdddb.txt
Template:Function
Category:API
Subcategory:Database
Oneliner:Alias name of a work area
Syntax:Dbf() --> <cWorkArea>
Arguments:
Returns:<cWorkArea> Name of alias
Description:This function returns the same alias name ofthe currently selected work area.
Examples:PROCEDURE Main() USE test SELECT 0 ? iif( Dbf() == "", "No Name", Dbf() ) ? test->( Dbf() ) ? Alias( 1 ) RETURN
Status:R
Compliance:C
Files:Library is rdd
See also:Alias()
Back to index


dbFilter

Lang:rdddb.txt
Component:harbour
Doc. source:.\doc\en\rdddb.txt
Template:Function
Category:API
Subcategory:Database
Oneliner:Return the filter expression in a work area
Syntax:dbFilter() --> cFilter
Arguments:
Returns:dbFilter() returns the filter expression.
Description:This function return the expression of the SET FILTER TO command for the current or designated work area. If no filter condition is present, a NULL string will be returned.
Examples:USE test INDEX test NEW SET FILTER TO Name == "Harbour" USE testid INDEX testid NEW SET FILTER TO Id == 1 SELECT Test // ? dbFilter() ? testid->( dbFilter() )
Status:R
Compliance:C
Files:Library is rdd
See also:dbRelation(), dbRSelect()
Back to index


dbGoBottom

Lang:rdddb.txt
Component:harbour
Doc. source:.\doc\en\rdddb.txt
Template:Procedure
Category:API
Subcategory:Database
Oneliner:Moves the record pointer to the bottom of the database.
Syntax:dbGoBottom()
Arguments:
Returns:
Description:This function moves the record pointer in the selected or aliased work area to the end of the file. The position of the record pointer is affected by the values in the index key or by an active FILTER condition. Otherwise, if no index is active or if no filter condition is present, the value of the record pointer will be LastRec().
Examples:USE tests dbGoTop() ? RecNo() dbGoBottom() ? RecNo() USE
Status:R
Compliance:C
Files:Library is rdd
See also:Bof(), Eof(), dbSkip(), dbSeek(), dbGoTop()
Back to index


dbGoto

Lang:rdddb.txt
Component:harbour
Doc. source:.\doc\en\rdddb.txt
Template:Procedure
Category:API
Subcategory:Database
Oneliner:Position the record pointer to a specific location.
Syntax:dbGoto( <xRecordNumber> )
Arguments:<xRecordNumber> Record number or unique identity
Returns:
Description:This function places the record pointer, if working with a .dbf file, in selected or aliased work area at the record number specified by <xRecordNumber>. The position is not affected by an active index or by any enviromental SET condiction. The parameter <xRecordNumber> may be something other than a record number. In some data formats, for example, the value of <xRecordNumber> is a unique primary key while in other formats, <xRecordNumber> could be an array offset if the data set was an array. Issuing a dbGoto(RecNo()) call in a network enviroment will refresh the database and index buffers. This is the same as a dbSkip(0) call.
Examples:The following example uses dbGoto() TO iteratively process every fourth record: dbUseArea( .T., "DBFNTX", "sales", "sales", .T. ) // // toggle every fourth record DO WHILE ! Eof() dbGoto( RecNo() + 4 ) sales->Group := "Bear" ENDDO
Status:R
Compliance:C
Files:Library is rdd
See also:Bof(), Eof(), dbGoTop(), dbGoBottom(), dbSeek(), dbSkip()
Back to index


dbGoTop

Lang:rdddb.txt
Component:harbour
Doc. source:.\doc\en\rdddb.txt
Template:Procedure
Category:API
Subcategory:Database
Oneliner:Moves the record pointer to the top of the database.
Syntax:dbGoTop()
Arguments:
Returns:
Description:This function moves the record pointer in the selected or aliased work area to the top of the file. The position of the record pointer is affected by the values in the index key or by an active FILTER condition. Otherwise, if no index is active or if no filter condition is present, the value of RecNo() will be 1.
Examples:USE tests dbGoTop() ? RecNo() dbGoBottom() ? RecNo() USE
Status:R
Compliance:C
Files:Library is rdd
See also:Bof(), Eof(), dbSkip(), dbSeek(), dbGoBottom()
Back to index


dbRecall

Lang:rdddb.txt
Component:harbour
Doc. source:.\doc\en\rdddb.txt
Template:Procedure
Category:API
Subcategory:Database
Oneliner:Recalls a record previousy marked for deletion.
Syntax:dbRecall()
Arguments:
Returns:
Description:This function unmarks those records marked for deletion and reactivates them in the aliased or selected work area. If a record is DELETED and the DELETED setting is on, the record will still be visible for a dbRecall() provided that the database record pointer has not been skipped. Once a record marked for deletion with the DELETE setting ON has been skipped, it no longer can be brought back with dbRecall().
Examples:USE test NEW dbGoto( 10 ) dbDelete() ? Deleted() dbRecall() ? Deleted() USE
Status:R
Compliance:C
Files:Library is rdd
See also:dbDelete()
Back to index


dbRLock

Lang:rdddb.txt
Component:harbour
Doc. source:.\doc\en\rdddb.txt
Template:Function
Category:API
Subcategory:Database
Oneliner:This function locks the record based on identity
Syntax:dbRLock( [<xIdentity>] ) --> lSuccess
Arguments:<xIdentity> Record identifier
Returns:dbRLock() returns a logical true (.T.) if lock was successful
Description:This function attempts to lock a record which is identified by <xIdentity> in the active data set. If the lock is successful the function will return a logical true (.T.) value; otherwise a logical false (.F.) will be returned. If <xIdentity> is not passed it will be assumed to lock the current active record/data item.
Examples:PROCEDURE Main() LOCAL x := 0 USE tests NEW FOR x := 1 TO RecCount() IF ! dbRLock() dbUnlock() ENDIF NEXT USE
Status:R
Compliance:C
Files:Library is rdd
See also:dbUnlock(), dbUnlockAll(), FLock(), RLock()
Back to index


dbRLockList

Lang:rdddb.txt
Component:harbour
Doc. source:.\doc\en\rdddb.txt
Template:Function
Category:API
Subcategory:Database
Oneliner:This function return a list of locked records in the database work area
Syntax:dbRLockList() --> aRecordLocks
Arguments:
Returns:<aRecordList> is an array of lock records
Description:This function will return an array of locked records in a given and active work area. If the return array is an empty array (meaning no elements in it), then there are no locked records in that work area.
Examples:PROCEDURE Main() LOCAL aList := {} LOCAL x := 0 USE tests NEW dbGoto( 10 ) RLock() dbGoto( 100 ) RLock() aList := dbRLockList() FOR x := 1 TO Len( aList ) ? aList[ x ] NEXT USE RETURN
Status:R
Compliance:C
Files:Library is rdd
See also:RLock(), dbRLock(), dbRUnlock()
Back to index


dbRUnlock

Lang:rdddb.txt
Component:harbour
Doc. source:.\doc\en\rdddb.txt
Template:Procedure
Category:API
Subcategory:Database
Oneliner:Unlocks a record based on its identifier
Syntax:dbRUnlock( [<xIdentity>] )
Arguments:<xIdentity> Record identifier, typically a record number
Returns:
Description:This function will attempt to unlock the record specified as <xIdentity>, which in a .dbf format is the record number. If not specified, them the current active record/data item will be unlocked
Examples:PROCEDURE Main() USE tests NEW dbGoto( 10 ) IF RLock() ? tests->ID dbRUnlock() ENDIF USE RETURN
Status:R
Compliance:C
Files:Library is rdd
See also:RLock(), dbRLock(), dbRLockList()
Back to index


dbSeek

Lang:rdddb.txt
Component:harbour
Doc. source:.\doc\en\rdddb.txt
Template:Function
Category:API
Subcategory:Database
Oneliner:Searches for a value based on an active index.
Syntax:dbSeek( <expKey>, [<lSoftSeek>], [<lFindLast>] ) --> lFound
Arguments:<expKey> Any expression <lSoftSeek> Toggle SOFTSEEK condition <lFindLast> is an optional logical value that set the current record position to the last record if successful
Returns:dbSeek() returns logical true (.T.) if found, otherwise false
Description:This function searches for the first record in a database file whose index key matches <expKey>. If the item is found, the function will return a logical true (.T.), the value of Found() wilI be a logical true (.T.), and the value of Eof() wilI be a logical false (.F.). If no item is found. then the function will return a logical false, the value of Found( ) will be a logical false (.F.), and the value of Eof() will be a logical true (.T.). This function always "rewinds" the database pointer and starts the search from the top of the file. If the SOFTSEEK flag is on or if <lSoftSeek> is set to a logical true (.T.) the value of Found() will be a logical false and Eof() will be false if there is an item in the index key with a greater value than the key expression <expKey>; at this point the record pointer will position itself on that record. However, if there is no greater key in the index, Eof() will return a logical true (.T.) value. If <lSoftSeek> is not passed, the function will look to the internal status of SOFTSEEK before performing the operation. The default of <lSoftSeek> is a logical false (.F.)
Examples:PROCEDURE Main() USE tests NEW INDEX tests dbGoto( 10 ) nId := tests->nId IF tests->( dbSeek( nId ) ) IF RLock() ? tests->Name dbRUnlock() ENDIF ENDIF USE RETURN ACCEPT "Employee name: " TO cName IF Employee->( dbSeek( cName ) ) Employee->( ViewRecord() ) ELSE ? "Not found" ENDIF
Status:S
Compliance:dbSeek() is Compatible with CA-Cl*pper 5.3
Files:Library is rdd
See also:dbGoBottom(), dbGoTop(), dbSkip(), Eof(), Bof(), Found()
Back to index


dbSelectArea

Lang:rdddb.txt
Component:harbour
Doc. source:.\doc\en\rdddb.txt
Template:Procedure
Category:API
Subcategory:Database
Oneliner:Change to another work area
Syntax:dbSelectArea( <xArea> ) -
Arguments:<xArea> Alias or work area
Returns:
Description:This function moves the Harbour internal primary focus to the work area designated by <xArea>. If <xArea> is numeric, then it will select the numeric work area; if <xArea> is character, then it will select the work area with the alias name. dbSelectArea(0) will select the next avaliable and unused work area. Up to 255 work areas are supported. Each work area has its own alias and record pointer, as well as its own Found(), dbFilter(), dbRSelect() and dbRelation() function values.
Examples:PROCEDURE Main() LOCAL nId USE tests NEW INDEX tests USE tests1 NEW INDEX tests1 dbSelectArea( 1 ) nId := tests->Id dbSelectArea( 2 ) IF dbSeek( nId ) ? tests1->cName ENDIF dbCloseAll() RETURN
Status:R
Compliance:C
Files:Library is rdd
See also:dbUseArea(), Select()
Back to index


dbSetDriver

Lang:rdddb.txt
Component:harbour
Doc. source:.\doc\en\rdddb.txt
Template:Function
Category:API
Subcategory:Database
Oneliner:Establishes the RDD name for the selected work area
Syntax:dbSetDriver( [<cDriver>] ) --> cCurrentDriver
Arguments:<cDriver> Optional database driver name
Returns:dbSetDriver() returns the name of active driver
Description:This function returns the name of the current database driver for the selected work area. The default will be "DBFNTX". If specified, <cDriver> contains the name of the database driver that should be used to activate and manage the work area. If the specified driver is not avaliable, this function will have no effect.
Examples:dbSetDriver( "ADS" )
Status:R
Compliance:C
Files:Library is rdd
See also:dbUseArea()
Back to index


dbSetFilter

Lang:rdddb.txt
Component:harbour
Doc. source:.\doc\en\rdddb.txt
Template:Procedure
Category:API
Subcategory:Database
Oneliner:Establishes a filter condition for a work area.
Syntax:dbSetFilter( <bCondition>, [<cCondition>] )
Arguments:<bCondition> Code block expression for filtered evaluation. <cCondition> Optional character expression of code block.
Returns:
Description:This function masks a database so that only those records that meet the condition prescribed by the expression in the code block <bCondition> and literally expressed as <cCondition> are visible. If <cCondition> is not passed to this function, then the dbFilter() function will return an empty string showing no filter in that work area which in fact, would be not correct.
Examples:PROCEDURE Main() USE tests NEW dbSetFilter( {|| tests->Id < 100 }, "tests->Id <100" ) dbGoTop()
Status:R
Compliance:C
Files:Library is rdd
See also:dbFilter(), dbClearFilter()
Back to index


dbSkip

Lang:rdddb.txt
Component:harbour
Doc. source:.\doc\en\rdddb.txt
Template:Procedure
Category:API
Subcategory:Database
Oneliner:Moves the record pointer in the selected work area.
Syntax:dbSkip( [<nRecords>] )
Arguments:<nRecords> Numbers of records to move record pointer.
Returns:
Description:This function moves the record pointer <nRecords> in the selected or aliased work area. The default value for <nRecords> will be 1. A dbSkip(0) will flush and refresh the internal database bufer and make any changes made to the record visible without moving the record pointer in either direction.
Examples:PROCEDURE Main() USE tests NEW dbGoTop() DO WHILE ! Eof() ? tests->Id, tests->Name dbSkip() ENDDO USE RETURN
Status:R
Compliance:C
Files:Library is rdd
See also:Bof(), dbGoBottom(), dbGoTop(), dbSeek(), Eof()
Back to index


dbStruct

Lang:rdddb.txt
Component:harbour
Doc. source:.\doc\en\rdddb.txt
Template:Function
Category:API
Subcategory:Database
Oneliner:Creates a multidimensional array of a database structure.
Syntax:dbStruct() --> aStruct
Arguments:
Returns:dbStruct() returns an array pointer to database structure
Description:This function returns a multidimensional array. This array has array pointers to other arrays, each of which contains the characteristic of a field in the active work area. The lenght of this array is based in the number of fields in that particular work area. In other words, Len(dbStruct()) is equal to the value obtained from FCount(). Each subscript position
Examples:#include "dbstruct.ch" PROCEDURE Main() LOCAL aStru, x USE tests NEW aStru := dbStruct() FOR x := 1 TO Len( aStru ) ? aStru[ x ][ DBS_NAME ] NEXT USE RETURN
Status:R
Compliance:C
Files:Library is rdd Header is dbstruct.ch
See also:AFields()*
Back to index


dbUnlock

Lang:rdddb.txt
Component:harbour
Doc. source:.\doc\en\rdddb.txt
Template:Procedure
Category:API
Subcategory:Database
Oneliner:Unlock a record or release a file lock
Syntax:dbUnlock()
Arguments:
Returns:
Description:This function releases the file or record lock in the currently selected or aliased work area. It will not unlock an associated lock in a related databases.
Examples:nId := 10 USE testid INDEX testid NEW IF testid->( dbSeek( nId ) ) IF testid->( RLock() ) dbDelete() ELSE dbUnlock() ENDIF ENDIF USE
Status:R
Compliance:C
Files:Library is rdd
See also:dbUnlockAll(), FLock(), RLock()
Back to index


dbUnlockAll

Lang:rdddb.txt
Component:harbour
Doc. source:.\doc\en\rdddb.txt
Template:Procedure
Category:API
Subcategory:Database
Oneliner:Unlocks all records and releases all file locks in all work areas.
Syntax:dbUnlockAll()
Arguments:
Returns:
Description:This function will remove all file and record locks in all work area.
Examples:nId := 10 USE tests INDEX testid NEW USE tests1 INDEX tests NEW IF testid->( dbSeek( nId ) ) IF testid->( RLock() ) dbDelete() ELSE dbUnlock() ENDIF ELSE dbUnlockAll() ENDIF USE
Status:R
Compliance:C
Files:Library is rdd
See also:dbUnlock(), FLock(), RLock()
Back to index


dbUseArea

Lang:rdddb.txt
Component:harbour
Doc. source:.\doc\en\rdddb.txt
Template:Procedure
Category:API
Subcategory:Database
Oneliner:Opens a work area and uses a database file.
Syntax:dbUseArea( [<lNewArea>], [<cDriver>], <cName>, [<xcAlias>], [<lShared>], [<lReadonly>])
Arguments:<lNewArea> A optional logical expression for the new work area <cDriver> Database driver name <cName> File Name <xcAlias> Alias name <lShared> Shared/exclusive status flag <lReadonly> Read-write status flag.
Returns:
Description:This function opens an existing database named <cName> in the current work area. If <lNewArea> is set to a logical true (.T.) value, then the database <cName> will be opened in the next available and unused work area. The default value of <lNewArea> is a logical false (.F.). If used, <cDriver> is the name of the database driver associated with the file <cName> that is opened. The default for this will be the value of dbSetDriver(). IF used, <xcAlias> contains the alias name for that work area, If not specified, the root name of the database specified in <cName> will be used. If <lShared> is set to a logical true (.T.) value, the database that is specified in <cName> will be opened by the user EXCLUSIVELY. Thus locking it from all other nodes or users on the network. If <lShared> is set to a logical false (.F.) value, then the database will be in SHARED mode. If <lShared> is not passed, then the function will turn to the internal setting of SET EXCLUSIVE to determine a setting. If <lReadOnly> is specified, the file will be set to READ ONLY mode. If it is not specified, the file will he opened in normal read-write mode.
Examples:dbUseArea( .T.,, "tests" )
Status:R
Compliance:C
Files:Library is rdd
See also:dbCloseArea(), dbSetDriver(), Select(), Set()
Back to index


Deleted

Lang:rddmisc.txt
Component:harbour
Doc. source:.\doc\en\rddmisc.txt
Template:Function
Category:API
Subcategory:Database
Oneliner:Tests the record's deletion flag.
Syntax:Deleted() --> lDeleted
Arguments:(This command has no arguments)
Returns:Deleted() return a logical true (.T.) or false (.F.).
Description:This function returns a logical true (.T.) if the current record in the selected or designated work area has been marked for deletion. If not, the function will return a logical false (.F.).
Examples:PROCEDURE Main() USE test NEW dbGoto() dbDelete() ? "Is Record Deleted", Test->( Deleted() ) dbRecall() USE RETURN
Status:R
Compliance:C
Files:Library is rdd
See also:dbDelete()
Back to index


Eof

Lang:rddmisc.txt
Component:harbour
Doc. source:.\doc\en\rddmisc.txt
Template:Function
Category:API
Subcategory:Database
Oneliner:Test for end-of-file condition.
Syntax:Eof() --> <lEnd>
Arguments:(This command has no arguments)
Returns:<lEnd> A logical true (.T.) or false (.F.)
Description:This function determines if the end-of-file marker has been reached. If it has, the function will return a logical true (.T.); otherwise a logical false (.F.) will be returned
Examples:PROCEDURE Main() USE test NEW dbGoTop() ? "Is Eof()", Eof() dbGoBottom() WHILE ! Eof() dbSkip() ENDDO ? "Is Eof()", Eof() USE RETURN
Status:R
Compliance:C
Files:Library is rdd
See also:Bof(), Found(), LastRec()
Back to index


FCount

Lang:rddmisc.txt
Component:harbour
Doc. source:.\doc\en\rddmisc.txt
Template:Function
Category:API
Subcategory:Database
Oneliner:Counts the number of fields in an active database.
Syntax:FCount() --> nFields
Arguments:
Returns:<nFields> Return the number of fields
Description:This function returns the number of fields in the current or designated work area. If no database is open in this work area, the function will return 0.
Examples:PROCEDURE Main() USE tests NEW ? "This database have", tests->( FCount() ), "Fields" USE RETURN
Status:R
Compliance:C
Files:Library is rdd
See also:FieldName(), Type()
Back to index


FieldGet

Lang:rddmisc.txt
Component:harbour
Doc. source:.\doc\en\rddmisc.txt
Template:Function
Category:API
Subcategory:Database
Oneliner:Obtains the value of a specified field
Syntax:FieldGet( <nField> ) --> ValueField
Arguments:<nField> Is the numeric field position
Returns:<ValueField> Any expression
Description:This function returns the value of the field at the <nField>th location in the selected or designed work area. If the value in <nField> does not correspond to n available field position in this work area, the function will return a NIL data type.
Examples:PROCEDURE Main() USE test NEW ? test->( FieldGet( 1 ) ) USE RETURN
Status:R
Compliance:C
Files:Library is rdd
See also:FieldPut()
Back to index


FieldName

Lang:rddmisc.txt
Component:harbour
Doc. source:.\doc\en\rddmisc.txt
Template:Function
Category:API
Subcategory:Database
Oneliner:Return the name of a field at a numeric field location.
Syntax:FieldName()/Field( <nPosition> ) --> cFieldName
Arguments:<nPosition> Field order in the database.
Returns:<cFieldName> returns the field name.
Description:This function return the name of the field at the <nPosition>th position. If the numeric value passed to this function does not correspond to an existing field in the designated or selected work area, this function will return a NULL byte.
Examples:PROCEDURE Main() LOCAL x USE tests NEW FOR x := 1 TO tests->( FCount() ) ? "Field Name", FieldName( x ) NEXT USE RETURN
Status:R
Compliance:C
Files:Library is rdd
See also:dbStruct(), FCount(), Len(), ValType()
Back to index


FieldPos

Lang:rddmisc.txt
Component:harbour
Doc. source:.\doc\en\rddmisc.txt
Template:Function
Category:API
Subcategory:Database
Oneliner:Return the ordinal position of a field.
Syntax:FieldPos( <cFieldName> ) --> nFieldPos
Arguments:<cFieldName> Name of a field.
Returns:<nFieldPos> is ordinal position of the field.
Description:This function return the ordinal position of the specified field <cField> in the current or aliased work areaIf there isn't field under the name of <cField> or of no database is open in the selected work area, the function will return a 0.
Examples:PROCEDURE Main() USE test NEW ? test->( FieldPos( "ID" ) ) USE RETURN
Status:R
Compliance:C
Files:Library is rdd
See also:FieldGet(), FieldPut()
Back to index


FieldPut

Lang:rddmisc.txt
Component:harbour
Doc. source:.\doc\en\rddmisc.txt
Template:Function
Category:API
Subcategory:Database
Oneliner:Set the value of a field variable
Syntax:FieldPut( <nField>, <expAssign> ) --> ValueAssigned
Arguments:<nField> The field numeric position <expAssign> Expression to be assigned to the specified field
Returns:<ValueAssigned> Any expression
Description:This function assigns the value in <expAssing> to the <nField>th field in the current or designated work area. If the operation is successful, the return value of the function will be the same value assigned to the specified field. If the operation is not successful, the function will return a NIL data type
Examples:USE tests NEW FieldPut( 1, "Mr. Jones" ) USE
Status:R
Compliance:C
Files:Library is rdd
See also:FieldGet()
Back to index


FLock

Lang:rddmisc.txt
Component:harbour
Doc. source:.\doc\en\rddmisc.txt
Template:Function
Category:API
Subcategory:Database
Oneliner:Locks a file
Syntax:FLock() --> lSuccess
Arguments:
Returns:<lSuccess> A true (.T.) value, if the lock was successful; otherwise false (.F.)
Description:This function returns a logical true (.T.) if a file lock is attempted and is successfully placed on the current or designated database. This function will also unlock all records locks placed by the same network station.
Examples:USE tests NEW IF FLock() SUM tests->Ammount ENDIF USE
Status:R
Compliance:C
Files:Library is rdd
See also:RLock()
Back to index


Found

Lang:rddmisc.txt
Component:harbour
Doc. source:.\doc\en\rddmisc.txt
Template:Function
Category:API
Subcategory:Database
Oneliner:Determine the success of a previous search operation.
Syntax:Found() --> lSuccess
Arguments:(This function has no arguments)
Returns:<lSuccess> A logical true (.T.) is successful; otherwise, false (.F.)
Description:This function is used to test if the previous SEEK, LOCATE, CONTINUE, or FIND operation was successful. Each work area has its own Found() flag, so that a Found() condition may be tested in unselected work areas by using an alias.
Examples:nId := 100 USE tests NEW INDEX tests SEEK nId IF Found() ? tests->Name ENDIF USE
Status:R
Compliance:C
Files:Library is rdd
See also:Eof()
Back to index


Header

Lang:rddmisc.txt
Component:harbour
Doc. source:.\doc\en\rddmisc.txt
Template:Function
Category:API
Subcategory:Database
Oneliner:Return the length of a database file header
Syntax:Header() --> nBytes
Arguments:
Returns:<nBytes> The numeric size of a database file header in bytes
Description:This function returns the number of bytes in the header of the selected database ot the database in the designated work area. If used in conjunction with the LastRec(), RecSize() and DiskSpace() functions, this functions is capable of implementing a backup and restore routine.
Examples:USE tests NEW ? Header()
Status:R
Compliance:C
Files:Library is rdd
See also:DiskSpace(), LastRec(), RecSize()
Back to index


IndexExt

Lang:rddord.txt
Component:harbour
Doc. source:.\doc\en\rddord.txt
Template:Function
Category:API
Subcategory:Database
Oneliner:Returns the file extension of the index module used in an application
Syntax:IndexExt() --> <cExtension>
Arguments:None.
Returns:<cExtension> Current driver file extension
Description:This function returns a string that tells what indexes are to be used or will be created in the compiled application. The default value is ".ntx". This is controled by the particular database driver that is linked with the application.
Examples:IF IndexExt() == ".ntx" ? "Current driver being used is DBFNTX" ENDIF
Status:R
Compliance:C
Files:Library is rdd
See also:IndexKey(), IndexOrd()
Back to index


IndexKey

Lang:rddord.txt
Component:harbour
Doc. source:.\doc\en\rddord.txt
Template:Function
Category:API
Subcategory:Database
Oneliner:Yields the key expression of a specified index file.
Syntax:IndexKey( <nOrder> ) --> <cIndexKey>
Arguments:<nOrder> Index order number
Returns:<cIndexKey> The index key
Description:This function returns a character string stored in the header of the index file The index key is displayed for an index file that is designated by <nOrder>, its position in the USE...INDEX or SET INDEX TO command in the currently selected or designated work area. If there is no corresnponding index key at the specified order position, a NULL byte will be returned.
Examples:USE tests NEW INDEX test1 ? IndexKey( 1 )
Status:R
Compliance:C
Files:Library is rdd
See also:IndexOrd()
Back to index


IndexOrd

Lang:rddord.txt
Component:harbour
Doc. source:.\doc\en\rddord.txt
Template:Function
Category:API
Subcategory:Database
Oneliner:Returns the numeric position of the controlling index.
Syntax:IndexOrd() --> <nPosition>
Arguments:None.
Returns:<nPosition> Ordinal position of a controling index
Description:The IndexOrd() function returns the numeric position of the current controlling index in the selected or designated work area. A returned value of 0 indicated that no active index is controlling the database, which therefore is in the natural order.
Examples:USE tests NEW INDEX test1 IF IndexOrd() > 0 ? "Current order is", IndexOrd() ENDIF
Status:R
Compliance:C
Files:Library is rdd
See also:IndexKey()
Back to index


LastRec

Lang:rddmisc.txt
Component:harbour
Doc. source:.\doc\en\rddmisc.txt
Template:Function
Category:API
Subcategory:Database
Oneliner:Returns the number of records in an active work area or database.
Syntax:LastRec() | RecCount()* --> nRecords
Arguments:
Returns:<nRecords > The number of records
Description:This function returns the number of records present in the database in the selected or designated work area. If no records are present the value of this function will be 0. Additionally, if no database is in use in the selected or designated work area, this function will return a 0 value as well.
Examples:USE tests NEW ? LastRec(), RecCount()
Status:R
Compliance:C
Files:Library is rdd
See also:Eof()
Back to index


LUpdate

Lang:rddmisc.txt
Component:harbour
Doc. source:.\doc\en\rddmisc.txt
Template:Function
Category:API
Subcategory:Database
Oneliner:Yields the date the database was last updated.
Syntax:LUpdate() --> dModification
Arguments:(This function has no arguments)
Returns:<dModification> The date of the last modification.
Description:This function returns the date recorded by the OS when the selected or designated database was last written to disk. This function will only work for those database files in USE.
Examples:PROCEDURE Main() USE tests NEW ? LUpdate() USE RETURN
Status:R
Compliance:C
Files:Library is rdd
See also:FieldName(), LastRec(), RecSize()
Back to index


NetErr

Lang:rddmisc.txt
Component:harbour
Doc. source:.\doc\en\rddmisc.txt
Template:Function
Category:API
Subcategory:Database
Oneliner:Tests the success of a network function
Syntax:NetErr( [<lNewError>] ) --> lError
Arguments:<lNewError> Is a logical Expression.
Returns:<lError> A value based on the success of a network operation or function.
Description:This function return a logical true (.T.) is a USE, APPEND BLANK, or a USE...EXCLUSIVE command is issue and fails in a network environment. In the case of USE and USE...EXCLUSIVE commands, a NetErr() value of .T. would be returned if another node of the network has the exclusive use of a file. And the case of the APPEND BLANK command, NetErr() will return a logical true (.T.) if the file or record is locked by another node or the value of LastRec() has been advanced The value of NetErr() may be changed via the value of <lNewError>. This allow the run-time error-handling system to control the way certain errors are handled.
Examples:USE test NEW IF ! NetErr() INDEX ON field->First TO test SET INDEX TO test test->First := "Harbour" SEEK "Harbour" IF Found() ? test->First ENDIF ENDIF USE
Status:R
Compliance:C
Files:Library is rdd
See also:FLock(), RLock()
Back to index


ordBagExt

Lang:rddord.txt
Component:harbour
Doc. source:.\doc\en\rddord.txt
Template:Function
Category:API
Subcategory:Database
Oneliner:Returns the Order Bag extension
Syntax:ordBagExt() --> cBagExt
Arguments:None
Returns:<cBagExt> The RDD extension name.
Description:This function return th character name of the RDD extension for the order bag. This is determined by the active RDD for the selected work area. This function replaces the IndexOrd() function.
Examples:USE tests NEW VIA "DBFNTX" ? ordBagExt() // Returns .ntx dbCloseArea() USE tests NEW VIA "DBFCDX" ? ordBagExt() // Returns .cdx dbCloseArea()
Status:S
Compliance:C
Files:Library is rdd
See also:IndexExt(), ordBagName()
Back to index


ordBagName

Lang:rddord.txt
Component:harbour
Doc. source:.\doc\en\rddord.txt
Template:Function
Category:API
Subcategory:Database
Oneliner:Returns the Order Bag Name.
Syntax:ordBagName( <nOrder> | <cOrderName> ) --> cOrderBagName
Arguments:<nOrder> A numeric value representing the Order bag number. <cOrderName> The character name of the Order Bag.
Returns:ordBagName() returns the Order bag name
Description:This function returns the name of the order bag for the specified work area. If <nOrder> is specidied, it will represent the position in the order list of the target order. If <cOrderName> is specified, it will represent the name of the target order. In essence, it will tell the name of the database (if That Rdd is in use) for a given index name or index order number. If <cOrderName> is not specified or <nOrder> is 0, the Current active order will be used.
Examples:USE tests VIA "DBFCDX" NEW SET INDEX TO tests ordBagName( "TeName" ) // Returns: Customer ordBagName( "TeLast" ) // Returns: Customer ordBagName( "teZip" ) // Returns: Customer SET ORDER TO TAG TeName ? OrderBagName() // Returns: Custumer
Status:S
Compliance:C
Files:Library is rdd
See also:IndexOrd(), ordBagExt(), Alias()
Back to index


ordCondSet

Lang:rddord.txt
Component:harbour
Doc. source:.\doc\en\rddord.txt
Template:Procedure
Category:API
Subcategory:Database
Oneliner:Set the Condition and scope for an order
Syntax:ORDCONSET([<cForCondition>], [<bForCondition>], [<lAll>], [<bWhileCondition>], [<bEval>], [<nInterval>], [<nStart>], [<nNext>], [<nRecord>], [<lRest>], [<lDescend>], [<lAdditive>], [<lCurrent>], [<lCustom>], [<lNoOptimize>])
Arguments:<cForCondition> is a string that specifies the FOR condition for the order. <bForCondition> is a code block that defines a FOR condition that each record within the scope must meet in order to be processed. If a record does not meet the specified condition, it is ignored and the next record is processed.Duplicate keys values are not added to the index file when a FOR condition is Used.
Returns:
Description:
Examples:
Status:S
Compliance:C
Files:Library is rdd
See also:
Back to index


ordCreate

Lang:rddord.txt
Component:harbour
Doc. source:.\doc\en\rddord.txt
Template:Procedure
Category:API
Subcategory:Database
Oneliner:Create an Order in an Order Bag
Syntax:ordCreate( <cOrderBagName>,[<cOrderName>], <cExpKey>, [<bExpKey>], [<lUnique>] )
Arguments:<cOrderBagName> Name of the file that contains one or more Orders. <cOrderName> Name of the order to be created. <cExpKey> Key value for order for each record in the current work area <bExpKey> Code block that evaluates to a key for the order for each record in the work area. <lUnique> Toggle the unique status of the index.
Returns:
Description:This function creates an order for the current work area. It is similar to the dbCreateIndex() except that this function allows different orders based on the RDD in effect. The name of the file <cOrderBagName> or the name of the order <cOrderName> are technically both considered to be "optional" except that at least one of two must exist in order to create the order. The parameter <cExpKey> is the index key expression; typically in a .dbf driver, the maximum length of the key is 255 characters. If <bExpKey> is not specified, then the code block is create by macro expanding the value of <cExpKey>. If <lUnique> is not specified, then the current internal setting of SET UNIQUE ON or OFF will be observed. The active RDD driver determines the capacity in the order for a specific order bag. If the name <cOrderBagName> is found in the order bag can contain a single order, the the name <cOrderBagName> is erased and a new order is added to the order list in the current or specified work area.On the other hand, if it can contain multiples tags and if <cOrderBagName> does not already exist in the order list, then it is added. It is does exist, then the <cOrderBagName> replaces the former name in the order list in the current or specified work area.
Examples:USE tests VIA "DBFNDX" NEW ordCreate( "FNAME",, "Tests->fName" ) USE tests VIA "DBFCDX" NEW ordCreate( , "lName", "tests->lName" )
Status:S
Compliance:C
Files:Library is rdd
See also:dbCreateIndex(), ordName(), ordSetFocus()
Back to index


ordDestroy

Lang:rddord.txt
Component:harbour
Doc. source:.\doc\en\rddord.txt
Template:Procedure
Category:API
Subcategory:Database
Oneliner:Remove an Order from an Order Bag
Syntax:ordDestroy( <cOrderName> [, <cOrderBagName> ] )
Arguments:<cOrderName> Name of the order to remove <cOrderBagName> Name of the order bag from which order id to be removed
Returns:
Description:This function attempts to remove the order named <cOrderName> from the file containing the order bag name <cOrderBagName>. If <cOrderBagName> is not specified, then the name of the file will be based on the value of the ordName() function. If the extension is not included with the name of the order file, then the extension will be obtained from the default extension of the current and active RDD. The DBFNTX driver do not support multiple order bags; therefore, there cannot be an order to "destroy" from a bag. This function only works for those drivers with support multiple orders bags (e.q. DBFCDX and RDDADS drivers).
Examples:USE tests VIA "DBFCDX" NEW ordDestroy( "lName", "tests" )
Status:S
Compliance:C
Files:Library is rdd
See also:ordCreate()
Back to index


ordFor

Lang:rddord.txt
Component:harbour
Doc. source:.\doc\en\rddord.txt
Template:Function
Category:API
Subcategory:Database
Oneliner:Return the FOR expression of an Order
Syntax:ordFor( <xOrder>[, <cOrderBagName>] ) --> cForExp
Arguments:<xOrder> It the name of the target order, or the numeric position of the order. <cOrderBagName> Name of the order bag.
Returns:ordFor() returns a expression containing the FOR condition for an order.
Description:This function returns a character string that is the expression for the FOR condition for the specified order. The order may be specified if <xOrder> is the name of the order.However, <xOrder> may be an numeric which represent the position in the order list of the desired Order.
Examples:USE tests NEW VIA "DBFCDX" INDEX ON tests->ID ; TO tests ; FOR tests->ID > 100 ordFor( "tests" ) // Returns: tests->ID > 100
Status:S
Compliance:This function is CA-Cl*pper compliant with one exception: If the <xOrder> paramter is not specified or <xOrder> is 0, the current active order is used.
Files:Library is rdd
See also:ordKey(), ordCreate(), ordName(), ordNumber()
Back to index


ordKey

Lang:rddord.txt
Component:harbour
Doc. source:.\doc\en\rddord.txt
Template:Function
Category:API
Subcategory:Database
Oneliner:Return the key expression of an Order
Syntax:ordKey( <cOrderName> | <nOrder> [, <cOrderBagName>] ) --> cExpKey
Arguments:<xOrder> It the name of the target order, or the numeric position of the order. <cOrderBagName> Name of the order bag.
Returns:<cExpKey> Returns a character string, cExpKey.
Description:
Examples:USE tests NEW VIA "DBFCDX" INDEX ON tests->fName ; TO tests ; FOR tests->fName > "CK" INDEX ON tests->Id TO TestId ordKey( "tests" ) // Returns: tests->fName SET ORDER TO 2 ordKey() // Returns: tests->Id
Status:S
Compliance:This function is CA-Cl*pper compliant with one exception: If the <xOrder> paramter is not specified or <xOrder> is 0, the current active order is used.
Files:Library is rdd
See also:ordFor(), ordName(), ordNumber(), ordKey()
Back to index


RecCount

Lang:rddmisc.txt
Component:harbour
Doc. source:.\doc\en\rddmisc.txt
Template:Function
Category:API
Subcategory:Database
Oneliner:Counts the number of records in a database.
Syntax:RecCount()* | LastRec() --> nRecords
Arguments:(This function has no arguments)
Returns:<nRecords> The number of records CRIPTION$* This function returns the number of records present in the database in the selected or designated work area. If no records are present the value of this function will be 0. Additionally, if no database is in use in the selected or designated work area, this function will return a 0 value as well.
Description:
Examples:USE test NEW USE harbour NEW ? RecCount() ? Test->( RecCount() ) CLOSE ALL
Status:R
Compliance:C
Files:Library is rdd
See also:Eof(), LastRec(), RecNo(), dbGoBottom()
Back to index


RecNo

Lang:rddmisc.txt
Component:harbour
Doc. source:.\doc\en\rddmisc.txt
Template:Function
Category:API
Subcategory:Database
Oneliner:Returns the current record number or identity.
Syntax:RecNo() --> Identity
Arguments:(This function has no arguments)
Returns:RecNo() The record number or identity
Description:This function returns the position of the record pointer in the currently selected of designated work area. If the database file is empty and if the RDD is the traditional .dbf file, the value of this function will be 1.
Examples:USE tests NEW dbGoTop() RecNo() // Returns 1 dbGoto( 50 ) RecNo() // Returns 50
Status:R
Compliance:C
Files:Library is rdd
See also:dbGoto(), dbGoTop(), dbGoBottom(), LastRec(), Eof(), Bof()
Back to index


RecSize

Lang:rddmisc.txt
Component:harbour
Doc. source:.\doc\en\rddmisc.txt
Template:Function
Category:API
Subcategory:Database
Oneliner:Returns the size of a single record in an active database.
Syntax:RecSize() --> nBytes
Arguments:(This function has no arguments)
Returns:<nBytes> The record size.
Description:This function returns the number of bytes used by a single record in the currently selected or designated database file. If no database is in use in this work area, the return value from this function will be 0.
Examples:USE tests NEW dbGoTop() RecSize() // Returns 1 dbGoto( 50 ) RecSize()
Status:R
Compliance:C
Files:Library is rdd
See also:DiskSpace(), FieldName(), Header(), LastRec()
Back to index


RLock

Lang:rddmisc.txt
Component:harbour
Doc. source:.\doc\en\rddmisc.txt
Template:Function
Category:API
Subcategory:Database
Oneliner:Lock a record in a work area
Syntax:RLock() --> lSuccess
Arguments:(This function has no arguments)
Returns:RLock() True (.T.) if record lock is successful; otherwise, it returns false (.F.).
Description:This function returns a logical true (.T.) if an attempt to lock a specific record in a selected or designated work area is successful. It will yield a false (.F.) if either the file or the desired record is currently locked. A record that is locked remains locked until another RLock() is issued or until an UNLOCK command is executed. On a Network environment the follow command need that the record is locked: @...GET DELETE (single record) RECALL (single record) REPLACE (single record)
Examples:nId := 10 USE testid INDEX testid NEW IF testid->( dbSeek( nId ) ) IF testid->( RLock() ) dbDelete() ENDIF ENDIF USE
Status:R
Compliance:C
Files:Library is rdd
See also:FLock()
Back to index


Select

Lang:rddmisc.txt
Component:harbour
Doc. source:.\doc\en\rddmisc.txt
Template:Function
Category:API
Subcategory:Database
Oneliner:Returns the work area number for a specified alias.
Syntax:Select( [<cAlias>] ) --> nWorkArea
Arguments:<cAlias> is the target work area alias name.
Returns:Select() returns the work area number.
Description:This function returns the work area number for the specified alias name <cAlias>. If no parameter is specified, the current work area will be the return value of the function.
Examples:USE tests NEW USE names NEW cOldArea := Select( "names" ) SELECT test LIST SELECT cOldArea
Status:R
Compliance:C
Files:Library is rdd
See also:Alias(), Used()
Back to index


Used

Lang:rddmisc.txt
Component:harbour
Doc. source:.\doc\en\rddmisc.txt
Template:Function
Category:API
Subcategory:Database
Oneliner:Checks whether a database is in use in a work area
Syntax:Used() --> lDbfOpen
Arguments:(This function has no arguments)
Returns:<lDbfOpen> True is a database is Used;otherwise False
Description:This function returns a logical true (.T.) if a database file is in USE in the current or designated work area. If no alias is specified along with this function , it will default to the currently selected work area.
Examples:USE tests NEW USE names NEW ? Used() // .T. ? TESTS->( Used() ) //.T. CLOSE ? Used() // .F. SELECT tests ? Used() //.T.
Status:R
Compliance:C
Files:Library is rdd
See also:Alias(), Select()
Back to index


__dbCopyStruct

Lang:dbstrux.txt
Component:harbour
Doc. source:.\doc\en\dbstrux.txt
Template:Procedure
Category:API
Subcategory:Database
Oneliner:Create a new database based on current database structure
Syntax:__dbCopyStruct( <cFileName>, [<aFieldList>] )
Arguments:<cFileName> is the name of the new database file to create. (.dbf) is the default extension if none is given. <aFieldList> is an array where each element is a field name. Names could be specified as uppercase or lowercase.
Returns:
Description:__dbCopyStruct() create a new empty database file with a structure that is based on the currently open database in this work-area. If <aFieldList> is empty, the newly created file would have the same structure as the currently open database. Else, the new file would contain only fields that exactly match <aFieldList>. __dbCopyStruct() can be use to create a sub-set of the currently open database, based on a given field list. COPY STRUCTURE command is preprocessed into __dbCopyStruct() function during compile time.
Examples:// Create a new file that contain the same structure USE TEST __dbCopyStruct( "mycopy.dbf" ) // Create a new file that contain part of the original structure LOCAL aList USE TEST aList := { "NAME" } __dbCopyStruct( "onlyname.dbf", aList )
Status:R
Compliance:C
Files:Library is rdd
See also:COPY STRUCTURE, COPY STRUCTURE EXTENDED, dbCreate(), dbStruct(), __dbCopyXStruct(), __dbCreate(), __dbStructFilter()
Back to index


__dbCopyXStruct

Lang:dbstrux.txt
Component:harbour
Doc. source:.\doc\en\dbstrux.txt
Template:Function
Category:API
Subcategory:Database
Oneliner:Copy current database structure into a definition file
Syntax:__dbCopyXStruct( <cFileName> ) --> lSuccess
Arguments:<cFileName> is the name of target definition file to create. (.dbf) is the default extension if none is given.
Returns:__dbCopyXStruct() returns .F. if no database is USED in the current work-area, .T. on success, or a run-time error if the file create operation had failed.
Description:__dbCopyXStruct() create a new database named <cFileName> with a pre-defined structure (also called "structure extended file"): <table> Field name Type Length Decimals FIELD_NAME C 10 0 FIELD_TYPE C 1 0 FIELD_LEN N 3 0 FIELD_DEC N 3 0 </table> Each record in the new file contains information about one field in the original file. CREATE FROM could be used to create a database from the structure extended file. For prehistoric compatibility reasons, Character fields which are longer than 255 characters are treated in a special way by writing part of the length in the FIELD_DEC according to the following formula (this is done internally): <fixed> FIELD->FIELD_DEC := Int( nLength / 256 ) FIELD->FIELD_LEN := ( nLength % 256 ) </fixed> Later if you want to calculate the length of a field you can use the following formula: <fixed> nLength := iif( FIELD->FIELD_TYPE == "C", ; FIELD->FIELD_DEC * 256 + FIELD->FIELD_LEN, ; FIELD->FIELD_LEN ) </fixed> COPY STRUCTURE EXTENDED command is preprocessed into __dbCopyXStruct() function during compile time.
Examples:// Open a database, then copy its structure to a new file, // Open the new file and list all its records USE Test __dbCopyXStruct( "TestStru" ) USE TestStru LIST
Status:R
Compliance:C
Files:Library is rdd
See also:COPY STRUCTURE, COPY STRUCTURE EXTENDED, CREATE, CREATE FROM, dbCreate(), dbStruct(), __dbCopyStruct(), __dbCreate()
Back to index


__dbCreate

Lang:dbstrux.txt
Component:harbour
Doc. source:.\doc\en\dbstrux.txt
Template:Function
Category:API
Subcategory:Database
Oneliner:Create structure extended file or use one to create new file
Syntax:__dbCreate( <cFileName>, [<cFileFrom>], [<cRDDName>], [<lNew>], [<cAlias>] ) --> lUsed
Arguments:<cFileName> is the target file name to create and then open. (.dbf) is the default extension if none is given. <cFileFrom> is an optional structure extended file name from which the target file <cFileName> is going to be built. If omitted, a new empty structure extended file with the name <cFileName> is created and opened in the current work-area. <cRDDName> is RDD name to create target with. If omitted, the default RDD is used. <lNew> is an optional logical expression, (.T.) opens the target file name <cFileName> in the next available unused work-area and makes it the current work-area. (.F.) opens the target file in the current work-area. Default value is (.F.). The value of <lNew> is ignored if <cFileFrom> is not specified. <cAlias> is an optional alias to USE the target file with. If not specified, alias is based on the root name of <cFileName>.
Returns:__dbCreate() returns (.T.) if there is database USED in the current work-area (this might be the newly selected work-area), or (.F.) if there is no database USED. Note that on success a (.T.) would be returned, but on failure you probably end up with a run-time error and not a (.F.) value.
Description:__dbCreate() works in two modes depending on the value of <cFileFrom>: <b>1)</b> If <cFileFrom> is empty or not specified a new empty structure extended file with the name <cFileName> is created and then opened in the current work-area (<lNew> is ignored). The new file has the following structure: <table> Field name Type Length Decimals FIELD_NAME C 10 0 FIELD_TYPE C 1 0 FIELD_LEN N 3 0 FIELD_DEC N 3 0 </table> The CREATE command is preprocessed into the __dbCopyStruct() function during compile time and uses this mode. <b>2)</b> If <cFileFrom> is specified, it is opened and assumed to be a structure extended file where each record contains at least the following fields (in no particular order): FIELD_NAME, FIELD_TYPE, FIELD_LEN and FIELD_DEC. Any other field is ignored. From this information the file <cFileName> is then created and opened in the current or new work-area (according to <lNew>), if this is a new work-area it becomes the current. For prehistoric compatibility reasons, structure extended file Character fields which are longer than 255 characters should be treated in a special way by writing part of the length in the FIELD_DEC according to the following formula: <fixed> FIELD->FIELD_DEC := Int( nLength / 256 ) FIELD->FIELD_LEN := ( nLength % 256 ) </fixed> CREATE FROM command is preprocessed into __dbCopyStruct() function during compile time and use this mode.
Examples:// CREATE a new structure extended file, append some records and // then CREATE FROM this file a new database file __dbCreate( "template" ) dbAppend() FIELD->FIELD_NAME := "CHANNEL" FIELD->FIELD_TYPE := "N" FIELD->FIELD_LEN := 2 FIELD->FIELD_DEC := 0 dbAppend() FIELD->FIELD_NAME := "PROGRAM" FIELD->FIELD_TYPE := "C" FIELD->FIELD_LEN := 20 FIELD->FIELD_DEC := 0 dbAppend() FIELD->FIELD_NAME := "REVIEW" FIELD->FIELD_TYPE := "C" // this field is 1000 char long FIELD->FIELD_LEN := 232 // 1000 % 256 = 232 FIELD->FIELD_DEC := 3 // 1000 / 256 = 3 dbCloseArea() __dbCreate( "TV_Guide", "template" )
Status:R
Compliance:C
Files:Library is rdd
See also:COPY STRUCTURE, COPY STRUCTURE EXTENDED, CREATE, CREATE FROM, dbCreate(), dbStruct(), __dbCopyStruct(), __dbCopyXStruct()
Back to index


__dbDelim

Lang:dbdelim.txt
Component:harbour
Doc. source:.\doc\en\dbdelim.txt
Template:Procedure
Category:API
Subcategory:Database
Oneliner:Copies the contents of a database to a delimited text file or appends the contents of a delimited text file to a database.
Syntax:__dbDelim( <lExport>, <xcFile>, [<xcDelim>], [<aFields>], [<bFor>], [<bWhile>], [<nNext>], [<nRecord>], <lRest> )
Arguments:<lExport> If set to .T., copies records to a delimited file. If set to .F., append records from a delimited file. <xcFile> The name of the text file to copy to or append from. If a file extension is not specified, ".txt" is used by default. <xcDelim> Either the character to use as the character field delimiter (only the first character is used). or "BLANK" (not case sensitive), which eliminates the character field delimiters and sets the field separator to a single space instead of a comma. <aFields> An aray of field names to limit the processint to. If not specified, or if empty, then all fields are processed. <bFor> An optional code block containing a FOR expression that will reduce the number of records to be processed. <bWhile> An optional code block containing a WHILE expression that will reduce the number of records to be processed. <nNext> If present, but nRecord is not present, specifies to process this number of records, starting with the current record. A value of 0 means to process no records. <nRecord> If present, specifies the only record to process. A value of 0 means to process no records. Overrides <nNext> and <lRest>. <lRest> If <lExport> is .T., then if <lRest> is set to .T. and there are no <nRecord>, <nNext>, or <bWhile> arguments, processes all records from current to last.
Returns:
Description:__dbDelim() copies all or selected contents of a database table to an SDF text file or appends all or selected contents of an SDF text file to a database table.
Examples:// Copy delinquent accounts into a delimited text file. USE ACCOUNTS NEW COPY TO overdue DELIMITED FOR ! Empty( accounts->duedate ) ; .AND. Date() - accounts->duedate > 30 // Import new customer records. USE CUSTOMER NEW APPEND FROM customer DELIMITED
Status:S
Compliance:C
Files:
See also:__dbSDF(), APPEND FROM, COPY TO
Back to index


__dbSDF

Lang:dbsdf.txt
Component:harbour
Doc. source:.\doc\en\dbsdf.txt
Template:Procedure
Category:API
Subcategory:Database
Oneliner:Copies the contents of a database to an SDF text file or appends the contents of an SDF text file to a database.
Syntax:__dbSDF( <lExport>, <xcFile>, [<aFields>], [<bFor>], [<bWhile>], [<nNext>], [<nRecord>], <lRest> )
Arguments:<lExport> If set to .T., copies records to an SDF file. If set to .F., append records from an SDF file. <xcFile> The name of the text file to copy to or append from. If a file extension is not specified, ".txt" is used by default. <aFields> An aray of field names to limit the processint to. If not specified, or if empty, then all fields are processed. <bFor> An optional code block containing a FOR expression that will reduce the number of records to be processed. <bWhile> An optional code block containing a WHILE expression that will reduce the number of records to be processed. <nNext> If present, but <nRecord> is not present, specifies to process this number of records, starting with the current record. A value of 0 means to process no records. <nRecord> If present, specifies the only record to process. A value of 0 means to process no records. Overrides <nNext> and <lRest>. <lRest> If <lExport> is .T., then if <lRest> is set to .T. and there are no <nRecord>, <nNext>, or <bWhile> arguments, processes all records from current to last.
Returns:
Description:__dbSDF() copies all or selected contents of a database table to an SDF text file or appends all or selected contents of an SDF text file to a database table.
Examples:// Copy delinquent accounts into an SDF text file. USE ACCOUNTS NEW COPY TO overdue SDF FOR ! Empty( accounts->duedate ) ; .AND. Date() - accounts->duedate > 30 // Import new customer records. USE CUSTOMER NEW APPEND FROM customer SDF
Status:S
Compliance:C
Files:
See also:__dbDelim(), APPEND FROM, COPY TO
Back to index


__dbStructFilter

Lang:dbstrux.txt
Component:harbour
Doc. source:.\doc\en\dbstrux.txt
Template:Function
Category:API
Subcategory:Database
Oneliner:Filter a database structure array
Syntax:__dbStructFilter( <aStruct>, [<aFieldList>] ) --> aStructFiltered
Arguments:<aStruct> is a multidimensional array with database fields structure, which is usually the output from dbStruct(), where each array element has the following structure: <table> Position Description dbstruct.ch 1 cFieldName DBS_NAME 2 cFieldType DBS_TYPE 3 nFieldLength DBS_LEN 4 nDecimals DBS_DEC </table> <aFieldList> is an array where each element is a field name. Names could be specified as uppercase or lowercase.
Returns:__dbStructFilter() return a new multidimensional array where each element is in the same structure as the original <aStruct>, but the array is built according to the list of fields in <aFieldList>. If <aFieldList> is empty, __dbStructFilter() return reference to the original <aStruct> array.
Description:__dbStructFilter() can be use to create a sub-set of a database structure, based on a given field list. Note that field names in <aStruct> MUST be specified in uppercase or else no match would be found. SET EXACT has no effect on the return value.
Examples:LOCAL aStruct, aList, aRet aStruct := { ; { "CODE", "N", 4, 0 }, ; { "NAME", "C", 10, 0 }, ; { "PHONE", "C", 13, 0 }, ; { "IQ", "N", 3, 0 } } aList := { "IQ", "NAME" } aRet := __dbStructFilter( aStruct, aList ) // { { "IQ", "N", 3, 0 }, { "NAME", "C", 10, 0 } } aRet := __dbStructFilter( aStruct, {} ) ? aRet == aStruct // .T. aList := { "iq", "NOTEXIST" } aRet := __dbStructFilter( aStruct, aList ) // { { "IQ", "N", 3, 0 } } aList := { "NOTEXIST" } aRet := __dbStructFilter( aStruct, aList ) // {} // Create a new file that contain part of the original structure LOCAL aStruct, aList, aRet USE TEST aStruct := dbStruct() aList := { "NAME" } dbCreate( "onlyname.dbf", __dbStructFilter( aStruct, aList ) )
Status:R
Compliance:__dbStructFilter() is a Harbour extension. CA-Cl*pper has an internal undocumented function named __FLedit() that does exactly the same thing. The new name gives a better description of what this function does.
Files:Header file is dbstruct.ch Library is rdd
See also:dbCreate(), dbStruct(), __dbCopyStruct(), __FLedit()*
Back to index


__FLedit*

Lang:dbstrux.txt
Component:harbour
Doc. source:.\doc\en\dbstrux.txt
Template:Function
Category:API
Subcategory:Database
Oneliner:Filter a database structure array
Syntax:__FLedit( <aStruct>, [<aFieldList>] ) --> aStructFiltered
Arguments:<aStruct> is a multidimensional array with database fields structure, which is usually the output from dbStruct(), where each array element has the following structure: <table> Position Description dbstruct.ch 1 cFieldName DBS_NAME 2 cFieldType DBS_TYPE 3 nFieldLength DBS_LEN 4 nDecimals DBS_DEC </table> <aFieldList> is an array where each element is a field name. Names could be specified as uppercase or lowercase.
Returns:__FLedit() return a new multidimensional array where each element is in the same structure as the original <aStruct>, but the array is built according to the list of fields in <aFieldList>. If <aFieldList> is empty, __FLedit() return reference to the original <aStruct> array.
Description:__FLedit() can be use to create a sub-set of a database structure, based on a given field list. Note that field names in <aStruct> MUST be specified in uppercase or else no match would found. SET EXACT has no effect on the return value. __FLedit() is a compatibility function and it is synonym for __dbStructFilter() which does exactly the same.
Examples:LOCAL aStruct, aList, aRet aStruct := { ; { "CODE", "N", 4, 0 }, ; { "NAME", "C", 10, 0 }, ; { "PHONE", "C", 13, 0 }, ; { "IQ", "N", 3, 0 } } aList := { "IQ", "NAME" } aRet := __FLedit( aStruct, aList ) // { { "IQ", "N", 3, 0 }, { "NAME", "C", 10, 0 } } aRet := __FLedit( aStruct, {} ) ? aRet == aStruct // .T. aList := { "iq", "NOTEXIST" } aRet := __FLedit( aStruct, aList ) // { { "IQ", "N", 3, 0 } } aList := { "NOTEXIST" } aRet := __FLedit( aStruct, aList ) // {} // Create a new file that contain part of the original structure LOCAL aStruct, aList, aRet USE TEST aStruct := dbStruct() aList := { "NAME" } dbCreate( "onlyname.dbf", __FLedit( aStruct, aList ) )
Status:R
Compliance:CA-Cl*pper has internal undocumented function named __FLedit(), in Harbour we name it __dbStructFilter(). The new name gives a better description of what this function does. In Harbour __FLedit() simply calls __dbStructFilter() and therefor the latter is the recommended function to use. This function is only visible if src/rdd/dbstrux.prg was compiled with the HB_CLP_UNDOC flag.
Files:Header file is dbstruct.ch Library is rdd
See also:dbCreate(), dbStruct(), __dbCopyStruct(), __dbStructFilter()
Back to index


CDoW

Lang:datetime.txt
Component:harbour
Doc. source:.\doc\en\datetime.txt
Template:Function
Category:API
Subcategory:Date/Time
Oneliner:Converts a date to the day of week
Syntax:CDoW( <dDate> ) --> cDay
Arguments:<dDate> Any date expression.
Returns:<cDay> The current day of week.
Description:This function returns a character string of the day of the week, from a date expression <dDate> passed to it. If a NULL date is passed to the function, the value of the function will be a NULL byte.
Examples:? CDoW( Date() ) IF CDoW( Date() + 10 ) == "Sunday" ? "This is a sunny day." ENDIF
Status:R
Compliance:C
Files:Library is core
See also:Day(), DoW(), Date(), CMonth()
Back to index


CMonth

Lang:datetime.txt
Component:harbour
Doc. source:.\doc\en\datetime.txt
Template:Function
Category:API
Subcategory:Date/Time
Oneliner:Return the name of the month.
Syntax:CMonth( <dDate> ) --> cMonth
Arguments:<dDate> Any date expression.
Returns:<cMonth> The current month name
Description:This function returns the name of the month (January, February, etc.) from a date expression <dDate> passed to it. If a NULL date is passed to the function, the value of the function will be a NULL byte.
Examples:? CMonth( Date() ) IF CMonth( Date() + 10 ) == "March" ? "Have you done your system BACKUP?" ENDIF
Status:R
Compliance:C
Files:Library is core
See also:CDoW(), Date(), Month(), Year(), DoW(), DToC()
Back to index


CToD

Lang:datetime.txt
Component:harbour
Doc. source:.\doc\en\datetime.txt
Template:Function
Category:API
Subcategory:Date/Time
Oneliner:Converts a character string to a date expression
Syntax:CToD( <cDateString> ) --> dDate
Arguments:<cDateString> A character date in format "mm/dd/yy"
Returns:<dDate> A date expression
Description:This function converts a date that has been entered as a character expression to a date expression. The character expression will be in the form "MM/DD/YY" (based on the default value in SET DATE) or in the appropriate format specified by the SET DATE TO command. If an improper character string is passed to the function, an empty date value will be returned.
Examples:Set( _SET_DATEFORMAT, "yyyy-mm-dd" ) ? CToD( "2000-12-21" )
Status:R
Compliance:C
Files:Library is core
See also:SET DATE, Date(), DToS()
Back to index


Date

Lang:datetime.txt
Component:harbour
Doc. source:.\doc\en\datetime.txt
Template:Function
Category:API
Subcategory:Date/Time
Oneliner:Return the Current OS Date
Syntax:Date() --> dCurDate
Arguments:None
Returns:<dCurDate> Current system date.
Description:This function returns the current system date.
Examples:? Date() ? "Today is ", Day( Date() ), " of ", CMonth( Date() ), " of ", Year( Date() )
Status:R
Compliance:C
Files:Library is core
See also:CToD(), DToS(), DToC(), Day(), Month(), CMonth()
Back to index


Day

Lang:datetime.txt
Component:harbour
Doc. source:.\doc\en\datetime.txt
Template:Function
Category:API
Subcategory:Date/Time
Oneliner:Return the numeric day of the month.
Syntax:Day( <cDate> ) --> nMonth
Arguments:<cDate> Any valid date expression.
Returns:<nMonth> Numeric value of the day of month.
Description:This function returns the numeric value of the day of month from a date.
Examples:? Day( Date() ) ? Day( Date() + 6325 )
Status:R
Compliance:C
Files:Library is core
See also:CToD(), DToS(), DToC(), Date(), Month(), CMonth()
Back to index


Days

Lang:datetime.txt
Component:harbour
Doc. source:.\doc\en\datetime.txt
Template:Function
Category:API
Subcategory:Date/Time
Oneliner:Convert elapsed seconds into days
Syntax:Days( <nSecs> ) --> nDay
Arguments:<nSecs> The number of seconds
Returns:<nDay> The number of days
Description:This function converts <nSecs> seconds to the equivalent number of days; 86399 seconds represents one day, 0 seconds being midnight.
Examples:? Days( 2434234 ) ? "Has been passed", Days( 63251 ), "since midnight"
Status:R
Compliance:C
Files:Library is core
See also:Seconds(), Secs(), ElapTime()
Back to index


DoW

Lang:datetime.txt
Component:harbour
Doc. source:.\doc\en\datetime.txt
Template:Function
Category:API
Subcategory:Date/Time
Oneliner:Value for the day of week.
Syntax:DoW( <dDate> ) --> nDay
Arguments:<dDate> Any valid date expression
Returns:<nDay> The current day number
Description:This function returns the number representing the day of the week for the date expressed as <dDate>.
Examples:? DoW( Date() ) ? DoW( Date() - 6584 )
Status:R
Compliance:C
Files:Library is core
See also:DToC(), CDoW(), Date(), DToS(), Day()
Back to index


DToC

Lang:datetime.txt
Component:harbour
Doc. source:.\doc\en\datetime.txt
Template:Function
Category:API
Subcategory:Date/Time
Oneliner:Date to character conversion
Syntax:DToC( <dDateString> ) --> cDate
Arguments:<dDateString> Any date
Returns:<dDate> Character represention of date
Description:This function converts any date expression (a field or variable) expressed as <dDateString> to a character expression in the default format "MM/DD/YY". The date format expressed by this function is controled in part by the date format specified in the SET DATE command
Examples:? DToC( Date() )
Status:R
Compliance:C
Files:Library is core
See also:SET DATE, Date(), DToS()
Back to index


DToS

Lang:datetime.txt
Component:harbour
Doc. source:.\doc\en\datetime.txt
Template:Function
Category:API
Subcategory:Date/Time
Oneliner:Date to string conversion
Syntax:DToS( <dDateString> ) --> cDate
Arguments:<dDateString> Any date
Returns:<dDate> String notation of the date
Description:This function returns the value of <dDateString> as a character string in the format of YYYYMMDD. If the value of <dDateString> is an empty date, this function will return eight blank spaces.
Examples:? DToS( Date() )
Status:R
Compliance:C
Files:Library is core
See also:DToC(), Date(), DToS()
Back to index


ElapTime

Lang:datetime.txt
Component:harbour
Doc. source:.\doc\en\datetime.txt
Template:Function
Category:API
Subcategory:Date/Time
Oneliner:Calculates elapted time.
Syntax:ElapTime( <cStartTime>, <cEndTime> ) --> cDiference
Arguments:<cStartTime> Start in time as a string format <cEndTime> End time as a string format
Returns:<cDiference> Difference between the times
Description:This function returns a string that shows the difference between the starting time represented as <cStartTime> and the ending time as <cEndTime>. If the stating time is greater then the ending time, the function will assume that the date changed once.
Examples:STATIC s_cStartTime INIT PROCEDURE Startup() s_cStartTime := Time() RETURN EXIT PROCEDURE StartExit() ? "You used this program by", ElapTime( s_cStartTime, Time() ) RETURN
Status:R
Compliance:C
Files:Library is core
See also:Secs(), Seconds(), Time(), Day()
Back to index


Month

Lang:datetime.txt
Component:harbour
Doc. source:.\doc\en\datetime.txt
Template:Function
Category:API
Subcategory:Date/Time
Oneliner:Converts a date expression to a month value
Syntax:Month( <dDate> ) --> nMonth
Arguments:<dDate> Any valid date expression
Returns:<nMonth> Corresponding number of the month in the year, ranging from 0 to 12
Description:This function returns a number that represents the month of a given date expression <dDate>. If a NULL date (CToD( "" )) is passed to the function, the value of the function will be 0.
Examples:? Month( Date() )
Status:R
Compliance:C
Files:Library is core
See also:CDoW(), DoW(), Year(), CMonth()
Back to index


Seconds

Lang:datetime.txt
Component:harbour
Doc. source:.\doc\en\datetime.txt
Template:Function
Category:API
Subcategory:Date/Time
Oneliner:Returns the number of elapsed seconds past midnight.
Syntax:Seconds() --> nSeconds
Arguments:None
Returns:<nSeconds> Number of seconds since midnight
Description:This function returns a numeric value representing the number of elapsed seconds based on the current system time. The system time is considered to start at 0 (midnight); it continues up to 86399 seconds. The value of the return expression is displayed in both seconds and hundredths of seconds.
Examples:? Seconds()
Status:R
Compliance:C
Files:Library is core
See also:Time()
Back to index


Secs

Lang:datetime.txt
Component:harbour
Doc. source:.\doc\en\datetime.txt
Template:Function
Category:API
Subcategory:Date/Time
Oneliner:Return the number of seconds from the system date.
Syntax:Secs( <cTime> ) --> nSeconds
Arguments:<cTime> Character expression in a time string format
Returns:<nSeconds> Number of seconds
Description:This function returns a numeric value that is a number of elapsed seconds from midnight based on a time string given as <cTime>.
Examples:? Secs( Time() ) ? Secs( Time() - 10 )
Status:R
Compliance:C
Files:Library is core
See also:Seconds(), ElapTime(), Time()
Back to index


Time

Lang:datetime.txt
Component:harbour
Doc. source:.\doc\en\datetime.txt
Template:Function
Category:API
Subcategory:Date/Time
Oneliner:Returns the system time as a string
Syntax:Time() --> cTime
Arguments:None
Returns:<cTime> Character string representing time
Description:This function returns the system time represented as a character expression in the format of HH:MM:SS
Examples:? Time()
Status:R
Compliance:C
Files:Library is core
See also:Date(), Seconds()
Back to index


Year

Lang:datetime.txt
Component:harbour
Doc. source:.\doc\en\datetime.txt
Template:Function
Category:API
Subcategory:Date/Time
Oneliner:Converts the year portion of a date into a numeric value
Syntax:Year( <cDate> ) --> nYear
Arguments:<dDate> Any valid date expression
Returns:<nYear> The year portion of the date.
Description:This function returns the numeric value for the year in <dDate>. This value will always be a four-digit number and is not affected by the setting of the SET CENTURY and SET DATE commands. Addition ally, an empty date expression passed to this function will yield a zero value.
Examples:? Year( Date() ) ? Year( hb_SToD( "32510125" ) )
Status:R
Compliance:C
Files:Library is core
See also:Day(), Month()
Back to index


GetE

Lang:misc.txt
Component:harbour
Doc. source:.\doc\en\misc.txt
Template:Function
Category:API
Subcategory:Environment
Oneliner:Obtains a system environmental setting.
Syntax:GetE( <cEnviroment> ) --> <cReturn>
Arguments:<cEnviroment> Enviromental variable to obtain.
Returns:<cReturn> Value of the Environment Variable.
Description:This function yields a string that is the value of the environment variable <cEnviroment>, which is stored at the system level. If no environment variable is found, an empty string is returned.
Examples:? GetE( "PATH" ) ? GetE( "CONFIG" ) ? GetE( "HARBOURCMD", "-n -l -es2" )
Status:R
Compliance:This is CA-Cl*pper compliant. The <cDefaultValue> parameter is a Harbour extension.
Files:Library is core
See also:GetEnv()
Back to index


GetEnv

Lang:misc.txt
Component:harbour
Doc. source:.\doc\en\misc.txt
Template:Function
Category:API
Subcategory:Environment
Oneliner:Obtains a system environmental setting.
Syntax:GetEnv( <cEnviroment> ) --> <cReturn>
Arguments:<cEnviroment> Enviromental variable to obtain.
Returns:<cReturn> Value of the Environment Variable.
Description:This function yields a string that is the value of the environment variable <cEnviroment>, which is stored at the system level. If no environment variable is found, an empty string is returned.
Examples:? GetEnv( "PATH" ) ? GetEnv( "CONFIG" ) ? GetEnv( "HARBOURCMD", "-n -l -es2" )
Status:R
Compliance:C
Files:Library is core
See also:GetE()
Back to index


hb_eol

Lang:terminal.txt
Component:harbour
Doc. source:.\doc\en\terminal.txt
Template:Function
Category:API
Subcategory:Environment
Oneliner:Returns the newline character(s) to use with the current OS
Syntax:hb_eol() --> cString
Arguments:
Returns:<cString> A character string containing the character or characters required to move the screen cursor or print head to the start of a new line.
Description:Returns a character string containing the character or characters required to move the screen cursor or print head to the start of a new line for the operating system that the program is running on (or thinks it is running on, if an OS emulator is being used). Under HB_OS_UNIX operating system the return value is the Line-Feed character (0x0a, Chr( 10 ) ); with other operating systems (like DOS) the return value is the Carriage-Return plus Line-Feed characters (0x0d 0x0a, Chr( 13 ) + Chr( 10 )).
Examples:// Get the newline character(s) for the current OS. OutStd( "Hello World!" + hb_eol() ) ? ValType( hb_eol() ) == "C" ? Len( hb_eol() ) <= 2
Status:R
Compliance:H
Files:Library is core
See also:OS(), OutStd(), OutErr()
Back to index


hb_GetEnv

Lang:misc.txt
Component:harbour
Doc. source:.\doc\en\misc.txt
Template:Function
Category:API
Subcategory:Environment
Oneliner:Obtains a system environmental setting.
Syntax:hb_GetEnv( <cEnviroment>, [<cDefaultValue>] ) --> <cReturn>
Arguments:<cEnviroment> Enviromental variable to obtain. <cDefaultValue> Optional value to return if <cEnvironment> is not found.
Returns:<cReturn> Value of the environment variable or <cDefaultValue> or an empty string.
Description:This function yields a string that is the value of the environment variable <cEnviroment>, which is stored at the system level. If no environment variable can be found, the value of the function will be <cDefaultValue> if it is passed, else an empty string.
Examples:? hb_GetEnv( "PATH" ) ? hb_GetEnv( "CONFIG" ) ? hb_GetEnv( "HARBOURCMD", "-n -l -es2" )
Status:R
Compliance:H
Files:Library is core
See also:GetEnv(), GetE()
Back to index


OS

Lang:misc.txt
Component:harbour
Doc. source:.\doc\en\misc.txt
Template:Function
Category:API
Subcategory:Environment
Oneliner:Return the current operating system.
Syntax:OS() --> <cOperatingSystem>
Arguments:
Returns:<cOperatinSystem> The current operating system.
Description:This function will return the current operating system.
Examples:? OS()
Status:R
Compliance:C
Files:
See also:
Back to index


RUN

Lang:misc.txt
Component:harbour
Doc. source:.\doc\en\misc.txt
Template:Command
Category:API
Subcategory:Environment
Oneliner:Run an external program.
Syntax:RUN <cCommand>
Arguments:<cCommand> Command to execute.
Returns:
Description:This command runs an external program. Please make sure that you have enough free memory to be able to run the external program. Do not use it to run Terminate and Stay Resident programs (in case of DOS) since that causes several problems.
Examples:RUN ( "edit " + cMyTextFile ) // Runs an external editor RUN command // Gives a OS shell
Status:R
Compliance:C
Files:Library is core
See also:RUN
Back to index


Set

Lang:set.txt
Component:harbour
Doc. source:.\doc\en\set.txt
Template:Function
Category:API
Subcategory:Environment
Oneliner:Changes or evaluated environmental settings
Syntax:Set( <nSet> [, <xNewSetting> [, <xOption> ] ] ) --> xPreviousSetting
Arguments:<nSet> Set Number <xNewSetting> Any expression to assign a value to the setting <xOption> Logical expression <nSet> <xNewSetting> <xOption> _SET_ALTERNATE <lFlag> | <cOnOff> If enabled, QOut() and QQOut() write to the screen and to a file, provided that a file has been opened or created with _SET_ALTFILE. If disabled, which is the default, QOut() and QQOut() only write to the screen (and/or to the PRINTFILE). Defaults to disabled. _SET_ALTFILE <cFileName> <lAdditive> When set, creates or opens file to write QOut() and QQOut() output to. If <lAdditive> is TRUE and the file already exists, the file is opened and positioned at end of file. Otherwise, the file is created. If a file is already opened, it is closed before the new file is opened or created (even if it is the same file). The default file extension is ".txt". There is no default file name. Call with an empty string to close the file. _SET_AUTOPEN <lFlag> | <cOnOff> TODO: Document _SET_AUTORDER <lFlag> | <cOnOff> TODO: Document _SET_AUTOSHARE <lFlag> | <cOnOff> TODO: Document _SET_BELL <lFlag> | <cOnOff> When enabled, the bell sounds when the last position of a GET is reached and/or when a GET validation fails. Disabled by default. _SET_CANCEL <lFlag> | <cOnOff> When enabled, which is the default, pressing Alt+C or Ctrl+Break terminates the program. When disabled, both keystrokes can be read by Inkey(). Note: SET KEY has precedence over SET CANCEL. _SET_COLOR <cColorSet> Sets the current color scheme, using color pairs in the sequence "<standard>, <enhanced>, <border>, <background>, <unselected>". Each color pair uses the format "<foreground>/<background>". The color codes are space or "N" for black, "B" for blue, "G" for green, "BG" for Cyan, "R" for red, "RB" for magenta, "GR" for brown, "W" for white, "N+" for gray, "B+" for bright blue, "G+" for bright green, "BG+" for bright cyan, "R+" for bright red, "RB+" for bright magenta, "GR+" for yellow, and "W+" for bright white. Special codes are "I" for inverse video, "U" for underline on a monochrome monitor (blue on a color monitor), and "X" for blank. The default color is "W/N,N/W,N,N,N/W". _SET_CONFIRM <lFlag> | <cOnOff> If enabled, an exit key must be pressed to leave a GET. If disabled, which is the default, typing past the end will leave a GET. _SET_CONSOLE <lFlag> | <cOnOff> If enabled, which is the default, all screen output goes to the screen. When disabled, screen output is suppressed (Note: This setting does not affect OutStd() or OutErr()). _SET_CURSOR <nCursorType> If enabled, which is the default, the cursor is displayed on screen. If disabled, the screen cursor is hidden. _SET_DATEFORMAT <cDateFormat> Sets the default date format for display, date input, and date conversion. Defaults to American ("mm/dd/yy"). Other formats include ANSI ("yy.mm.dd"), British ("dd/mm/yy"), French ("dd/mm/yy"), German ("dd.mm.yy"), Italian ("dd-mm-yy"), Japan ("yy/mm/dd"), and USA ("mm-dd-yy"). SET CENTURY modifies the date format. SET CENTURY ON replaces the "y"s with "YYYY". SET CENTURY OFF replaces the "y"s with "YY". _SET_DEBUG <lStatus> When set to .T., pressing Alt+D activates the debugger. When set to .F., which is the default, Alt+D can be read by Inkey(). (Also affected by AltD(1) and AltD(0)) _SET_DECIMALS <nNumberOfDecimals> Sets the number of decimal digits to use when displaying printing numeric values when SET FIXED is ON. Defaults to 2. If SET FIXED is OFF, then SET DECIMALS is only used to determine the number of decimal digits to use after using Exp(), Log(), Sqrt(), or division. Other math operations may adjust the number of decimal digits that the result will display. Note: This never affects the precision of a number. Only the display format is affected. _SET_DEFAULT <cDefaultDirectory> Sets the default directory in which to open, create and check for files. Defaults to current directory (blank). _SET_DELETED <lFlag> | <cOnOff> If enabled, deleted records will be processed. If disabled, which is the default, deleted records will be ignored. _SET_DELIMCHARS <cDelimiters> Sets the GET delimiter characters. Defaults to "::". _SET_DELIMITERS <lFlag> | <cOnOff> If enabled, GETs are delimited on screen. If disabled, which is the default, no GET delimiters are used. _SET_DEVICE <cDeviceName> Selects the output device for DevOut(). When set to "PRINTER", all output is sent to the printer device or file set by _SET_PRINTFILE. When set to anything else, all output is sent to the screen. Defaults to "SCREEN". _SET_EOF <lFlag> | <cOnOff> Defaults to FALSE on UN*X, but defaults to TRUE on everything else. If set to FALSE, then Chr( 26 ) does not get written when using COPY TO DELIMITED, COPY TO SDF, or when closing any of the various text files that are created using various SET values. [This is a Harbour extension] _SET_EPOCH <nYear> Determines how to handle the conversion of 2-digit years to 4 digit years. When a 2-digit year is greater than or equal to the year part of the epoch, the century part of the epoch is added to the year. When a 2-digit year is less than the year part of the epoch, the century part of the epoch is incremented and added to the year. The default epoch is 1900, which converts all 2-digit years to 19xx. Example: If the epoch is set to 1950, 2-digit years in the range from 50 to 99 get converted to 19xx and 2-digit years in the range 00 to 49 get converted to 20xx. _SET_ESCAPE <lFlag> | <cOnOff> When enabled, which is the default, pressing Esc will exit a READ. When disabled, pressing Esc during a READ is ignored, unless the Esc key has been assigned to a function using SET KEY. _SET_EVENTMASK <nEventCodes> Determines which events Inkey() will respond to. INKEY_MOVE allows mouse movement events. INKEY_LDOWN allows the left mouse button down click. INKEY_LUP allows the left mouse button up click. INKEY_RDOWN allows the right mouse button down click. INKEY_RUP allows the right mouse button up clock. INKEY_KEYBOARD allows keyboard keystrokes. INKEY_ALL allows all of the preceding events. Events may be combined (e.g., using INKEY_LDOWN + INKEY_RUP will allow left mouse button down clicks and right mouse button up clicks). The default is INKEY_KEYBOARD. _SET_EXACT <lFlag> | <cOnOff> When enabled, all string comparisons other than "==" exclude trailing spaces when checking for equality. When disabled, which is the default, all string comparisons other than "==" treat two strings as equal if the right hand string is "" or if the right hand string is shorter than or the same length as the left hand string and all of the characters in the right hand string match the corresponding characters in the left hand string. _SET_EXCLUSIVE <lFlag> | <cOnOff> When enabled, which is the default, all database files are opened in exclusive mode. When disabled, all database files are opened in shared mode. Note: The EXCLUSIVE and SHARED clauses of the USE command can be used to override this setting. _SET_EXIT <lFlag> | <cOnOff> Toggles the use of Uparrow and Dnarrow as READ exit keys. Specifying true (.T.) enables them as exit keys, and false (.F.) disables them. Used internally by the ReadExit() function. _SET_EXTRA <lFlag> | <cOnOff> QUESTION: What is this for? It does not affect _SET_EXTRAFILE in CA-Cl*pper! _SET_EXTRAFILE <cFileName> <lAdditive> When set, creates or opens file to write QOut() and QQOut() output to. If <lAdditive> is TRUE and the file already exists, the file is opened and positioned at end of file. Otherwise, the file is created. If a file is already opened, it is closed before the new file is opened or created (even if it is the same file). The default file extension is ".prn". There is no default file name. Call with an empty string to close the file. _SET_FIXED <lFlag> | <cOnOff> When enabled, all numeric values will be displayed and printed with the number of decimal digits set by SET DECIMALS, unless a PICTURE clause is used. When disabled, which is the default, the number of decimal digits that are displayed depends upon a variety of factors. See _SET_DECIMALS for more. _SET_INSERT <lFlag> | <cOnOff> When enabled, characters typed in a GET or MEMOEDIT are inserted. When disabled, which is the default, characters typed in a GET or MEMOEDIT overwrite. Note: This setting can also be toggled between on and off by pressing the Insert key during a GET or MEMOEDIT. _SET_INTENSITY <lFlag> | <cOnOff> When enabled, which is the default, GETs and PROMPTs are displayed using the enhanced color setting. When disabled, GETs and PROMPTs are displayed using the standard color setting. _SET_LANGUAGE <cLanguageID> Specifies the language to be used for Harbour messages. [This is a Harbour extension] _SET_MARGIN <nColumns> Sets the left margin for all printed output. The default value is 0. Note: PCol() reflects the printer's column position including the margin (e.g., SET MARGIN TO 5 followed by DevPos(5, 10) makes PCol() return 15). _SET_MBLOCKSIZE <nMemoBlockSize> TODO: Document _SET_MCENTER <lFlag> | <cOnOff> If enabled, display PROMPTs centered on the MESSAGE row. If disabled, which is the default, display PROMPTS at column position 0 on the MESSAGE row. _SET_MESSAGE <nRow> If set to 0, which is the default, PROMPTs are always suppressed. Otherwise, PROMPTs are displayed on the set row. Note: It is not possible to display prompts on the top-most screen row, because row 0 is reserved for the SCOREBOARD, if enabled. _SET_MFILEEXT <cMemoFileExt> TODO: Document _SET_OPTIMIZE <lFlag> | <cOnOff> TODO: Document _SET_PATH <cDirectories> Specifies a path of directories to search through to locate a file that can't be located in the DEFAULT directory. Defaults to no path (""). Directories must be separated by a semicolon (e.g., "C:\data;C:\more"). _SET_PRINTER <lFlag> | <cOnOff> If enabled, QOut() and QQOut() write to the screen and to a file, provided that a file has been opened or created with _SET_ALTFILE. If disabled, which is the default, QOut() and QQOut() only write to the screen (and/or to the ALTFILE). _SET_PRINTFILE <cFileName> <lAdditive> When set, creates or opens file to write QOut(), QQOut() and DevOut() output to. If <lAdditive> is TRUE and the file already exists, the file is opened and positioned at end of file. Otherwise, the file is created. If a file is already opened, it is closed before the new file is opened or created (even if it is the same file). The default file extension is ".prn". The default file name is "PRN", which maps to the default printer device. Call with an empty string to close the file. _SET_SCOREBOARD <lFlag> | <cOnOff> When enabled, which is the default, READ and MEMOEDIT display status messages on screen row 0. When disabled, READ and MEMOEDIT status messages are suppressed. _SET_SCROLLBREAK <lFlag> | <cOnOff> QUESTION: What is this flag for? _SET_SOFTSEEK <lFlag> | <cOnOff> When enabled, a SEEK that fails will position the record pointer to the first key that is higher than the sought after key or to LastRec() + 1 if there is no higher key. When disabled, which is the default, a SEEK that fails will position the record pointer to LastRec()+1. _SET_STRICTREAD <lFlag> | <cOnOff> TODO: Document _SET_TYPEAHEAD <nKeyStrokes> Sets the size of the keyboard typeahead buffer. Defaults to 50. The minimum is 16 and the maximum is 4096. _SET_UNIQUE <lFlag> | <cOnOff> When enabled, indexes are not allowed to have duplicate keys. When disabled, indexes are allowed duplicate keys. _SET_VIDEOMODE <nValue> TODO: Document _SET_WRAP <lFlag> | <cOnOff> When enabled, lightbar menus can be navigated from the last position to the first and from the first position to the last. When disabled, which is the default, there is a hard stop at the first and last positions.
Returns:Set() The current or previous setting
Description:
Examples:
Status:
Compliance:C
Files:Library is core
See also:
Back to index


SetMode

Lang:setmode.txt
Component:harbour
Doc. source:.\doc\en\setmode.txt
Template:Function
Category:API
Subcategory:Environment
Oneliner:Change the video mode to a specified number of rows and columns
Syntax:SetMode( <nRows>, <nCols> ) --> lSuccess
Arguments:<nRows> is the number of rows for the video mode to set. <nCols> is the number of columns for the video mode to set.
Returns:SetMode() returns true if the video mode change was successful; otherwise, it returns false.
Description:SetMode() is a function that change the video mode depend on the video card and monitor combination, to match the number of rows and columns specified. Note that there are only a real few combination or rows/cols pairs that produce the video mode change. The followings are availables for GTDOS: <table> 12 rows x 40 columns 12 rows x 80 columns 25 rows x 40 columns 25 rows x 80 columns 28 rows x 40 columns 28 rows x 80 columns 50 rows x 40 columns 43 rows x 80 columns 50 rows x 80 columns </table> The follow modes are available to Windows <table> 25 rows x 40 columns 25 rows x 80 columns 50 rows x 40 columns 43 rows x 80 columns 50 rows x 80 columns </table> Some modes only are availables for color and/or VGA monitors. Any change produced on the screen size is updated in the values returned by MaxRow() and MaxCol().
Examples:// The first example change to a 12 lines of display mode: IF SetMode( 12, 40 ) ? "Hey man are you blind ?" ELSE ? "Mom bring me my glasses!" ENDIF // Next example change to a 50 lines mode: IF SetMode( 50, 80 ) ? "This wonderful mode was successfully set" ELSE ? "Wait. this monitor are not made in rubber !" ENDIF
Status:R
Compliance:Some of these modes are not availables in CA-Cl*pper
Files:
See also:MaxCol(), MaxRow()
Back to index


SetTypeahead

Lang:set.txt
Component:harbour
Doc. source:.\doc\en\set.txt
Template:Function
Category:API
Subcategory:Environment
Oneliner:Sets the typeahead buffer to given size.
Syntax:SetTypeahead( <nSize> ) --> <nPreviousSize>
Arguments:<nSize> is a valid typeahead size.
Returns:<nPreviousSize> The previous state of _SET_TYPEAHEAD
Description:This function sets the typeahead buffer to a valid given size as is Set( _SET_TYPEAHEAD ) where used.
Examples:// Sets typeahead to 12 SetTypeahead( 12 )
Status:R
Compliance:C
Files:Library is core
See also:__Accept(), __Input()
Back to index


Tone

Lang:misc.txt
Component:harbour
Doc. source:.\doc\en\misc.txt
Template:Function
Category:API
Subcategory:Environment
Oneliner:Sound a tone with a specified frequency and duration.
Syntax:Tone( <nFrequency>, <nDuration> ) --> NIL
Arguments:<nFrequency> A non-negative numeric value that specifies the frequency of the tone in hertz. <nDuration> A positive numeric value which specifies the duration of the tone in 1/18 of a second units.
Returns:Tone() always returns NIL.
Description:Tone() is a sound function that could be used to irritate the end user, his or her dog, and the surrounding neighborhood. The frequency is limited to the range 0 to 32767 Hz.
Examples:IF lOk // Good Sound Tone( 500, 1 ) Tone( 4000, 1 ) Tone( 2500, 1 ) ELSE // Bad Sound Tone( 300, 1 ) Tone( 499, 5 ) Tone( 700, 5 ) ENDIF // Tone( 800, 1 ) // same as ? Chr( 7 ) Tone( 32000, 200 ) // any dogs around yet? Tone( 130.80, 1 ) // musical note - C Tone( 400, 0 ) // short beep Tone( 700 ) // short beep Tone( 10, 18.2 ) // 1 second delay Tone( -1 ) // 1/18.2 second delay Tone() // 1/18.2 second delay
Status:S
Compliance:C
Files:Library is core
See also:Chr(), SET BELL
Back to index


Version

Lang:misc.txt
Component:harbour
Doc. source:.\doc\en\misc.txt
Template:Function
Category:API
Subcategory:Environment
Oneliner:Returns the HARBOUR Version or the Harbour/Compiler Version.
Syntax:Version() --> <cReturn>
Arguments:None
Returns:<cReturn> String containing the Harbour Version
Description:This function returns the current Harbour Version.
Examples:? Version() // "Harbour Terminal: Standard stream console"
Status:S
Compliance:C
Files:Library is core
See also:OS()
Back to index


__Run

Lang:misc.txt
Component:harbour
Doc. source:.\doc\en\misc.txt
Template:Procedure
Category:API
Subcategory:Environment
Oneliner:Run an external program.
Syntax:__Run( <cCommand> )
Arguments:<cCommand> Command to execute.
Returns:
Description:This command runs an external program. Ensure that you have enough free memory to be able to run the external program. Do not use it to run 'Terminate and Stay Resident' programs (in case of MS-DOS) since that causes several problems. Note: This function is what the RUN command preprocesses into. It is considered bad form to use this function directly. Use the RUN command instead.
Examples:__Run( "edit " + cMyTextFile ) // Runs an external editor __Run( "command" ) // Gives a OS shell
Status:R
Compliance:C
Files:Library is core
See also:RUN
Back to index


__SetCentury

Lang:set.txt
Component:harbour
Doc. source:.\doc\en\set.txt
Template:Function
Category:API
Subcategory:Environment
Oneliner:Set the Current Century
Syntax:__SetCentury([<lFlag> | <cOnOff> ] ) --> lPreviousValue
Arguments:optional <lFlag> or <cOnOff> (not case sensitive) .T. or "ON" to enable the century setting (4-digit years) .F. or "OFF" to disable the century setting (2-digit years)
Returns:Either the current or previous century setting as a logical value
Description:
Examples:
Status:
Compliance:C
Files:Library is core
See also:
Back to index


Break

Lang:hvm.txt
Component:harbour
Doc. source:.\doc\en\hvm.txt
Template:Procedure
Category:API
Subcategory:Error
Oneliner:Exits from a BEGIN SEQUENCE block
Syntax:Break( <xExp> )
Arguments:<xExp> is any valid expression. It is always required. If do not want to pass any argument, just use NIL.
Returns:
Description:This function passes control to the RECOVER statement in a BEGIN SEQUENCE block.
Examples:Break( NIL )
Status:R
Compliance:C
Files:Library is core
See also:BEGIN SEQUENCE
Back to index


ErrorSys

Lang:errsys.txt
Component:harbour
Doc. source:.\doc\en\errsys.txt
Template:Function
Category:API
Subcategory:Error
Oneliner:Install default error handler
Syntax:ErrorSys() --> NIL
Arguments:None.
Returns:ErrorSys() always return NIL.
Description:ErrorSys() is called upon startup by Harbour and installs the default error handler. Normally you should not call this function directly, instead use ErrorBlock() to install your own error handler.
Examples:
Status:R
Compliance:C
Files:Library is core
See also:ErrorBlock(), Error class
Back to index


hb_SetKeyCheck

Lang:set.txt
Component:harbour
Doc. source:.\doc\en\set.txt
Template:Function
Category:API
Subcategory:Events
Oneliner:Implements common hot-key activation code
Syntax:hb_SetKeyCheck( <nKey> [, <p1> ][, <p2> ][, <p3> ] )
Arguments:<nKey> is a numeric key value to be tested code-block, if executed <p1>..<p3> are optional parameters that will be passed to the code-block
Returns:True if there is a hot-key associated with <nKey> and it was executed; otherwise False If there is a hot-key association (before checking any condition): - if there is a condition-block, it is passed one parameter - <nKey> - when the hot-key code-block is called, it is passed 1 to 4 parameters, depending on the parameters passed to hb_SetKeyCheck(). Any parameters so passed are directly passed to the code-block, with an additional parameter being <nKey>
Description:hb_SetKeyCheck() is intended as a common interface to the SetKey() functionality for such functions as AChoice(), dbEdit(), MemoEdit(), ACCEPT, INPUT, READ, and WAIT
Examples:// within ReadModal() IF hb_SetKeyCheck( K_ALT_X, GetActive() ) ... // some other processing ENDIF // within TBrowse handler CASE hb_SetKeyCheck( nInkey, oTBrowse ) RETURN CASE nInKey == K_ESC ... // some other processing
Status:R
Compliance:H
Files:Library is core
See also:SetKey(), hb_SetKeySave()
Back to index


hb_SetKeyGet

Lang:set.txt
Component:harbour
Doc. source:.\doc\en\set.txt
Template:Function
Category:API
Subcategory:Events
Oneliner:Determine a set-key code block and condition-block
Syntax:hb_SetKeyGet( <nKey> [, <bConditionByRef> ] )
Arguments:<anKey> is an numeric key value <bConditionByRef> is an optional return-parameter
Returns:Current assigned action-block
Description:The hb_SetKeyGet() function returns the current code-block assigned to a key, and optionally assigns the condition-block to the return-parameter
Examples:LOCAL bOldF10, bOldF10Cond bOldF10 := hb_SetKeyGet( K_F10, @bOldF10Cond ) ... // some other processing SetKey( K_F10, bOldF10, bOldF10Cond )
Status:R
Compliance:H
Files:Library is core
See also:SetKey(), hb_SetKeySave(), hb_SetKeyCheck()
Back to index


hb_SetKeySave

Lang:set.txt
Component:harbour
Doc. source:.\doc\en\set.txt
Template:Function
Category:API
Subcategory:Events
Oneliner:Returns a copy of internal set-key list, optionally overwriting
Syntax:hb_SetKeySave( [ <OldKeys> ] )
Arguments:<OldKeys> is an optional set-key list from a previous call to hb_SetKeySave(), or NIL to clear current set-key list
Returns:Current set-key list
Description:hb_SetKeySave() is designed to act like the Set() function which returns the current state of an environment setting, and optionally assigning a new value. In this case, the "environment setting" is the internal set-key list, and the optional new value is either a value returned from a previous call to SetKeySave() - to restore that list, or the value of NIL to clear the current list.
Examples:LOCAL aKeys := hb_SetKeySave( NIL ) // removes all current set=keys ... // some other processing hb_SetKeySave( aKeys )
Status:R
Compliance:H
Files:Library is core
See also:SetKey()
Back to index


SetKey

Lang:set.txt
Component:harbour
Doc. source:.\doc\en\set.txt
Template:Function
Category:API
Subcategory:Events
Oneliner:Assign an action block to a key
Syntax:SetKey( <anKey> [, <bAction> [, <bCondition> ] ] )
Arguments:<anKey> is either a numeric key value, or an array of such values <bAction> is an optional code-block to be assigned <bCondition> is an optional condition code-block
Returns:Current assigned action-block
Description:The SetKey() function returns the current code-block assigned to a key when called with only the key value. If the action block (and optionally the condition block) are passed, the current block is returned, and the new code block and condition block are stored. A group of keys may be assigned the same code block/condition block by using an array of key values in place on the first parameter.
Examples:LOCAL bOldF10 := SetKey( K_F10, {|| Yahoo() } ) ... // some other processing SetKey( K_F10, bOldF10 ) ... // some other processing bBlock := SetKey( K_SPACE ) IF bBlock != NIL ... // make F10 exit current get, but only if in a get - ignores other // wait-states such as menus, achoices, etc... SetKey( K_F10, {|| GetActive():State := GE_WRITE },; {|| GetActive() != NIL } )
Status:R
Compliance:SetKey() is mostly CA-Cl*pper compliant. The only difference is the addition of the condition code-block parameter, allowing set-keys to be conditionally turned off or on. This condition-block cannot be returned once set - see SetKeyGet()
Files:Library is core
See also:hb_SetKeySave()
Back to index


__Quit

Lang:hvm.txt
Component:harbour
Doc. source:.\doc\en\hvm.txt
Template:Procedure
Category:API
Subcategory:Events
Oneliner:Terminates an application.
Syntax:__Quit()
Arguments:None
Returns:
Description:This function terminates the current application and returns to the system.
Examples:PROCEDURE EndApp( lYesNo ) IF lYesNo __Quit() ENDIF RETURN
Status:R
Compliance:C
Files:Library is core
See also:QUIT
Back to index


__SetFunction

Lang:set.txt
Component:harbour
Doc. source:.\doc\en\set.txt
Template:Function
Category:API
Subcategory:Events
Oneliner:Assign a character string to a function key
Syntax:__SetFunction( <nFunctionKey>, [<cString>] ) --> NIL
Arguments:<nFunctionKey> is a number in the range 1..40 that represent the function key to be assigned. <cString> is a character string to set. If <cString> is not specified, the function key is going to be set to NIL releasing by that any previous __SetFunction() or SetKey() for that function.
Returns:__SetFunction() always return NIL.
Description:__SetFunction() assign a character string with a function key, when this function key is pressed, the keyboard is stuffed with this character string. __SetFunction() has the effect of clearing any SetKey() previously set to the same function number and vice versa. <table> nFunctionKey Key to be set 1 .. 12 F1 .. F12 13 .. 20 Shift-F3 .. Shift-F10 21 .. 30 Ctrl-F1 .. Ctrl-F10 31 .. 40 Alt-F1 .. Alt-F10 </table> SET FUNCTION command is preprocessed into __SetFunction() function during compile time.
Examples:// Set F1 with a string CLS __SetFunction( 1, "I Am Lazy" + Chr( 13 ) ) cTest := Space( 20 ) @ 10, 0 SAY "type something or F1 for lazy mode " GET cTest READ ? cTest
Status:R
Compliance:Harbour use 11 and 12 to represent F11 and F12, while CA-Cl*pper use 11 and 12 to represent Shift-F1 and Shift-F2.
Files:Library is core
See also:Inkey(), SetKey(), __Keyboard(), SET KEY
Back to index


__Wait

Lang:terminal.txt
Component:harbour
Doc. source:.\doc\en\terminal.txt
Template:Function
Category:API
Subcategory:Events
Oneliner:Stops the application until a key is pressed.
Syntax:__Wait( <cMessage> ) --> <cKey>
Arguments:<cMessage> is a string.
Returns:Pressed key.
Description:This function stops the application until a key is pressed. The key must be in the range 32..255. Control keys are not processed.
Examples:// Wait for a key stroke __Wait( "Press a key to continue" ) // DO WHILE !( cKey == "Q" ) cKey := __Wait( "Press 'Q' to continue" ) ENDDO
Status:R
Compliance:C
Files:Library is core
See also:__Accept(), __Input()
Back to index


dbEval

Lang:rdddb.txt
Component:harbour
Doc. source:.\doc\en\rdddb.txt
Template:Function
Category:API
Subcategory:Execute and Execution
Oneliner:Performs a code block operation on the current Database
Syntax:dbEval( <bBlock>, [<bFor>], [<bWhile>], [<nNext>], [<nRecord>], [<lRest>] ) --> NIL
Arguments:<bBlock> Operation that is to be performed <bFor> Code block for the For condition <bWhile> Code block for the WHILE condition <nNext> Number of NEXT records to process <nRecord> Record number to work on exactly <lRest> Toggle to rewind record pointer
Returns:dbEval() always returns NIL
Description:Performs a code block operation on the current Database
Examples:PROCEDURE Main() LOCAL nCount USE test dbGoto( 4 ) ? RecNo() COUNT TO nCount ? RecNo(), nCount COUNT TO nCount NEXT 10 ? RecNo(), nCount RETURN
Status:S
Compliance:C
Files:Library is rdd
See also:Eval()
Back to index


Eval

Lang:eval.txt
Component:harbour
Doc. source:.\doc\en\eval.txt
Template:Function
Category:API
Subcategory:Execute and Execution
Oneliner:Evaluate a code block
Syntax:Eval( <bBlock> [, <xVal> [,...] ] ) --> xExpression
Arguments:<bBlock> Code block expression to be evaluated <xVal> Argument to be passed to the code block expression <xVal...> Argument list to be passed to the code block expression
Returns:<xExpression> The result of the evaluated code block
Description:This function evaluates the code bloc expressed as <bBlock> and returns its evaluated value. If their are multiple expressions within the code block, the last expression will be value of this function. If the code block requires parameters to be passed to it, they are specified in the parameter list <xVal> and following. Each parameter is separated by a comma within the expression list.
Examples:PROCEDURE Main() LOCAL bBlock := {|| NIL } ? Eval( 1 ) ? Eval( @bBlock ) ? Eval( {| p1 | p1 }, "A", "B" ) ? Eval( {| p1, p2 | p1 + p2 }, "A", "B" ) ? Eval( {| p1, p2, p3 | p1 }, "A", "B" ) RETURN
Status:R
Compliance:C
Files:Library is core
See also:AEval(), dbEval()
Back to index


ADir

Lang:dir.txt
Component:harbour
Doc. source:.\doc\en\dir.txt
Template:Function
Category:API
Subcategory:FileSys
Oneliner:Fill pre-defined arrays with file/directory information
Syntax:ADir( [<cFileMask>], [<aName>], [<aSize>], [<aDate>], [<aTime>], [<aAttr>] ) --> nDirEnries
Arguments:<cFileMask> File mask to include in the function return. It could contain path and standard wildcard characters as supported by your OS (like * and ?). If you omit <cFileMask> or if <cFileMask> contains no path, then the path from SET DEFAULT is used. <aName> Array to fill with file name of files that meet <cFileMask>. Each element is a Character string and include the file name and extension without the path. The name is the long file name as reported by the OS and not necessarily the 8.3 uppercase name. <aSize> Array to fill with file size of files that meet <cFileMask>. Each element is a Numeric integer for the file size in Bytes. Directories are always zero in size. <aDate> Array to fill with file last modification date of files that meet <cFileMask>. Each element is of type Date. <aTime> Array to fill with file last modification time of files that meet <cFileMask>. Each element is a Character string in the format HH:mm:ss. <aAttr> Array to fill with attribute of files that meet <cFileMask>. Each element is a Character string, see Directory() for information about attribute values. If you pass array to <aAttr>, the function is going to return files with normal, hidden, system and directory attributes. If <aAttr> is not specified or with type other than Array, only files with normal attribute would return.
Returns:ADir() return the number of file entries that meet <cFileMask>
Description:ADir() return the number of files and/or directories that match a specified skeleton, it also fill a series of given arrays with the name, size, date, time and attribute of those files. The passed arrays should pre-initialized to the proper size, see example below. In order to include hidden, system or directories <aAttr> must be specified. ADir() is a compatibility function, it is superseded by Directory() which returns all the information in a multidimensional array.
Examples:LOCAL aName, aSize, aDate, aTime, aAttr, nLen, i nLen := ADir( "*.jpg" ) // Number of JPG files in this directory IF nLen > 0 aName := Array( nLen ) // make room to store the information aSize := Array( nLen ) aDate := Array( nLen ) aTime := Array( nLen ) aAttr := Array( nLen ) ADir( "*.prg", aName, aSize, aDate, aTime, aAttr ) FOR i := 1 TO nLen ? aName[ i ], aSize[ i ], aDate[ i ], aTime[ i ], aAttr[ i ] NEXT ELSE ? "This directory is clean from smut" ENDIF
Status:R
Compliance:<aName> is going to be filled with long file name and not necessarily the 8.3 uppercase name.
Files:Library is core
See also:Array(), Directory(), SET DEFAULT
Back to index


CurDir

Lang:file.txt
Component:harbour
Doc. source:.\doc\en\file.txt
Template:Function
Category:API
Subcategory:FileSys
Oneliner:Returns the current OS directory name.
Syntax:CurDir( [<cDrive>] ) --> cPath
Arguments:<cDrive> OS drive letter
Returns:<cPath> Name of directory
Description:This function yields the name of the current OS directory on a specified drive. If <cDrive> is not specified, the currently logged drive will be used. This function should not return the leading and trailing (back)slashes. If an error has been detected by the function, or the current OS directory is the root, the value of the function will be a NULL byte.
Examples:? CurDir()
Status:R
Compliance:C
Files:Library is core
See also:File()
Back to index


DirChange

Lang:file.txt
Component:harbour
Doc. source:.\doc\en\file.txt
Template:Function
Category:API
Subcategory:FileSys
Oneliner:Changes the directory
Syntax:DirChange( <cDirectory> ) --> nError
Arguments:<cDirectory> The name of the directory you want do change into.
Returns:<nError> 0 if directory was successfully changed, otherwise the number of the last error.
Description:This function attempt to change the current directory to the one specified in <cDirectory>. If this function fails, it will return the last OS error code number. See FError() function for the description of the error.
Examples:IF DirChange( "\temp" ) == 0 ? "Change to diretory was successfull" ENDIF
Status:R
Compliance:This function is CA-Cl*pper 5.3 compliant
Files:Library is core
See also:MakeDir(), DirRemove(), IsDisk(), DiskChange(), DiskName(), FError()
Back to index


DirRemove

Lang:file.txt
Component:harbour
Doc. source:.\doc\en\file.txt
Template:Function
Category:API
Subcategory:FileSys
Oneliner:Attempt to remove an directory
Syntax:DirRemove( <cDirectory> ) --> nError
Arguments:<cDirectory> The name of the directory you want to remove.
Returns:<nError> 0 if directory was successfully removed, otherwise the number of the last error.
Description:This function attempt to remove the specified directory in <cDirectory> If this function fails, it will return the last OS error code number. See FError() function for the description of the error.
Examples:cDir := ".\backup" IF DirRemove( cDir ) == 0 ? "Remove of directory", cDir, "was successfull" ENDIF
Status:R
Compliance:This function is CA-Cl*pper 5.3 compliant
Files:Library is core
See also:MakeDir(), DirChange(), IsDisk(), DiskChange(), DiskName(), FError()
Back to index


DiskSpace

Lang:diskspac.txt
Component:harbour
Doc. source:.\doc\en\diskspac.txt
Template:Function
Category:API
Subcategory:FileSys
Oneliner:Get the amount of space available on a disk
Syntax:DiskSpace( [<nDrive>] ) --> nDiskbytes
Arguments:<nDrive> The number of the drive you are requesting info on where 1 = A, 2 = B, etc. For 0 or no parameter, DiskSpace will operate on the current drive. The default is 0
Returns:<nDiskBytes> The number of bytes on the requested disk that match the requested type.
Description:By default, this function will return the number of bytes of free space on the current drive that is available to the user requesting the information. If information is requested on a disk that is not available, a runtime error 2018 will be raised.
Examples:? "You can use : " + hb_ntos( DiskSpace() ) + " bytes " // NOTE: See tests/diskspac.prg for another example
Status:R
Compliance:C
Files:Library is core Header is fileio.ch
See also:
Back to index


FClose

Lang:file.txt
Component:harbour
Doc. source:.\doc\en\file.txt
Template:Function
Category:API
Subcategory:FileSys
Oneliner:Closes an open file
Syntax:FClose( <nHandle> ) --> <lSuccess>
Arguments:<nHandle> File handle
Returns:<lSuccess> Logical TRUE (.T.) or FALSE (.F.)
Description:This function closes an open file with a file handle of <nHandle> and writes the associated buffers to the disk. The <nHandle> value is derived from the FCreate() or FOpen() function.
Examples:#include "fileio.ch" nHandle := FOpen( "test.txt" ) ? FSeek( nHandle, 0, FS_END ) FClose( nHandle )
Status:R
Compliance:C
Files:Library is core
See also:FOpen(), FCreate(), FRead(), FWrite(), FError()
Back to index


FCreate

Lang:file.txt
Component:harbour
Doc. source:.\doc\en\file.txt
Template:Function
Category:API
Subcategory:FileSys
Oneliner:Creates a file.
Syntax:FCreate( <cFile>, [<nAttribute>] ) --> nHandle
Arguments:<cFile> is the name of the file to create. <nAttribute> Numeric code for the file attributes.
Returns:<nHandle> Numeric file handle to be used in other operations.
Description:This function creates a new file with a filename of <cFile>. The default value of <nAttribute> is 0 and is used to set the attribute byte for the file being created by this function. The return value will be a file handle that is associated with the new file. This number will be between zero to 65535, inclusive. If an error occurs, the return value of this function will be F_ERROR. If the file <cFile> already exists, the existing file will be truncated to a file length of 0 bytes. If specified, the following table shows the value for <nAttribute> and their related meaning to the file <cFile> being created by this function. <table> <nAttribute> Meaning FC_NORMAL Normal/Default, Read/Write FC_READONLY Read-only file attribute is set FC_HIDDEN Hidden, Excluded from normal DIR search FC_SYSTEM Create, Excluded from normal DIR search </table>
Examples:#include "fileio.ch" IF ( nh := FCreate( "test.txt" ) ) == F_ERROR ? "Cannot create file" ENDIF
Status:R
Compliance:C
Files:Library is core Header is fileio.ch
See also:FClose(), FOpen(), FWrite(), FRead(), FError()
Back to index


FErase

Lang:file.txt
Component:harbour
Doc. source:.\doc\en\file.txt
Template:Function
Category:API
Subcategory:FileSys
Oneliner:Erase a file from disk
Syntax:FErase( <cFile> ) --> nSuccess
Arguments:<cFile> Name of file to erase.
Returns:<nSuccess> 0 if successful, -1 if not
Description:This function deletes the file specified in <cFile> from the disk. No extensions are assumed. The drive and path my be included in <cFile>; neither the SET DEFAULT not the SET PATH command controls the performance of this function. If the drive or path is not used, the function will look for the file only on the currently selected directory on the logged drive. If the function is able to successfully delete the file from the disk, the value of the function will be 0; otherwise a -1 will be returned. If not successfull, additional information may be obtained by calling the FError() function. Note: Any file to be removed by FErase() must still be closed.
Examples:#include "fileio.ch" IF FErase( "test.txt" ) == 0 ? "File successfully erased" ELSE ? "File can not be deleted" ENDIF
Status:R
Compliance:C
Files:Library is core
See also:FError(), FRename()
Back to index


FError

Lang:file.txt
Component:harbour
Doc. source:.\doc\en\file.txt
Template:Function
Category:API
Subcategory:FileSys
Oneliner:Reports the error status of low-level file functions
Syntax:FError() --> <nErrorCode>
Arguments:
Returns:<nErrorCode> Value of the OS error last encountered by a low-level file function. FError() Return Values <table> Error Meaning 0 Successful 2 File not found 3 Path not found 4 Too many files open 5 Access denied 6 Invalid handle 8 Insufficient memory 15 Invalid drive specified 19 Attempted to write to a write-protected disk 21 Drive not ready 23 Data CRC error 29 Write fault 30 Read fault 32 Sharing violation 33 Lock Violation </table>
Description:After every low-level file function, this function will return a value that provides additional information on the status of the last low-level file functions's performance. If the FError() function returns a 0, no error was detected. Below is a table of possibles values returned by the FError() function.
Examples:#include "fileio.ch" nHandle := FCreate( "test.txt", FC_NORMAL ) IF FError() != 0 ? "Cannot create file, OS error ", FError() ENDIF
Status:R
Compliance:C
Files:Library is core
See also:FClose(), FErase(), FOpen(), FWrite()
Back to index


File

Lang:file.txt
Component:harbour
Doc. source:.\doc\en\file.txt
Template:Function
Category:API
Subcategory:FileSys
Oneliner:Tests for the existence of File(s)
Syntax:File( <cFileSpec> ) --> lExists
Arguments:<cFileSpec> Filename skeleton or file name to find.
Returns:<lExists> a logical true (.T.) if the file exists or logical false (.F.).
Description:This function return a logical true (.T.) if the given filename <cFileSpec> exist. Filename skeletons symbols may be used in the filename in <cFileSpec>, as may the drive and/or path name. If a path is not explicitly specified, File() will look for the file in the SET DEFAULT path, then in each SET PATH path, until the file is found or there are no more paths to search. The PATH environment variable is never searched and the current drive/directory is only searched if SET DEFAULT is blank.
Examples:? File( "C:\harbour\doc\compiler.txt" ) ? File( "C:/harbour/doc/subcodes.txt" )
Status:S (wild card support is missing)
Compliance:C
Files:Library is core
See also:SET DEFAULT, SET PATH, Set()
Back to index


FOpen

Lang:file.txt
Component:harbour
Doc. source:.\doc\en\file.txt
Template:Function
Category:API
Subcategory:FileSys
Oneliner:Open a file.
Syntax:FOpen( <cFile>, [<nMode>] ) --> nHandle
Arguments:<cFile> Name of file to open. <nMode> File open mode.
Returns:<nHandle> A file handle.
Description:This function opens a file expressed as <cFile> and returns a file handle to be used with other low-level file functions. The value of <nMode> represents the status of the file to be opened; the default value is 0. The file open modes are as follows: <table> nMode Meaning FO_READ Read only FO_WRITE Write only FO_READWRITE Read/write FO_EXCLUSIVE Exclusive read only FO_DENYWRITE Prevent others from writing FO_DENYREAD Deny read only FO_DENYNONE Not deny, Let to others Read / Write FO_SHARED same as FO_DENYNONE </table> If there is an error in opening a file, a F_ERROR will be returned by the function. Files handles may be in the range of 0 to 65535. The status of the SET DEFAULT TO and SET PATH TO commands has no effect on this function. Directory names and paths must be specified along with the file that is to be opened. If an error has occurred, see the returns values from FError() for possible reasons for the error.
Examples:#include "fileio.ch" IF ( nH := FOpen( "test.txt", FO_READWRITE + FO_DENYNONE ) ) == F_ERROR ? "File can't be opened" ENDIF
Status:R
Compliance:C
Files:Library is core Header is fileio.ch
See also:FCreate(), FError(), FClose()
Back to index


FRead

Lang:file.txt
Component:harbour
Doc. source:.\doc\en\file.txt
Template:Function
Category:API
Subcategory:FileSys
Oneliner:Reads a specified number of bytes from a file.
Syntax:FRead( <nHandle>, @<cBuffer>, <nBytes> ) --> nBytes
Arguments:<nHandle> File handle <cBuffer> Character expression passed by reference. <nBytes> Number of bytes to read.
Returns:<nBytes> the number of bytes successfully read from the file. <nHandle>
Description:This function reads the characters from a file whose file handle is <nHandle> into a character memory variable expressed as <cBuffer>. The function returns the number of bytes successfully read into <cBuffer>. The value of <nHandle> is obtained from either a call to the FOpen() or the FCreate() function. The <cBuffer> expression is passed by reference and must be defined before this function is called. It also must be at least the same length as <nBytes>. <nBytes> is the number of bytes to read, starting at the current file pointer position. If this function is successful in reading the characters from the file, the length of <cBuffer> or the number of bytes specified in <nBytes> will be the value returned. The current file pointer advances the number of bytes read with each successive read. The return value is the number of bytes successfully read from the file. If a 0 is returned, or if the number of bytes read matches neither the length of <cBuffer> nor the specified value in <nBytes> an end-of-file condition has been reached.
Examples:#include "fileio.ch" cBuffer := Space( 500 ) IF ( nH := FOpen( "test.txt" ) ) == F_ERROR FRead( nH, @cBuffer, 500 ) ? cbuffer ENDIF FClose( nH )
Status:R
Compliance:C
Files:Library is core
See also:Bin2I(), Bin2L(), Bin2W(), FError(), FWrite()
Back to index


FReadStr

Lang:file.txt
Component:harbour
Doc. source:.\doc\en\file.txt
Template:Function
Category:API
Subcategory:FileSys
Oneliner:Reads a string from a file.
Syntax:FReadStr( <nHandle>, <nBytes> ) --> cString
Arguments:<nHandle> File handle number. <nBytes> Number of bytes to read.
Returns:<cString> an character expression
Description:This function returns a character string of <nBytes> bytes from a file whose file handle is <nHandle>. The value of the file handle <nHandle> is obtained from either the FOpen() or FCreate() functions. The value of <nBytes> is the number of bytes to read from the file. The returned string will be the number of characters specified in <nBytes> or the number of bytes read before an end-of-file charac- ter (ASCII 26) is found. NOTE This function is similar to the FRead() function, except that it will not read binary characters that may he required as part of a header of a file construct. Characters Such as Chr( 0 ) and Chr( 26 ) may keep this function from performing its intended operation. In this event, the FRead() function should he used in place of the FReadStr() function.
Examples:#include "fileio.ch" IF ( nH := FOpen( "test.txt" ) ) != F_ERROR cStr := FReadStr( nH, 100 ) ? cStr FClose( nH ) ENDIF
Status:R
Compliance:C
Files:Library is core
See also:Bin2I(), Bin2L(), Bin2W(), FError(), FRead(), FSeek()
Back to index


FRename

Lang:file.txt
Component:harbour
Doc. source:.\doc\en\file.txt
Template:Function
Category:API
Subcategory:FileSys
Oneliner:Renames a file
Syntax:FRename( <cOldFile>, <cNewFile> ) --> nSuccess
Arguments:<cOldFile> Old filename to be changed <cNewFile> New filename
Returns:<nSuccess> If successful, a 0 will be returned otherwise, a -1 will be returned.
Description:This function renames the specified file <cOldFile> to <cNewFile>. A filename and/or directory name may be specified for either para- meter. However, if a path is supplied as part of <cNewFile> and this path is different from either the path specified in <cOldFile> or (if none is used) the current drive and directory, the function will not execute successfully. Neither parameter is subject to the control of the SET PATH TO or SET DEFAULT TO commands. In attempting to locate the file to be renamed, this function will search the default drive and directory or the drive and path specified in <cOldFile>. It will not search directories named by the SET PATH TO and SET DEFAULT TO commands or by the PATH environment variable. If the file specified in <cNewFile> exists or the file is open, the function will be unable to rename the file. If the function is unable to complete its operation, it will return a value of -1. If it is able to rename the file, the return value for the function will be 0. A call to FError() function will give additional infor- mation about any error found.
Examples:#include "fileio.ch" nResult := FRename( "test.txt", "test1.txt" ) IF nResult != 0 ? "File could not be renamed." ENDIF
Status:R
Compliance:C
Files:Library is core
See also:ERASE, FErase(), FError(), File(), RENAME
Back to index


FSeek

Lang:file.txt
Component:harbour
Doc. source:.\doc\en\file.txt
Template:Function
Category:API
Subcategory:FileSys
Oneliner:Positions the file pointer in a file.
Syntax:FSeek( <nHandle>, <nOffset>, [<nOrigin>] ) --> nPosition
Arguments:<nHandle> File handle. <nOffset> The number of bytes to move. <nOrigin> The relative position in the file.
Returns:<nPosition> the current position relative to begin-of-file
Description:This function sets the file pointer in the file whose file handle is <nHandle> and moves the file pointer by <expN2> bytes from the file position designated by <nOrigin>. The returned value is the relative position of the file pointer to the beginning-of-file marker once the operation has been completed. <nHandle> is the file handle number. It is obtained from the FOpen() or FCreate() function. The value of <nOffSet> is the number of bytes to move the file pointer from the position determined by <nOrigin>. The value of <nOffset> may be a negative number, suggesting backward movement. The value of <nOrigin> designates the starting point from which the file pointer should he moved, as shown in the following table: <table> <nOrigin> File position FS_SET Beginning of file FS_RELATIVE Current file pointer position FS_END End of file </table> If a value is not provided for <nOrigin>, it defaults to 0 and moves the file pointer from the beginning of the file.
Examples:// here is a function that read one text line from an open file // nH = file handle obtained from FOpen() // cB = a string buffer passed-by-reference to hold the result // nMaxLine = maximum number of bytes to read FUNCTION FReadLn( nH, cB, nMaxLine ) LOCAL cLine, nSavePos, nEol, nNumRead cLine := Space( nMaxLine ) cB := "" nSavePos := FSeek( nH, 0, FS_RELATIVE ) nNumRead := FRead( nH, @cLine, nMaxLine ) IF ( nEol := hb_BAt( hb_eol(), hb_BSubStr( cLine, 1, nNumRead ) ) ) == 0 cB := cLine ELSE cB := hb_BSubStr( cLine, 1, nEol - 1 ) FSeek( nH, nSavePos + nEol + 1, FS_SET ) ENDIF RETURN nNumRead != 0
Status:R
Compliance:C
Files:Library is core Header is fileio.ch
See also:FCreate(), FError(), FOpen(), FRead(), FReadStr(), FWrite()
Back to index


FWrite

Lang:file.txt
Component:harbour
Doc. source:.\doc\en\file.txt
Template:Function
Category:API
Subcategory:FileSys
Oneliner:Writes characters to a file.
Syntax:FWrite( <nHandle>, <cBuffer>, [<nBytes>] ) --> nBytesWritten
Arguments:<nHandle> File handle number. <cBuffer> Character expression to be written. <nBytes> The number of bytes to write.
Returns:<nBytesWritten> the number of bytes successfully written.
Description:This function writes the contents of <cBuffer> to the file designated by its file handle <nHandle>. If used, <nBytes> is the number of bytes in <cBuffer> to write. The returned value is the number of bytes successfully written to the file. If the returned value is 0, an error has occurred (unless this is intended). A successful write occurs when the number returned by FWrite() is equal to either Len( <cBuffer> ) or <nBytes>. The value of <cBuffer> is the string or variable to be written to the open file <nHandle>. The value of <nBytes> is the number of bytes to write out to the file. The disk write begins with the current file position in <nHandle>. If this variable is not used, the entire contents of <cBuffer> is written to the file. To truncate a file, a call of FWrite( nHandle, "", 0 ) is needed.
Examples:nHandle := FCreate( "test.txt" ) FOR X := 1 TO 10 FWrite( nHandle, Str( x ) ) NEXT FClose( nHandle )
Status:R
Compliance:C
Files:Library is core
See also:FClose(), FCreate(), FError(), FOpen(), I2Bin(), L2Bin()
Back to index


hb_DiskSpace

Lang:diskspac.txt
Component:harbour
Doc. source:.\doc\en\diskspac.txt
Template:Function
Category:API
Subcategory:FileSys
Oneliner:Get the amount of space available on a disk
Syntax:hb_DiskSpace( [<cDrive>] [, <nType>] ) --> nDiskbytes
Arguments:<cDrive> The drive letter you are requesting info on. The default is A: <nType> The type of space being requested. The default is HB_DISK_AVAIL.
Returns:<nDiskBytes> The number of bytes on the requested disk that match the requested type.
Description:By default, this function will return the number of bytes of free space on the current drive that is available to the user requesting the information. There are 4 types of information available: HB_FS_AVAIL The amount of space available to the user making the request. This value could be less than HB_FS_FREE if disk quotas are supported by the O/S in use at runtime, and disk quotas are in effect. Otherwise, the value will be equal to that returned for HB_FS_FREE. HB_FS_FREE The actual amount of free diskspace on the drive. HB_FS_USED The number of bytes in use on the disk. HB_FS_TOTAL The total amount of space allocated for the user if disk quotas are in effect, otherwise, the actual size of the drive. If information is requested on a disk that is not available, a runtime error 2018 will be raised.
Examples:#include "fileio.ch" ? "You can use : " + hb_ntos( hb_DiskSpace() ) + " bytes " +; "Out of a total of " + hb_ntos( hb_DiskSpace( "C:", HB_FS_TOTAL ) ) // NOTE: See tests/diskspac.prg for another example
Status:R
Compliance:H
Files:Library is core Header is fileio.ch
See also:
Back to index


hb_FEof

Lang:file.txt
Component:harbour
Doc. source:.\doc\en\file.txt
Template:Function
Category:API
Subcategory:FileSys
Oneliner:Check for end-of-file.
Syntax:hb_FEof( <nHandle> ) --> lIsEof
Arguments:<nHandle> The handle of an open file.
Returns:<lIsEof> .T. if the file handle is at end-of-file, otherwise .F.
Description:This function checks an open file handle to see if it is at EOF. If the file handle is missing, not numeric, or not open, then this function returns .T. and sets the value returned by FError() to -1 (F_ERROR) or a C-compiler dependent errno value (EBADF or EINVAL).
Examples:nH := FOpen( "test.txt" ) ? FReadStr( nH, 80 ) IF hb_FEof( nH ) ? "End-of-file reached." ELSE ? FReadStr( nH, 80 ) ENDIF
Status:R
Compliance:H
Files:Library is core
See also:FError()
Back to index


hb_FLock

Lang:hbflock.txt
Component:harbour
Doc. source:.\doc\en\hbflock.txt
Template:Function
Category:API
Subcategory:FileSys
Oneliner:Locks part or all of any file
Syntax:hb_FLock( <nHandle>, <nOffset>, <nBytes> [, <nType ] ) --> <lSuccess>
Arguments:<nHandle> Dos file handle set> Offset of the first byte of the region to be locked. <nBytes> Number of bytes to be locked. e> The type (read or write) of lock requested.
Returns:<lSuccess> .T. if the lock was obtained, else .F.
Description:This function attempts to lock a region of the file whose file handle is <nHandle>. This is a low level file function. To lock Harbour data files use either the FLock() or RLock() function. The value of <nHandle> is obtained from either a call to the FOpen() or the FCreate() function. <nOffset> is the offset (from the beginning of the file) to the first of the region to be locked. (Offsets from the current position nd of file are not currently supported.) <nBytes> is the length of the region to be locked in bytes. e> is the type of lock requested. There are two types of locks: sive write locks ( <nType> = 0x0000 ) - the default, and shared locks( <nType> = 0x0100 ). Additionally you can specify a ing version of this function (that is it won't return until r an error has occurred or the lock has been obtained) by g Ox0200 to the above values.
Examples:refer to tests/tflock.prg
Status:R
Compliance:H
Files:Library is core
See also:hb_FUnlock(), FOpen(), FCreate(), FError(), FClose()
Back to index


hb_FUnlock

Lang:hbflock.txt
Component:harbour
Doc. source:.\doc\en\hbflock.txt
Template:Function
Category:API
Subcategory:FileSys
Oneliner:Unlocks part or all of any file
Syntax:hb_FUnlock( <nHandle>, <nOffset>, <nBytes> ) --> <lSuccess>
Arguments:<nHandle> Dos file handle set> Offset of the first byte of the region to be locked. <nBytes> Number of bytes to be locked.
Returns:<lSuccess> .T. if the lock was removed, else .F.
Description:This function attempts to unlock a region of the file whose file handle is <nHandle>. This is a low level file function. To unlock Harbour data files use the dbUnlock() function. The value of <nHandle> is obtained from either a call to the FOpen() or the FCreate() function. <nOffset> is the offset (from the beginning of the file) to the first of the region to be unlocked. (Offsets from the current position nd of file are not currently supported.) <nBytes> is the length of the region to be unlocked in bytes.
Examples:refer to tests/tflock.prg
Status:R
Compliance:H
Files:Library is core
See also:hb_FLock(), FOpen(), FCreate(), FError(), FClose()
Back to index


IsDisk

Lang:file.txt
Component:harbour
Doc. source:.\doc\en\file.txt
Template:Function
Category:API
Subcategory:FileSys
Oneliner:Verify if a drive is ready
Syntax:IsDisk( <cDrive> ) --> lSuccess
Arguments:<cDrive> An valid Drive letter
Returns:<lSuccess> .T. is the drive is ready, otherwise .F.
Description:This function attempts to access a drive. If the access to the drive was successfull, it will return true (.T.), otherwise false(.F.). This function is usefull for backup function, so you can determine if the drive that will receive the backup data is ready or not.
Examples:IF IsDisk( "A" ) ? "Drive is ready " ENDIF
Status:R
Compliance:This function is CA-Cl*pper 5.3 compliant
Files:Library is core
See also:DirChange(), MakeDir(), DirRemove(), DiskChange(), DiskName()
Back to index


MakeDir

Lang:file.txt
Component:harbour
Doc. source:.\doc\en\file.txt
Template:Function
Category:API
Subcategory:FileSys
Oneliner:Create a new directory
Syntax:MakeDir( <cDirectory> ) --> nError
Arguments:<cDirectory> The name of the directory you want to create.
Returns:<nError> 0 if directory was successfully created, otherwise the number of the last error.
Description:This function attempt to create a new directory with the name contained in <cDirectory>. If this function fails, it will return the last OS error code number. See FError() function for the description of the error
Examples:cDir := "temp" IF MakeDir( cDir ) == 0 ? "Directory", cDir, "successfully created" ENDIF
Status:R
Compliance:This function is CA-Cl*pper 5.3 compliant
Files:Library is core
See also:DirChange(), DirRemove(), IsDisk(), DiskChange(), DiskName(), FError()
Back to index


__Dir*

Lang:dir.txt
Component:harbour
Doc. source:.\doc\en\dir.txt
Template:Function
Category:API
Subcategory:FileSys
Oneliner:Display listings of files
Syntax:__Dir( [<cFileMask>] ) --> NIL
Arguments:<cFileMask> File mask to include in the function return. It could contain path and standard wildcard characters as supported by your OS (like * and ?). If <cFileMask> contains no path, then SET DEFAULT path is used to display files in the mask.
Returns:__Dir() always returns NIL.
Description:If no <cFileMask> is given, __Dir() displays information about all *.dbf in the SET DEFAULT path. This information contains: file name, number of records, last update date and the size of each file. If <cFileMask> is given, __Dir() list all files that match the mask with the following details: Name, Extension, Size, Date. DIR command is preprocessed into __Dir() function during compile time. __Dir() is a compatibility function, it is superseded by Directory() which return all the information in a multidimensional array.
Examples:__Dir() // information for all DBF files in current directory __Dir( "*.dbf" ) // list all DBF file in current directory // list all PRG files in Harbour Run-Time library // for MS-DOS compatible operating systems __Dir( "src\rtl\*.prg" ) // list all files in the public section on a Unix like machine __Dir( "/pub" )
Status:R
Compliance:C
Files:Library is core
See also:ADir(), Directory(), SET DEFAULT, DIR
Back to index


hb_gcAll

Lang:garbage.txt
Component:harbour
Doc. source:.\doc\en\garbage.txt
Template:Procedure
Category:API
Subcategory:Garbage Collector
Oneliner:Scans the memory and releases all garbage memory blocks.
Syntax:hb_gcAll()
Arguments:None
Returns:
Description:This function releases all memory blocks that are considered as the garbage.
Examples:
Status:Harbour
Compliance:H
Files:
See also:hb_gcCollectAll()
Back to index


hb_gcAlloc

Lang:garbage.txt
Component:harbour
Doc. source:.\doc\en\garbage.txt
Template:Function
Category:API
Subcategory:Garbage Collector
Oneliner:Allocates memory that will be collected by the garbage collector.
Syntax:#include "hbapi.h" void * hb_gcAlloc( HB_SIZE nSize, PHB_GARBAGE_FUNC pCleanupFunc );
Arguments:<ulSize> Requested size of memory block <pCleanupFunc> Pointer to HB_GARBAGE_FUNC function that will be called directly before releasing the garbage memory block or NULL. This function should release all other memory allocated and stored inside the memory block. For example, it releases all items stored inside the array. The functions receives a single parameter: the pointer to memory allocated by hb_gcAlloc().
Returns:The pointer to allocated memory or it generates an internal unrecoverable error.
Description:hb_gcAlloc() is used to allocate the memory that will be tracked by the garbage collector. It allows to properly release memory in case of self-referencing or cross-referencing harbour level variables. Memory allocated with this function should be released with hb_gcFree() function or it will be automatically deallocated by the GC if it is not locked or if it is not referenced by some harbour level variable.
Examples:
Status:C
Compliance:H
Files:
See also:hb_gcFree()
Back to index


hb_gcCollectAll

Lang:garbage.txt
Component:harbour
Doc. source:.\doc\en\garbage.txt
Template:Function
Category:API
Subcategory:Garbage Collector
Oneliner:Scans all memory blocks and releases the garbage memory.
Syntax:void hb_gcCollectAll( void );
Arguments:None.
Returns:Nothing.
Description:This function scans the eval stack, the memvars table, the array of static variables and table of created classes for referenced memory blocks. After scanning all unused memory blocks and blocks that are not locked are released.
Examples:
Status:C
Compliance:H
Files:
See also:hb_gcAlloc(), hb_gcFree()
Back to index


hb_gcFree

Lang:garbage.txt
Component:harbour
Doc. source:.\doc\en\garbage.txt
Template:Function
Category:API
Subcategory:Garbage Collector
Oneliner:Releases the memory that was allocated with hb_gcAlloc().
Syntax:void hb_gcFree( void * pMemoryPtr );
Arguments:<pMemoryPtr> The pointer to memory for release. This memory pointer have to be allocated with hb_gcAlloc() function.
Returns:Nothing.
Description:hb_gcFree() is used to deallocate the memory that was allocated with the hb_gcAlloc() function.
Examples:
Status:C
Compliance:H
Files:
See also:hb_gcAlloc()
Back to index


hb_gcItemRef

Lang:garbage.txt
Component:harbour
Doc. source:.\doc\en\garbage.txt
Template:Function
Category:API
Subcategory:Garbage Collector
Oneliner:Marks the memory to prevent deallocation by the garbage collector.
Syntax:void hb_gcItemRef( PHB_ITEM pItem );
Arguments:<pItem> The pointer to item structure that will be scanned. The passed item can be of any datatype although arrays, objects and codeblocks are scanned only. Other datatypes don't require locking so they are simply ignored.
Returns:Nothing.
Description:The garbage collector uses hb_gcItemRef() function during scanning of referenced memory pointers. This function checks the type of passed item and scans recursively all other memory blocks referenced by this item if it is an array, an object or a codeblock. NOTE: This function is reserved for the garbage collector only. It cannot be called from the user code - calling it can cause unpredicted results (memory blocks referenced by the passed item can be released prematurely during the closest garbage collection).
Examples:
Status:C
Compliance:H
Files:
See also:hb_gcAlloc(), hb_gcFree()
Back to index


hb_HAllocate

Lang:hashes.txt
Component:harbour
Doc. source:.\doc\en\hashes.txt
Template:Procedure
Category:API
Subcategory:Hash table
Oneliner:Preallocates a hash table
Syntax:hb_HAllocate( <hsTable>, <nItems> )
Arguments:<hsTable> a hash table, created by hb_Hash() <nItems> number of items to preallocate in the hash table
Returns:
Description:
Examples:
Status:R
Compliance:H
Files:
See also:
Back to index


hb_Hash

Lang:hashes.txt
Component:harbour
Doc. source:.\doc\en\hashes.txt
Template:Function
Category:API
Subcategory:Hash table
Oneliner:Returns a hash table
Syntax:hb_Hash( [ <Key1>, <Value1> ], [ <KeyN>, <ValueN> ], ... ) -> hsTable
Arguments:<Key1> entry key; can be of type: number, date, datetime, string, pointer <Value1> entry value; can be of type: block, string, numeric, date/datetime, logical, nil, pointer, array, hash table
Returns:A hash table built from the initial key/value pairs
Description:
Examples:
Status:R
Compliance:H
Files:
See also:
Back to index


hb_HAutoAdd

Lang:hashes.txt
Component:harbour
Doc. source:.\doc\en\hashes.txt
Template:Function
Category:API
Subcategory:Hash table
Oneliner:Sets the 'auto add' flag for the hash table
Syntax:hb_HAutoAdd( <hsTable>, [<lFlag>] ) -> <lPreviousFlag>
Arguments:<hsTable> a hash table, created by hb_Hash() <lFlag> a logical value indicating to turn on or off the 'auto add' flag of the hash table
Returns:The previous value of the 'auto add' flag
Description:This function is equivalent to hb_HAutoAdd() but it returns the old flag value rather than the hash table
Examples:LOCAL hsTable, lFlag hsTable := { "one" => 1, "two" => 2 } // turn 'auto add' on for a new hash table, storing ol flag lFlag := hb_HAutoAdd( hsTable, .T. )
Status:R
Compliance:H
Files:
See also:
Back to index


hb_HBinary

Lang:hashes.txt
Component:harbour
Doc. source:.\doc\en\hashes.txt
Template:Function
Category:API
Subcategory:Hash table
Oneliner:Sets the 'binary' flag for the hash table
Syntax:hb_HBinary( <hsTable>, [<lFlag>] ) -> <lPreviousFlag>
Arguments:<hsTable> a hash table, created by hb_Hash() <lFlag> a logical value indicating to turn on or off the 'binary' flag of the hash table
Returns:The previous value of the 'binary' flag
Description:This function is equivalent to hb_HBinary() but it returns the old flag value rather than the hash table
Examples:LOCAL hsTable, lFlag hsTable := { "one" => 1, "two" => 2 } // turn 'binary' on for a new hash table, storing ol flag lFlag := hb_HBinary( hsTable, .T. )
Status:R
Compliance:H
Files:
See also:
Back to index


hb_HCaseMatch

Lang:hashes.txt
Component:harbour
Doc. source:.\doc\en\hashes.txt
Template:Function
Category:API
Subcategory:Hash table
Oneliner:Sets the 'case match' flag for the hash table
Syntax:hb_HCaseMatch( <hsTable>, [<lFlag>] ) -> <lPreviousFlag>
Arguments:<hsTable> a hash table, created by hb_Hash() <lFlag> a logical value indicating to turn on or off the 'case match' flag of the hash table
Returns:The previous value of the 'case match' flag
Description:This function returns the old flag value
Examples:LOCAL hsTable, lFlag hsTable := { "one" => 1, "two" => 2 } // turn 'case match' on for a new hash table, storing ol flag lFlag := hb_HCaseMatch( hsTable, .T. )
Status:R
Compliance:H
Files:
See also:
Back to index


hb_HClone

Lang:hashes.txt
Component:harbour
Doc. source:.\doc\en\hashes.txt
Template:Function
Category:API
Subcategory:Hash table
Oneliner:Creates a copy of a hash table
Syntax:hb_HClone( <hsTable> ) -> <hsDestination>
Arguments:<hsTable> a hash table, created by hb_Hash()
Returns:A cloned copy of the hash table
Description:
Examples:
Status:R
Compliance:H
Files:
See also:
Back to index


hb_HCopy

Lang:hashes.txt
Component:harbour
Doc. source:.\doc\en\hashes.txt
Template:Function
Category:API
Subcategory:Hash table
Oneliner:Adds entries from the source hash table to the destination hash table
Syntax:hb_HCopy( <hsDestination>, <hsSource>, [<nStart>], [<nCount>] ) -> <hsDestination>
Arguments:<hsDestination> a destination hash table, created by hb_Hash() <hsSource> a source hash table, created by hb_Hash() <nStart> starting index, defaults to 1 if omitted <nCount> counter, defaults to (length) - <nStart> is omitted
Returns:The destination hash table
Description:
Examples:
Status:R
Compliance:H
Files:
See also:
Back to index


hb_HDefault

Lang:hashes.txt
Component:harbour
Doc. source:.\doc\en\hashes.txt
Template:Function
Category:API
Subcategory:Hash table
Oneliner:Returns/sets a default value for a hash table.
Syntax:hb_HDefault( <hsTable>, <DefaultValue> ) -> <OldDefaultValye>
Arguments:<hsTable> a hash table, created by hb_Hash() <DefaultValue>
Returns:The previous default value assigned to the hash table
Description:
Examples:
Status:R
Compliance:H
Files:
See also:TODO: locate and list those methods that use this feature
Back to index


hb_HDel

Lang:hashes.txt
Component:harbour
Doc. source:.\doc\en\hashes.txt
Template:Function
Category:API
Subcategory:Hash table
Oneliner:Removes a key/value pair from a hash table
Syntax:hb_HDel( <hsTable>, <Key> ) -> <hsTable>
Arguments:<hsTable> a hash table, created by hb_Hash() <Key> key to be removed from the hash table; can be of type: number, date, datetime, string, pointer
Returns:The hash table
Description:
Examples:
Status:R
Compliance:H
Files:
See also:
Back to index


hb_HDelAt

Lang:hashes.txt
Component:harbour
Doc. source:.\doc\en\hashes.txt
Template:Function
Category:API
Subcategory:Hash table
Oneliner:Removes an entry from a hash table based on its index position
Syntax:hb_HDelAt( <hsTable>, <nPosition> ) -> <hsTable>
Arguments:<hsTable> a hash table, created by hb_Hash() <nPosition> the position of an entry within the hash table that will be deleted
Returns:The hash table
Description:
Examples:
Status:R
Compliance:H
Files:
See also:
Back to index


hb_HEval

Lang:hashes.txt
Component:harbour
Doc. source:.\doc\en\hashes.txt
Template:Function
Category:API
Subcategory:Hash table
Oneliner:Evaluate a code block across the contents of a hash table
Syntax:hb_HEval( <hsTable>, <bBlock>, [<nStart>], [<nCount>] ) -> <hsTable>
Arguments:<hsTable> a hash table, created by hb_Hash() <bBlock> code block to be evaluated <nStart> starting index, defaults to 1 if omitted <nCount> counter, defaults to (length) - <nStart> is omitted
Returns:The hash table
Description:The code block is evaluated for every hash table entry starting at <nStart> for <nCount> items. The code block is passed the entry key, value, and numeric position
Examples:
Status:R
Compliance:H
Files:
See also:
Back to index


hb_HFill

Lang:hashes.txt
Component:harbour
Doc. source:.\doc\en\hashes.txt
Template:Function
Category:API
Subcategory:Hash table
Oneliner:Fills a hash table with a value
Syntax:hb_HFill( <hsTable>, <Value> ) -> <hsTable>
Arguments:<hsTable> a hash table, created by hb_Hash() <Value> fill value; can be of type: block, string, numeric, date/datetime, logical, nil, pointer, array, hash table
Returns:The hash table
Description:
Examples:
Status:R
Compliance:H
Files:
See also:
Back to index


hb_HGet

Lang:hashes.txt
Component:harbour
Doc. source:.\doc\en\hashes.txt
Template:Function
Category:API
Subcategory:Hash table
Oneliner:Returns a hash value
Syntax:hb_HGet( <hsTable>, <Key> ) -> <Value>
Arguments:<hsTable> a hash table, created by hb_Hash() <Key> key to be retrieve from the hash table; can be of type: number, date, datetime, string, pointer
Returns:Either the value within the hash table for the given key. An array access error occurs of the key is not found
Description:
Examples:
Status:R
Compliance:H
Files:
See also:
Back to index


hb_HGetDef

Lang:hashes.txt
Component:harbour
Doc. source:.\doc\en\hashes.txt
Template:Function
Category:API
Subcategory:Hash table
Oneliner:Returns a hash value, or a default value if the key is not present
Syntax:hb_HGetDef( <hsTable>, <Key>, [<DefaultValue>] ) -> <Value>
Arguments:<hsTable> a hash table, created by hb_Hash() <Key> key to be retrieve from the hash table; can be of type: number, date, datetime, string, pointer <DefaultValue> a default value to be returned if the hash table does not contain the key
Returns:Either the value within the hash table for the given key, or the default value.
Description:
Examples:
Status:R
Compliance:H
Files:
See also:
Back to index


hb_HHasKey

Lang:hashes.txt
Component:harbour
Doc. source:.\doc\en\hashes.txt
Template:Function
Category:API
Subcategory:Hash table
Oneliner:Determines whether a hash table has an entry with a give key
Syntax:hb_HHasKey( <hsTable>, <Key> ) -> lExists
Arguments:<hsTable> a hash table, created by hb_Hash() <Key> a key value to be queried for; can be of type: number, date, datetime, string, pointer
Returns:A logical value indicating whether the key exists within the hash table
Description:
Examples:
Status:R
Compliance:H
Files:
See also:
Back to index


hb_HKeyAt

Lang:hashes.txt
Component:harbour
Doc. source:.\doc\en\hashes.txt
Template:Function
Category:API
Subcategory:Hash table
Oneliner:Gets a hash table key at a given position
Syntax:hb_HKeyAt( <hsTable>, <nPosition> ) -> <Key>
Arguments:<hsTable> a hash table, created by hb_Hash() <nPosition> the position of an entry within the hash table that will be returned
Returns:The key at the given position of the hash table; the type will be one: number, date, datetime, string, pointer
Description:
Examples:
Status:R
Compliance:H
Files:
See also:
Back to index


hb_HKeys

Lang:hashes.txt
Component:harbour
Doc. source:.\doc\en\hashes.txt
Template:Function
Category:API
Subcategory:Hash table
Oneliner:Returns an array of the keys of a hash table
Syntax:hb_HKeys( <hsTable> ) -> <aKeys>
Arguments:<hsTable> a hash table, created by hb_Hash()
Returns:An array of all the hash table keys
Description:
Examples:
Status:R
Compliance:H
Files:
See also:
Back to index


hb_HMerge

Lang:hashes.txt
Component:harbour
Doc. source:.\doc\en\hashes.txt
Template:Function
Category:API
Subcategory:Hash table
Oneliner:Merges a source hash table into a destination hash table
Syntax:hb_HMerge( <hsDestination>, <hsSource>, <bBlock>|<nPosition> ) -> <hsDestination>
Arguments:<hsDestination> a destination hash table, created by hb_Hash() <hsSource> a source hash table, created by hb_Hash() <bBlock> a code block that will be evaluated for each entry within the source hash table; the code block will be passed the entry key, value and position; if the code block returns a true value, the entry will be added to the destination hash table <nPosition> the position of an entry within the source hash table that will be appended to the destination hash table TODO: the source code passes either a number or HB_HASH_UNION; research this
Returns:The destination hash table with the contents of the source hash table merged
Description:
Examples:
Status:R
Compliance:H
Files:
See also:
Back to index


hb_HPairAt

Lang:hashes.txt
Component:harbour
Doc. source:.\doc\en\hashes.txt
Template:Function
Category:API
Subcategory:Hash table
Oneliner:Returns a two-dimensional array of a hash table entry key/value pair
Syntax:hb_HPairAt( <hsTable>, <nPosition> ) -> <aKeyValue>
Arguments:<hsTable> a hash table, created by hb_Hash() <nPosition> the position of an entry within the hash table that will be returned
Returns:A two-dimensional array of the key/value pair entry of the hash table
Description:
Examples:
Status:R
Compliance:H
Files:
See also:
Back to index


hb_HPos

Lang:hashes.txt
Component:harbour
Doc. source:.\doc\en\hashes.txt
Template:Function
Category:API
Subcategory:Hash table
Oneliner:Locates the index of a key within a hash table
Syntax:hb_HPos( <hsTable>, <Key> ) -> nPosition
Arguments:<hsTable> a hash table, created by hb_Hash() <Key> key for which its position is to be determined; can be of type: number, date, datetime, string, pointer
Returns:A integer number being the index position of the key within the hash table. TODO: what is the return value if the key does not exist? zero (0)? RTE?
Description:
Examples:
Status:R
Compliance:H
Files:
See also:
Back to index


hb_HScan

Lang:hashes.txt
Component:harbour
Doc. source:.\doc\en\hashes.txt
Template:Function
Category:API
Subcategory:Hash table
Oneliner:Scans a hash table
Syntax:hb_HScan( <hsTable>, <Value>, [<nStart>], [<nCount>, [<lExact>] ) -> nPosition
Arguments:<hsTable> a hash table, created by hb_Hash() <Value> to be located within the hash table <nStart> starting index, defaults to 1 if omitted <nCount> counter, defaults to (length) - <nStart> is omitted <lExact> logical valuye indicating whether the comparision is to be be exact or not
Returns:The position of the located value within the hash table, or zero (0) if not found.
Description:
Examples:
Status:R
Compliance:H
Files:
See also:
Back to index


hb_HSet

Lang:hashes.txt
Component:harbour
Doc. source:.\doc\en\hashes.txt
Template:Function
Category:API
Subcategory:Hash table
Oneliner:Sets a hash value
Syntax:hb_HSet( <hsTable>, <Key>, <Value> ) -> <hsTable>
Arguments:<hsTable> a hash table, created by hb_Hash() <Key> the key of the entry to be set; can be of type: number, date, datetime, string, pointer <Value> the entry value
Returns:The hash table
Description:
Examples:
Status:R
Compliance:H
Files:
See also:
Back to index


hb_HSort

Lang:hashes.txt
Component:harbour
Doc. source:.\doc\en\hashes.txt
Template:Function
Category:API
Subcategory:Hash table
Oneliner:Reorganizes the internal list of the hash table to be sorted
Syntax:hb_HSort( <hsTable> ) -> <hsSortedTable>
Arguments:<hsTable> a hash table, created by hb_Hash()
Returns:The hash table sorted TODO: is the original table altered?
Description:
Examples:
Status:R
Compliance:H
Files:
See also:
Back to index


hb_HValueAt

Lang:hashes.txt
Component:harbour
Doc. source:.\doc\en\hashes.txt
Template:Function
Category:API
Subcategory:Hash table
Oneliner:Gets/sets a hash value at a given position
Syntax:hb_HValueAt( <hsTable>, <nPosition>, [<NewValue>] ) -> <Value>
Arguments:<hsTable> a hash table, created by hb_Hash() <nPosition> the position of an entry within the hash table that will be returned <NewValue> a new value to be assigned to the hash table at the given position
Returns:The existing value, or the new value if it is given
Description:
Examples:
Status:R
Compliance:H
Files:
See also:
Back to index


hb_HValues

Lang:hashes.txt
Component:harbour
Doc. source:.\doc\en\hashes.txt
Template:Function
Category:API
Subcategory:Hash table
Oneliner:Returns an array of the values of a hash table
Syntax:hb_HValues( <hsTable> ) -> <aValues>
Arguments:<hsTable> a hash table, created by hb_Hash()
Returns:An array of all the hash values
Description:
Examples:
Status:R
Compliance:H
Files:
See also:
Back to index


hb_idleAdd

Lang:idle.txt
Component:harbour
Doc. source:.\doc\en\idle.txt
Template:Function
Category:API
Subcategory:Idle states
Oneliner:Adds the background task.
Syntax:hb_idleAdd( <bAction> ) --> nHandle
Arguments:<bAction> is a codeblock that will be executed during idle states. There are no arguments passed to this codeblock during evaluation.
Returns:<nHandle> The handle (an integer value) that identifies the task. This handle can be used for deleting the task.
Description:hb_idleAdd() adds a passed codeblock to the list of background tasks that will be evaluated during the idle states. There is no limit for the number of tasks.
Examples:nTask := hb_idleAdd( {|| SayTime() } )
Status:R
Compliance:Harbour extension similar to ft_OnTick() function available in NanForum library.
Files:
See also:hb_idleDel(), hb_idleState()
Back to index


hb_idleDel

Lang:idle.txt
Component:harbour
Doc. source:.\doc\en\idle.txt
Template:Function
Category:API
Subcategory:Idle states
Oneliner:Removes the background task from the list of tasks.
Syntax:hb_idleDel( <nHandle> ) --> <bAction>
Arguments:<nHandle> is the identifier of the task returned by the hb_idleAdd() function.
Returns:<bAction> NIL if invalid handle is passed or a codeblock that was passed to hb_idleAdd() function
Description:hb_idleDel() removes the action associated with passed identifier from the list of background tasks. The identifer should be the value returned by the previous call of hb_idleAdd() function. If specified task is defined then the codeblock is returned otherwise the NIL value is returned.
Examples:nTask := hb_idleAdd( {|| SayTime() } ) Inkey( 10 ) bAction := hb_idleDel( nTask )
Status:R
Compliance:H
Files:
See also:hb_idleAdd(), hb_idleState()
Back to index


hb_idleState

Lang:idle.txt
Component:harbour
Doc. source:.\doc\en\idle.txt
Template:Procedure
Category:API
Subcategory:Idle states
Oneliner:Evaluates a single background task and calls the garbage collector.
Syntax:hb_idleState()
Arguments:None
Returns:
Description:hb_idleState() requests the garbage collection and executes a single background task defined by the codeblock passed with hb_idleAdd() function. Every call to this function evaluates a different task in the order of task creation. There are no arguments passed during a codeblock evaluation. This function can be safely called even if there are no background tasks defined.
Examples:nTask1 := hb_idleAdd( {|| SayTime() } ) nTask2 := hb_idleAdd( {|| SaveScreen() } ) DO WHILE ! bFinished bFinished := DoSomethingVeryImportant() hb_idleState() ENDDO cbAction := hb_idleDel( nTask1 ) hb_idleDel( nTask2 )
Status:R
Compliance:Harbour extension similar to ft_IAmIdle() function available in NanForum library.
Files:
See also:hb_idleAdd(), hb_idleDel()
Back to index


hb_inetAccept

Lang:hbinet.txt
Component:harbour
Doc. source:.\doc\en\hbinet.txt
Template:Function
Category:API
Subcategory:INET
Oneliner:Wait until a socket is ready
Syntax:hb_inetAccept( <socket> ) -> SOCKET
Arguments:An INET socket
Returns:<socket> a socket previously created / opened
Description:Waits until a connection is available on a socket created with hb_inetServer(), returns a socket that can be used to communicate with the incoming client. On error, NIL is returned and error code sets in the passed SOCKET. This error can be accessed using hb_inetErrorCode() function.
Examples:
Status:
Compliance:H
Files:
See also:
Back to index


hb_inetAddress

Lang:hbinet.txt
Component:harbour
Doc. source:.\doc\en\hbinet.txt
Template:Function
Category:API
Subcategory:INET
Oneliner:Get a remote server address
Syntax:hb_inetAddress( <socket> ) -> cResult
Arguments:<socket> a socket previously created / opened
Returns:Server address
Description:Returns a string representing the remote server address in quad dot notation, e.g. "192.168.1.1", or the local server address if the socket is server side. TODO: have a version that returns a vector of 4 numbers.
Examples:
Status:
Compliance:H
Files:
See also:
Back to index


hb_inetCleanup

Lang:hbinet.txt
Component:harbour
Doc. source:.\doc\en\hbinet.txt
Template:Procedure
Category:API
Subcategory:INET
Oneliner:Terminate Harbour INET support
Syntax:hb_inetCleanup()
Arguments:(This function has no arguments)
Returns:
Description:Closes inet support; mainly used for Windows. Put it at the end of any program using Inet functions, just before the program exits.
Examples:
Status:
Compliance:H
Files:
See also:
Back to index


hb_inetClearError

Lang:hbinet.txt
Component:harbour
Doc. source:.\doc\en\hbinet.txt
Template:Procedure
Category:API
Subcategory:INET
Oneliner:Clear the socket error value
Syntax:hb_inetClearError( <socket> )
Arguments:<socket> a socket previously created / opened
Returns:
Description:
Examples:
Status:
Compliance:H
Files:
See also:
Back to index


hb_inetClearPeriodCallback

Lang:hbinet.txt
Component:harbour
Doc. source:.\doc\en\hbinet.txt
Template:Procedure
Category:API
Subcategory:INET
Oneliner:Clear the periodic callback value of a socket
Syntax:hb_inetClearPeriodCallback( <socket> )
Arguments:<socket> a socket previously created / opened
Returns:
Description:
Examples:
Status:
Compliance:H
Files:
See also:
Back to index


hb_inetClearTimeLimit

Lang:hbinet.txt
Component:harbour
Doc. source:.\doc\en\hbinet.txt
Template:Procedure
Category:API
Subcategory:INET
Oneliner:Clear the time limit value of a socket
Syntax:hb_inetClearTimeLimit( <socket> )
Arguments:<socket> a socket previously created / opened
Returns:
Description:Clears the default time limit of the given socket.
Examples:
Status:
Compliance:H
Files:
See also:
Back to index


hb_inetClearTimeout

Lang:hbinet.txt
Component:harbour
Doc. source:.\doc\en\hbinet.txt
Template:Procedure
Category:API
Subcategory:INET
Oneliner:Clear the timeout value of a socket
Syntax:hb_inetClearTimeout( <socket> )
Arguments:<socket> a socket previously created / opened
Returns:
Description:Clears the default timeout of the given socket. Default timeout is used in all blocking operations.
Examples:
Status:
Compliance:H
Files:
See also:
Back to index


hb_inetClose

Lang:hbinet.txt
Component:harbour
Doc. source:.\doc\en\hbinet.txt
Template:Function
Category:API
Subcategory:INET
Oneliner:Close an INET socket
Syntax:hb_inetClose( <socket> ) -> nResult
Arguments:<socket> a socket previously created / opened
Returns:Returns 0 on success or -1 on error; on error, the error code is set; (actually, on success the socket error code is set to 1 -- socket closed )
Description:Closes the socket, notifiying both ends of the communication pipe that the connection is over. If you have threads waiting for data to be read from this socket, this method will make them stop waiting and return an error (socket closed) to their callers. The method does not destroy the socket, which can be used by subordinate threads to check that the socket is closed, and so they should stop as soon as they can. Don't destroy the socket unless you are sure that no other thread is using it.
Examples:
Status:
Compliance:H
Files:
See also:
Back to index


hb_inetConnect

Lang:hbinet.txt
Component:harbour
Doc. source:.\doc\en\hbinet.txt
Template:Function
Category:API
Subcategory:INET
Oneliner:Connect a socket to a remote server by IP address or name
Syntax:hb_inetConnect( <cAddress>, <nPort> ) -> SOCKET hb_inetConnect( <cAddress>, <nPort>, <socket> ) -> NIL
Arguments:<cAddress> <nPort> <socket>
Returns:(First form) INET socket (Second form has no return value)
Description:Connects to a remote server described by cAddress, that can be in quad dot notation (e.g. "192.168.1.1") or in DNS name (e.g. "www.xharbour.org"), using the desired port. hb_inetConnect() uses "gethostbyname" C system call to find the network address of the specified server; this means that this call is an hybrid function doing both a DNS scan and a TCP/IP connection. hb_inetConnect() is not thread safe, and the program must take care that two hb_inetConnect() functions are never called at the same moment from two different threads (or that hb_inetGetHosts() is not called in the same moment as an hb_inetConnect()). The second version of this function accepts a pre-built socket as a parameter. This allows to kill asyncronously a thread waiting for hb_inetConnect() to connect, and then cleaning up the leftover socket data. Also, it is possible to give timeout to the given SOCKET, but this timeout will be used only in the connection phase, after that the network address resolution is completed. Use hb_inetGetHosts() and hb_inetConnectIP() for a finer timeout control. On error, the error of the returned socket is set. The error could be due to unavailable name resolving service, host name not valid, host address not reachable and host reachable but port not open.
Examples:
Status:
Compliance:H
Files:
See also:
Back to index


hb_inetConnectIP

Lang:hbinet.txt
Component:harbour
Doc. source:.\doc\en\hbinet.txt
Template:Function
Category:API
Subcategory:INET
Oneliner:Connect to a remote server by IP address
Syntax:hb_inetConnectIP( <cAddress>, <nPort> ) -> SOCKET hb_inetConnectIP( <cAddress>, <nPort>, <socket> ) -> NIL
Arguments:<cAddress> <nPort> <socket>
Returns:(First form) INET socket (Second form has no return value)
Description:Connects to a remote server described by cAddress, that can be specified only in quad dot IPV4 notation (e.g. "127.0.0.1"), using the desired port. This version of hb_inetConnect() does not use gethostbyname, and thus is thread safe and can be used in combination with hb_inetGetHosts() to have a finer timeout control while connecting to a server, and a finer error control. The second version of this function accepts a pre-built socket as a parameter. This allows to kill asyncronously a thread waiting for hb_inetConnectIP() to connect, and then cleaning up the leftover socket data. Also, it is possible to give timeout at the given SOCKET. On error, the error of the returned socket is set.
Examples:
Status:
Compliance:H
Files:
See also:
Back to index


hb_inetCount

Lang:hbinet.txt
Component:harbour
Doc. source:.\doc\en\hbinet.txt
Template:Function
Category:API
Subcategory:INET
Oneliner:Get the number of bytes last read or sent
Syntax:hb_inetCount( <socket> ) -> nResult
Arguments:<socket> a socket previously created / opened
Returns:Last socket operation character count
Description:Returns the amount of characters read or written in the latest socket operation.
Examples:
Status:
Compliance:H
Files:
See also:
Back to index


hb_inetCreate

Lang:hbinet.txt
Component:harbour
Doc. source:.\doc\en\hbinet.txt
Template:Function
Category:API
Subcategory:INET
Oneliner:Create an INET socket
Syntax:hb_inetCreate( [ <nTimeout> ] ) -> SOCKET
Arguments:<nTimeout> Socket timeout (optional) TODO: what is the scale (seconds, milliseconds?)
Returns:An INET socket
Description:Creates the raw data of the socket, that can be passed to a asynchronous connection function (hb_inetConnect() or hb_inetConnectIP()). This will prevent the connection function from allocating some data that could be never used in certain cases, i.e. an asynchronously detected timeout.
Examples:
Status:
Compliance:H
Files:
See also:
Back to index


hb_inetCRLF

Lang:hbinet.txt
Component:harbour
Doc. source:.\doc\en\hbinet.txt
Template:Function
Category:API
Subcategory:INET
Oneliner:Get a CRLF sequence for internet protocols
Syntax:hb_inetCRLF() -> cResult
Arguments:(This function has no arguments)
Returns:Internet CRLF sequence
Description:Returns a CRLF sequence used in many internet protocols.
Examples:
Status:
Compliance:H
Files:
See also:
Back to index


hb_inetDataReady

Lang:hbinet.txt
Component:harbour
Doc. source:.\doc\en\hbinet.txt
Template:Function
Category:API
Subcategory:INET
Oneliner:Get whether there is data ready in a socket
Syntax:hb_inetDataReady( <socket>, [ <nMillisec> ] ) -> nResult
Arguments:<socket> a socket previously created / opened <nMillisec>
Returns:If there is data available 1 (one) is returned, 0 (zero) if there is no data and -1 if there is an error.
Description:Verifies if some data is available to be read in the socket without blocking execution of the caller. If nMillisecs is not given, the function returns immediately 1 if there is some data to be read, 0 if there isn't any data and -1 in case of error. If nMillisecs is given, the functon will wait up to that amount of milliseconds for data to be available; if some data arrives in the meanwhile, the wait is immediately interrupted. The next hb_inetRecv() function will read all the available data (up to the required length) without blocking. On error, hb_inetErrorCode() and hb_inetErrorDesc() can be use to determine what kind of error happened.
Examples:
Status:
Compliance:H
Files:
See also:
Back to index


hb_inetDGram

Lang:hbinet.txt
Component:harbour
Doc. source:.\doc\en\hbinet.txt
Template:Function
Category:API
Subcategory:INET
Oneliner:Create a datagram socket
Syntax:hb_inetDGram( [<lBroadcast>] ) -> SOCKET
Arguments:lBroadcast
Returns:An INET socket
Description:Creates a datagram-oriented socket that will be able to send data and eventually receive data. Since the socket is not bound, the program can't retrieve the address at which this socket appaers to be, but a second socket receiving a message sent from this one would be able to reply correctly with a datagram that can be read from a non-bound socket. If lBroadcast is set to .T., the routine creates a broadcast capable socket: it will be able to receive and send broadcast messages. On most systems this requires special user privileges. Returns the socket, and if an error occurs, the socket error message and code are set.
Examples:
Status:
Compliance:H
Files:
See also:
Back to index


hb_inetDGramBind

Lang:hbinet.txt
Component:harbour
Doc. source:.\doc\en\hbinet.txt
Template:Function
Category:API
Subcategory:INET
Oneliner:Create a bound datagram socket
Syntax:hb_inetDGramBind( <nPort>, [<cAddress> [, <lBroadcast>] ] ) -> SOCKET
Arguments:<nPort> <cAddress> <bBroadcast>
Returns:An INET socket
Description:Creates a datagram-oriented socket and binds it to a particular port, and eventually to a certain interface if cAddress is given and not NIL. If lBroadcast is set to .T., the routine creates a broadcast capable socket: it will be able to receive and send broadcast messages. On most systems this requires special user privileges. Returns the socket If an error occurs, the socket error message and code are set.
Examples:
Status:
Compliance:H
Files:
See also:
Back to index


hb_inetDGramRecv

Lang:hbinet.txt
Component:harbour
Doc. source:.\doc\en\hbinet.txt
Template:Function
Category:API
Subcategory:INET
Oneliner:Get data from a datagram socket
Syntax:hb_inetDGramRecv( <socket>, @<cBuffer> [, <nSize> ] ) -> nBytesRead
Arguments:<socket> a socket previously created / opened <cBuffer> is the target buffer and must be passed by reference <nSize>
Returns:Returns number of bytes read, or -1 on error
Description:Reads at maximum nSize bytes incoming from a UDP socket, if nSize is given, or reads at maximum cBuffer length if nSize is not given. There isn't any guarantee that all the data required to be read is really sent from the kernel to the application: the kernel should just return the last complete datagram that has been received, up to nSize bytes.
Examples:
Status:
Compliance:H
Files:
See also:
Back to index


hb_inetDGramSend

Lang:hbinet.txt
Component:harbour
Doc. source:.\doc\en\hbinet.txt
Template:Function
Category:API
Subcategory:INET
Oneliner:Send data to a datagram socket
Syntax:hb_inetDGramSend( <socket>, <cAddress>, <nPort>, <cBuffer> [, <nSize> ] ) -> nBytesSent
Arguments:<socket> a socket previously created / opened <cAddress> <nPort> <cBuffer> <nSize>
Returns:Returns number of bytes sent, or -1 on error
Description:Sends a datagram (a fixed length data) to a determined ip address (cAddress, to be specified in quad-dot notation) and port. If nSize is not specified, all the data in cBuffer will be sent; if nSize is specified, only the first nSize bytes of cBuffer will be sent. There isn't any guarantee that all the data required to be written is really sent to the socket: the calling program should check for the numeric return and send iteratively the unsent data to complete the message. Anyway, the raw datagram is sent and received as once, and any data less than the system datagram size will be sent and received as a single item. If the socket is created in broadcast mode, the cAddress element can be a broadcast address. Returns -1 on error, or the number of bytes actually sent on success.
Examples:
Status:
Compliance:H
Files:
See also:
Back to index


hb_inetErrorCode

Lang:hbinet.txt
Component:harbour
Doc. source:.\doc\en\hbinet.txt
Template:Function
Category:API
Subcategory:INET
Oneliner:Get the last INET error code
Syntax:hb_inetErrorCode( <socket> ) -> nResult
Arguments:<socket> a socket previously created / opened
Returns:Last error code
Description:Returns the last error code that has been provoked by a network operation, or 0 if none. Error codes are the ones used for winsock or UnixSockets (they are the same); 1 is reserved for "connection closed" message.
Examples:
Status:
Compliance:H
Files:
See also:
Back to index


hb_inetErrorDesc

Lang:hbinet.txt
Component:harbour
Doc. source:.\doc\en\hbinet.txt
Template:Function
Category:API
Subcategory:INET
Oneliner:Get the last INET error code description
Syntax:hb_inetErrorDesc( <socket> ) -> cResult
Arguments:<socket> a socket previously created / opened
Returns:System-dependant error string
Description:Returns a string describing the last error that occurred in the socket; the string is system dependent, and should be used only for debugging purposes.
Examples:
Status:
Compliance:H
Files:
See also:
Back to index


hb_inetFD

Lang:hbinet.txt
Component:harbour
Doc. source:.\doc\en\hbinet.txt
Template:Function
Category:API
Subcategory:INET
Oneliner:?
Syntax:hb_inetFD( <socket> [, <lNoSocket> ] ) -> nResult
Arguments:<socket> a socket previously created / opened <lNoSocket>
Returns:?
Description:
Examples:
Status:
Compliance:H
Files:
See also:
Back to index


hb_inetGetAlias

Lang:hbinet.txt
Component:harbour
Doc. source:.\doc\en\hbinet.txt
Template:Function
Category:API
Subcategory:INET
Oneliner:Get an array of aliases of a server
Syntax:hb_inetGetAlias( <cName> ) -> aHosts
Arguments:<cName>
Returns:Array of server aliases
Description:Returns an array containing the aliases ( CNAME DNS records ) by which the server is currently known. Whether this function is able to have the complete list of aliases or not depends on the verbosity of the DNS server.
Examples:
Status:
Compliance:H
Files:
See also:
Back to index


hb_inetGetHosts

Lang:hbinet.txt
Component:harbour
Doc. source:.\doc\en\hbinet.txt
Template:Function
Category:API
Subcategory:INET
Oneliner:Get an array of IP addresses of a host
Syntax:hb_inetGetHosts( <cName> ) -> aHosts
Arguments:<cName>
Returns:An array of IP addresses
Description:Returns an array containing all the IP addresses associated with a given host name. The IP addressess returned by this funtion are strings in quad dot notations, eg "192.168.1.1", and can be directly used into hb_inetConnectIP(). cName can be any string: valid DNS names (eg. "www.myserver.com"), locally available names (e.g. "localhost" or windows Network Neighborhood names), or even IP addresses in quad dot notation. NOTE: This function is not thread safe (by design), and programmers must be sure not to use it at the same time in two different threads, or not to use it together with a hb_inetConnect(). If this kind of situation should ever arise, you are advised to use a thread MUTEX. On error, and if the server can't be found, the function returns NIL.
Examples:
Status:
Compliance:H
Files:
See also:
Back to index


hb_inetGetRcvBufSize

Lang:hbinet.txt
Component:harbour
Doc. source:.\doc\en\hbinet.txt
Template:Function
Category:API
Subcategory:INET
Oneliner:Get the socket receive buffer size
Syntax:hb_inetGetRcvBufSize( <socket> ) -> nResult
Arguments:<socket> a socket previously created / opened
Returns:Returns the socket receive buffer size or -1 if the socket is closed or an error occurs
Description:Returns the socket receive buffer size or -1 if the socket is closed or an error occurs
Examples:
Status:
Compliance:H
Files:
See also:
Back to index


hb_inetGetSndBufSize

Lang:hbinet.txt
Component:harbour
Doc. source:.\doc\en\hbinet.txt
Template:Function
Category:API
Subcategory:INET
Oneliner:Get the socket send buffer size
Syntax:hb_inetGetSndBufSize( <socket> ) -> nResult
Arguments:<socket> a socket previously created / opened
Returns:Returns the socket send buffer size or -1 if the socket is closed or an error occurs
Description:Returns the socket send buffer size or -1 if the socket is closed or an error occurs
Examples:
Status:
Compliance:H
Files:
See also:
Back to index


hb_inetInit

Lang:hbinet.txt
Component:harbour
Doc. source:.\doc\en\hbinet.txt
Template:Function
Category:API
Subcategory:INET
Oneliner:Activate Harbour INET support
Syntax:hb_inetInit() -> lResult
Arguments:(This function has no arguments)
Returns:Returns .T. or .F. whether the internal INET system was successfully initialized
Description:Activates inet support; mainly used for winsock start up at the moment, but could be used in the future for many other purpose. Put it at the beginning of every program using INET functions.
Examples:
Status:
Compliance:H
Files:
See also:
Back to index


hb_inetIsSocket

Lang:hbinet.txt
Component:harbour
Doc. source:.\doc\en\hbinet.txt
Template:Function
Category:API
Subcategory:INET
Oneliner:Get whether a variable is a socket
Syntax:hb_inetIsSocket( <socket> ) -> lResult
Arguments:<socket> a socket previously created / opened
Returns:Returns whether the passed parameter is a socket
Description:
Examples:
Status:
Compliance:H
Files:
See also:
Back to index


hb_inetPeriodCallback

Lang:hbinet.txt
Component:harbour
Doc. source:.\doc\en\hbinet.txt
Template:Function
Category:API
Subcategory:INET
Oneliner:Get or change the periodic callback value of a socket
Syntax:hb_inetPeriodCallback( <socket> [, <xCallback> ] ) -> xPreviousCallback
Arguments:<socket> a socket previously created / opened xCallback a new periodic callback
Returns:The previous periodic callback value
Description:Sets or returns the socket periodic callback value xCallback can be one of: a codeblock, an array of (...), or a (symbol) TODO: describe these better
Examples:
Status:
Compliance:H
Files:
See also:
Back to index


hb_inetPort

Lang:hbinet.txt
Component:harbour
Doc. source:.\doc\en\hbinet.txt
Template:Function
Category:API
Subcategory:INET
Oneliner:Get the port a socket is bound to.
Syntax:hb_inetPort( <socket> ) -> cResult
Arguments:<socket> a socket previously created / opened
Returns:Port name the socket is bound to.
Description:Returns the port to which this socket is bound, or the remote port if this socket is connected with a remote host or client
Examples:
Status:
Compliance:H
Files:
See also:
Back to index


hb_inetRecv

Lang:hbinet.txt
Component:harbour
Doc. source:.\doc\en\hbinet.txt
Template:Function
Category:API
Subcategory:INET
Oneliner:Read from a socket
Syntax:hb_inetRecv( <socket>, @<cResult>, [ <nAmount> ] ) -> nResult
Arguments:<socket> a socket previously created / opened <cResult> is the target buffer and must be passed by reference <nAmount> is the upper limit of characters to be read from the socket. If not passed this defaults to the length of cResult
Returns:The number of the characters read from the socket.
Description:Reads from the socket into a buffer. The parameter cString must be preallocated so that it has enough space to receive the data. The routine will block the thread until some bytes are read from the socket, the socket is closed (either from the receiver or the sender side) or a network error occurs, whichever comes first. In the latter cases, an error is set, and only the characters received until premature end of communications are returned. Notice that there is no guarantee that all the available bytes will be read before the function returns, in fact, hb_inetRecv() returns as soon it is able to fill cString with one or more bytes. To block the current process until the whole cString is filled (or nAmount bytes are read), use the hb_inetRecvAll().
Examples:
Status:
Compliance:H
Files:
See also:
Back to index


hb_inetRecvAll

Lang:hbinet.txt
Component:harbour
Doc. source:.\doc\en\hbinet.txt
Template:Function
Category:API
Subcategory:INET
Oneliner:Read from a socket without blocking
Syntax:hb_inetRecvAll( <socket>, @<cResult>, [ <nAmount> ] ) -> nResult
Arguments:<socket> a socket previously created / opened <cResult> is the target buffer and must be passed by reference <nAmount> is the upper limit of characters to be read from the socket. If not passed this defaults to the length of cResult
Returns:The number of the characters read from the socket. Might be less than nAmount on premature socket closing or on network error.
Description:This function works exactly as hb_inetRecv() except that it blocks until nAmount bytes are read, if nAmount is given, or cString is filled for its whole length.
Examples:
Status:
Compliance:H
Files:
See also:
Back to index


hb_inetRecvEndblock

Lang:hbinet.txt
Component:harbour
Doc. source:.\doc\en\hbinet.txt
Template:Function
Category:API
Subcategory:INET
Oneliner:Read a block from a socket
Syntax:hb_inetRecvEndblock( <socket> [, <cBlock >[, @<nBytesRead> [, <nMaxLength> [, <nBufSize> ]]]] ) -> cResult
Arguments:<socket> a socket previously created / opened <cBlock> <nBytesRead> <nMaxLength> <nBufSize>
Returns:Block read
Description:This function operates exactly the same way as hb_inetRecvLine(), but the "record termination" is customizable through the cBlock parameter. If not given, this parameter defaults to the CRLF sequence. Provided by: Marcelo Lombardo
Examples:
Status:
Compliance:H
Files:
See also:
Back to index


hb_inetRecvLine

Lang:hbinet.txt
Component:harbour
Doc. source:.\doc\en\hbinet.txt
Template:Function
Category:API
Subcategory:INET
Oneliner:Read a line from a socket
Syntax:hb_inetRecvLine( <socket> [, @<nBytesRead>, [, <nMaxLength> [, <nBufSize> ]]] ) -> cResult
Arguments:<socket> a socket previously created / opened <nBytesRead> must be passed by reference <nMaxLength> <nBufSize>
Returns:Line read
Description:Blocks the calling thread until a sequence CRLF is read from the socket. Incremental allocation and end-of-line checking are done in an efficient way. If an error occurs, or if the stream is closed before a CRLF is read, the function returns nothing and sets the socket error. The returned string does not contain the trailing CRLF sequence, so an empty line is effectively returned as an empty string. If the nBytesRead parameter is given, it will contain the number of bytes read from the socket, including the CRLF sequence, so that in normal conditions, nResult will report a count equal to the length of the returned string plus 2. nBytesRead will be 0 if stream is closed before a CRLF sequence is read, and will be -1 on error. An optional nMaxLength parameter can be given to allow a maximum character count before the data is returned anyway. If this number is reached before a CRLF sequence is encountered, nBytesRead will contain the value one. Finally, a nBufSize parameter can be given. If not, memory allocation will be increased by discrete amounts of 80 bytes. The programmer can provide here a different allocation strategy (e.g. setting nBufSize equal to nMaxLength, memory for reading the line will be allocated only once, at the beginning of the function).
Examples:
Status:
Compliance:H
Files:
See also:
Back to index


hb_inetSend

Lang:hbinet.txt
Component:harbour
Doc. source:.\doc\en\hbinet.txt
Template:Function
Category:API
Subcategory:INET
Oneliner:Sent data through a socket
Syntax:hb_inetSend( <socket>, <cBuffer> [, <nLength> ] ) -> nResult
Arguments:<socket> a socket previously created / opened <cBuffer> <nLength>
Returns:The amount of data written, 0 (zero) if the socket is closed, or -1 on an error
Description:Send data being stored in a string over the socket. The nLength parameter can be given to allow writing only a part of the string. There is no guarantee that all of cBuffer will be sent, as this is a decision that is up to the OS; this function does not take care to ensure that the data is really sent; check the returned number and send the part that has not been sent. To ensure that all the data is sent before the function returns, use the hb_inetSendAll() function. On error, the error in the socket is set.
Examples:
Status:
Compliance:H
Files:
See also:
Back to index


hb_inetSendAll

Lang:hbinet.txt
Component:harbour
Doc. source:.\doc\en\hbinet.txt
Template:Function
Category:API
Subcategory:INET
Oneliner:Send data through a socket with blocking
Syntax:hb_inetSendAll( <socket>, <cBuffer> [, <nLength> ] ) -> nResult
Arguments:<socket> a socket previously created / opened <cBuffer> <nLength>
Returns:The amount of data written, 0 (zero) if the socket is closed, or -1 on an error
Description:This function works exactly as hb_inetSend() but it ensures that all the data to be sent is written before returning.
Examples:
Status:
Compliance:H
Files:
See also:
Back to index


hb_inetServer

Lang:hbinet.txt
Component:harbour
Doc. source:.\doc\en\hbinet.txt
Template:Function
Category:API
Subcategory:INET
Oneliner:Create a socket bound to a port
Syntax:hb_inetServer( <port> [, <cBindAddr> [, <nListenLimit> ]] ) -> SOCKET
Arguments:<port> <cBindAddr> <nListenLimit> is an internal parameter and rarely needs to be passed, defaults to 10
Returns:An INET socket
Description:Creates a server that can accept connections from client on a certain port. If the computer on which hb_inetServer() is called has more than one logical interface (e.g. one network card, one loopback and one PPP address), cBindAddr can be specified to select only one of these interfaces to accept connections for this process. This is useful when a server is present on two networks, and the service is to be available only in one of them. Also, the same port on other addresses is left free to be used, so you can have different server programs running for different networks but managing the same service. For example, an FTP server available to the internal network could be radically different from an FTP server available for the internet. nListenLimit is the number of incoming connections accepted by kernel before the kernel has the chance to report them to the application program. If the sockets receive nListenLimit connections before accepting them all, the nListenLimit + 1 connection will be notified to be "busy" by the kernel. The default value of 10 is enough for even a heavy duty server. On error, sets error description in the newly returned socket.
Examples:
Status:
Compliance:H
Files:
See also:
Back to index


hb_inetSetRcvBufSize

Lang:hbinet.txt
Component:harbour
Doc. source:.\doc\en\hbinet.txt
Template:Function
Category:API
Subcategory:INET
Oneliner:Set the receive buffer size of a socket
Syntax:hb_inetSetRcvBufSize( <socket>, nSize ) -> nSize
Arguments:<socket> a socket previously created / opened nSize
Returns:Returns the passed nSize or -1 on error
Description:Sets the receive buffer size of a socket
Examples:
Status:
Compliance:H
Files:
See also:
Back to index


hb_inetSetSndBufSize

Lang:hbinet.txt
Component:harbour
Doc. source:.\doc\en\hbinet.txt
Template:Function
Category:API
Subcategory:INET
Oneliner:Set the send buffer size of a socket
Syntax:hb_inetSetSndBufSize( <socket>, <nSize> ) -> nSize
Arguments:<socket> a socket previously created / opened nSize
Returns:Returns the passed nSize or -1 on error
Description:Sets the send buffer size of a socket
Examples:
Status:
Compliance:H
Files:
See also:
Back to index


hb_inetstatus

Lang:hbinet.txt
Component:harbour
Doc. source:.\doc\en\hbinet.txt
Template:Function
Category:API
Subcategory:INET
Oneliner:Get the status of a socket
Syntax:hb_inetstatus( <socket> ) -> nResult
Arguments:<socket> a socket previously created / opened
Returns:Returns 1 (one) if the socket exists, -1 if it does not
Description:
Examples:
Status:
Compliance:H
Files:
See also:
Back to index


hb_inetTimeLimit

Lang:hbinet.txt
Component:harbour
Doc. source:.\doc\en\hbinet.txt
Template:Function
Category:API
Subcategory:INET
Oneliner:Get or change the time limit value of a socket
Syntax:hb_inetTimeLimit( <socket> [, <nTimeLimit> ) -> NIL
Arguments:<socket> a socket previously created / opened <nTimeLimit>
Returns:Returns the previous time limit value of the socket
Description:Sets or changes the time limit value of the socket.
Examples:
Status:
Compliance:H
Files:
See also:
Back to index


hb_inetTimeout

Lang:hbinet.txt
Component:harbour
Doc. source:.\doc\en\hbinet.txt
Template:Function
Category:API
Subcategory:INET
Oneliner:Get or change the timeout value of a socket
Syntax:hb_inetTimeout( <socket> [, <nTimeout> ] ) -> nPreviousTimeout
Arguments:<socket> a socket previously created / opened <nTimeout> is the new socket timeout value
Returns:Returns the previous timeout value of the socket
Description:Sets or changes the timeout value of the socket.
Examples:
Status:
Compliance:H
Files:
See also:
Back to index


CLIPINIT

Lang:hvm.txt
Component:harbour
Doc. source:.\doc\en\hvm.txt
Template:Function
Category:API
Subcategory:Internal
Oneliner:Initialize various Harbour sub-systems
Syntax:CLIPINIT() --> NIL
Arguments:none.
Returns:CLIPINIT() always return NIL.
Description:CLIPINIT() is one of the pre-defined INIT PROCEDURE and is executed at program startup. It declare an empty MEMVAR PUBLIC array called GetList that is going to be used by the Get system. It activates the default error handler, and (at least for the moment) calls the function that sets the default help key.
Examples:
Status:R
Compliance:It is said that CLIPINIT() should not call the function that sets the default help key since CA-Cl*pper does it in some other place.
Files:
See also:INIT PROCEDURE
Back to index


__mvDbgInfo

Lang:var.txt
Component:harbour
Doc. source:.\doc\en\var.txt
Template:Function
Category:API
Subcategory:Internal
Oneliner:This function returns the information about the variables for debugger
Syntax:__mvDbgInfo( <nScope> [, <nPosition> [, @<cVarName>] ] )
Arguments:<nScope> = the scope of variables for which an information is asked Supported values (defined in hbmemvar.ch) HB_MV_PUBLIC HB_MV_PRIVATE (or any other value) <nPosition> = the position of asked variable on the list of variables with specified scope - it should start from position 1 <cVarName> = the value is filled with a variable name if passed by reference and <nPosition> is specified
Returns:The return value depends on the number of arguments passed
Description:This function retrieves the information about memvar variables. It returns either the number of variables with given scope (when the first argument is passed only) or a value of variable identified by its position in the variables' list (when second argument is passed). It also returns the name of a variable if optional third argument is passed by reference. If requested variable doesn't exist (requested position is greater then the number of defined variables) then NIL value is returned and variable name is set to "?" The dynamic symbols table is used to find a PUBLIC variable then the PUBLIC variables are always sorted alphabetically. The PRIVATE variables are sorted in the creation order. Note: Due to dynamic nature of memvar variables there is no guarantee that successive calls to retrieve the value of <Nth> PUBLIC variable will return the value of the same variable.
Examples:#include "hbmemvar.ch" PROCEDURE Main() LOCAL nCount, i, xValue, cName nCount := __mvDbgInfo( HB_MV_PUBLIC ) FOR i := 1 TO nCount xValue := __mvDbgInfo( HB_MV_PUBLIC, i, @cName ) ? i, cName, xValue NEXT // ? "PUBLIC=", __mvDbgInfo( HB_MV_PUBLIC ) ? "PRIVATE=", __mvDbgInfo( HB_MV_PRIVATE ) PUBLIC cPublic := "cPublic in MAIN" ? "PUBLIC=", __mvDbgInfo( HB_MV_PUBLIC ) ? "PRIVATE=", __mvDbgInfo( HB_MV_PRIVATE ) PRIVATE cPrivate := "cPrivate in MAIN" ? "PUBLIC=", __mvDbgInfo( HB_MV_PUBLIC ) ? "PRIVATE=", __mvDbgInfo( HB_MV_PRIVATE ) CountMemvars() ? "Back in Main" ? "PUBLIC=", __mvDbgInfo( HB_MV_PUBLIC ) ? "PRIVATE=", __mvDbgInfo( HB_MV_PRIVATE ) RETURN PROCEDURE CountMemvars() LOCAL i, nCnt, xVal, cName PUBLIC ccPublic := "ccPublic" PRIVATE ccPrivate := "ccPrivate" ? "In CountMemvars" ? "PUBLIC=", __mvDbgInfo( HB_MV_PUBLIC ) ? "PRIVATE=", __mvDbgInfo( HB_MV_PRIVATE ) PRIVATE cPublic := "cPublic" ? "PUBLIC=", __mvDbgInfo( HB_MV_PUBLIC ) ? "PRIVATE=", __mvDbgInfo( HB_MV_PRIVATE ) nCnt := __mvDbgInfo( HB_MV_PRIVATE ) + 1 FOR i := 1 TO nCnt xVal := __mvDbgInfo( HB_MV_PRIVATE, i, @cName ) ? i, "=", cName, xVal NEXT nCnt := __mvDbgInfo( HB_MV_PUBLIC ) + 1 FOR i := 1 TO nCnt xVal := __mvDbgInfo( HB_MV_PUBLIC, i, @cName ) ? i, "=", cName, xVal NEXT RETURN
Status:R
Compliance:This function should be called from the debugger only.
Files:Library is core
See also:
Back to index


__SetHelpK

Lang:hvm.txt
Component:harbour
Doc. source:.\doc\en\hvm.txt
Template:Procedure
Category:API
Subcategory:Internal
Oneliner:Set F1 as the default help key
Syntax:__SetHelpK()
Arguments:None.
Returns:
Description:Set F1 to execute a function called HELP if such a function is linked into the program.
Examples:
Status:R
Compliance:C
Files:Library is core
See also:__XHelp(), SET KEY, SetKey()
Back to index


__TextRestore

Lang:terminal.txt
Component:harbour
Doc. source:.\doc\en\terminal.txt
Template:Procedure
Category:API
Subcategory:Internal
Oneliner:Restore console output settings as saved by __TextSave()
Syntax:__TextRestore()
Arguments:none.
Returns:
Description:__TextRestore() is used in the preprocessing of the TEXT TO command to restore console output settings that were previously saved by __TextSave().
Examples:
Status:R
Compliance:C52U
Files:Library is core
See also:Set(), SET ALTERNATE, SET PRINTER, TEXT, __TextSave()
Back to index


__TextSave

Lang:terminal.txt
Component:harbour
Doc. source:.\doc\en\terminal.txt
Template:Procedure
Category:API
Subcategory:Internal
Oneliner:Redirect console output to printer or file and save old settings
Syntax:__TextSave( <cFile> )
Arguments:<cFile> is either "PRINTER" (note the uppercase) in which console output is SET to PRINTER, or a name of a text file with a default ".txt" extension, that is used to redirect console output.
Returns:
Description:__TextSave() is used in the preprocessing of the TEXT TO command to redirect the console output while saving old settings that can be restored later by __TextRestore().
Examples:
Status:R
Compliance:C52U
Files:Library is core
See also:Set(), SET ALTERNATE, SET PRINTER, TEXT, __TextRestore()
Back to index


__XHelp

Lang:set.txt
Component:harbour
Doc. source:.\doc\en\set.txt
Template:Function
Category:API
Subcategory:Internal
Oneliner:Determines whether a HELP() user defined function exists.
Syntax:__XHelp() --> <xValue>
Arguments:None
Returns:This function returns aleatory values.
Description:This is an internal undocumented CA-Cl*pper function, which will try to call the user defined function HELP() if it is defined in the current application. This is the default SetKey() handler for the F1 key.
Examples:
Status:R
Compliance:C52U
Files:Library is core
See also:
Back to index


hb_cdpSelect

Lang:lang.txt
Component:harbour
Doc. source:.\doc\en\lang.txt
Template:Function
Category:API
Subcategory:Language and Nation
Oneliner:Select the active code page by language ID
Syntax:hb_cdpSelect( [<cNewLang>] ) --> cOldLang
Arguments:<cNewLang> The optional ID of the language module. Possible values for <cNewLang> are below as defined in the Codepage library, sorted by language. <table> 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 </table>
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() hb_cdpSelect( "EN" ) ? hb_cdpSelect() ? hb_UTF8ToStr( "É < G is" ), hb_BChar( 144 ) < "G" // É > G is .F. hb_cdpSelect( "HU852" ) ? hb_cdpSelect() ? hb_UTF8ToStr( "É < G is" ), hb_BChar( 144 ) < "G" // É > G is .T. RETURN
Status:R
Compliance:This function is a Harbour Extension.
Files:
See also:hb_langName(), hb_langSelect(), hb_Translate(), NationMsg(), REQUEST
Back to index


hb_langErrMsg

Lang:lang.txt
Component:harbour
Doc. source:.\doc\en\lang.txt
Template:Function
Category:API
Subcategory:Language and Nation
Oneliner:Description of an error code using current language
Syntax:hb_langErrMsg( <nErrorCode> ) --> cErrorMessage
Arguments:<nErrorCode> is one of the generic error codes (EG_...) defined in error.ch
Returns:hb_langErrMsg() return the error message string represented by the code <nErrorCode>.
Description:This function return the error message associated with an error code using the current language selected.
Examples:#include "error.ch" REQUEST HB_LANG_ES PROCEDURE Main() // English: Argument error ? "English:", hb_langErrMsg( EG_ARG ) hb_langSelect( "es" ) // Spanish: Error de argumento ? "Spanish:", hb_langErrMsg( EG_ARG ) RETURN
Status:R
Compliance:H
Files:Header is error.ch
See also:hb_langSelect(), NationMsg()
Back to index


hb_langMessage

Lang:lang.txt
Component:harbour
Doc. source:.\doc\en\lang.txt
Template:Function
Category:API
Subcategory:Language and Nation
Oneliner:Returns international strings messages and errors
Syntax:hb_langMessage( <nMsg>[, <cLangID>] ) --> cMessage
Arguments:<nMsg> is the message number to get. <cLangID> is an optional language module ID. Uses the currently selected language module, if not specified.
Returns:hb_langMessage() return the text associated with the code <nMsg>.
Description:hb_langMessage() is similar to NationMsg() but give access to the whole list of language messages: Day and month names, generic error messages, internal errors, and others... Use the header file hblang.ch for a list of base values for <nMsg>.
Examples:#include "hblang.ch" REQUEST HB_LANG_ES PROCEDURE Main() // English: Monday ? "English:", hb_langMessage( HB_LANG_ITEM_BASE_DAY + 1 ) hb_langSelect( "es" ) // Spanish: Lunes ? "Spanish:", hb_langMessage( HB_LANG_ITEM_BASE_DAY + 1 ) ? "English:", hb_langMessage( HB_LANG_ITEM_BASE_DAY + 1, "en" ) RETURN
Status:R
Compliance:H
Files:Header is hblang.ch
See also:hb_langSelect(), NationMsg(), REQUEST
Back to index


hb_langName

Lang:lang.txt
Component:harbour
Doc. source:.\doc\en\lang.txt
Template:Function
Category:API
Subcategory:Language and Nation
Oneliner:Return the name of the language module
Syntax:hb_langName( [<cLangID>] ) --> cLangName
Arguments:<cLangID> is an optional language module ID. Uses the currently selected language module, if not specified.
Returns:<cLangName> Name of the language module
Description:This function return the name of the language module in use or specified.
Examples:REQUEST HB_LANG_PT REQUEST HB_LANG_RO REQUEST HB_LANG_ES REQUEST HB_LANG_HU PROCEDURE Main() ? hb_langName( "hu" ) ? hb_langName( "<non-existent>" ) hb_langSelect( "pt" ) // Default language is now Portuguese ? CDoW( Date() ) // Segunda-feira ? "Current language is ", hb_langName() // Portuguese ? "Old language id selected is ", hb_langSelect() // PT hb_langSelect( "ro" ) // Default language is now Romanian ? CMonth( Date() ) // Mai ? "Old language id selected is ", hb_langSelect() // RO hb_langSelect( "es" ) // Default language is now Spanish ? "Current language is ", hb_langName() // Spanish ? CMonth( Date() ) // Mayo ? CDoW( Date() ) // Lunes RETURN
Status:R
Compliance:H
Files:
See also:hb_langSelect(), NationMsg()
Back to index


hb_langSelect

Lang:lang.txt
Component:harbour
Doc. source:.\doc\en\lang.txt
Template:Function
Category:API
Subcategory:Language and Nation
Oneliner:Select a specific nation message module
Syntax:hb_langSelect( [<cNewLang>][, <cCodepage>] ) --> cOldLang
Arguments:<cNewLang> The optional ID of the language module. Possible values for <cNewLang> are below as defined in the Lang library, sorted by language. <cCodepage> Optional codepage ID into which the language module strings are automatically converted by Harbour. <table> Language <cNewLang> Basque eu Belorussian be Bulgarian bg Catalan ca Chinese Traditional zh Chinese Simplified zh_sim Croatian hr Czech cs Dutch nl Esperanto eo French fr Galician gl German de Greek el Hebrew he Hungarian hu Icelandic is Indonesian id Italian it Korean ko Lithuanian lt Polish pl Portuguese pt Romanian ro Russian ru Serbian (cyrillic) sr_cyr Serbian (latin) sr_lat Slovak sk Slovenian sl Spanish es Swedish sv Turkish tr Ukrainian uk </table>
Returns:<cOldLang> The old language indentifier
Description:This function set a default language module for date/month names, internal warnigs, NatMsg messages and internal errors. When a Lang ID is selected all messages will be output with the current language selected until another one is selected or the program ends. The default language is English (cLang == "EN"). NOTE: You must REQUEST every language module you intend to use. For example: to use the Russian RU866 language you must add the following to your program: REQUEST HB_LANG_RU866
Examples:REQUEST HB_LANG_PT REQUEST HB_LANG_RO REQUEST HB_LANG_ES PROCEDURE Main() hb_langSelect( "pt" ) // Default language is now Portuguese ? CDoW( Date() ) // Segunda-feira ? "Old language id selected is ", hb_langSelect() // PT hb_langSelect( "ro" ) // Default language is now Romanian ? CMonth( Date() ) // Mai ? "Old language id selected is ", hb_langSelect() // RO hb_langSelect( "es" ) // Default language is now Spanish ? CMonth( Date() ) // Mayo ? CDoW( Date() ) // Lunes RETURN
Status:R
Compliance:H
Files:
See also:hb_langName(), hb_cdpSelect(), NationMsg(), REQUEST
Back to index


hb_Translate

Lang:lang.txt
Component:harbour
Doc. source:.\doc\en\lang.txt
Template:Function
Category:API
Subcategory:Language and Nation
Oneliner: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" + hb_BChar( 142 ) + "BC" ? "German CP-850 text:", cTxt ? "German Windows-1252 text:", hb_Translate( cTxt, "DE850", "DEWIN" ) RETURN
Status:R
Compliance:This function is a Harbour Extension.
Files:
See also:hb_langSelect(), hb_cdpSelect(), NationMsg(), REQUEST
Back to index


IsAffirm

Lang:nation.txt
Component:harbour
Doc. source:.\doc\en\nation.txt
Template:Function
Category:API
Subcategory:Language and Nation
Oneliner:Checks if passed char is an affirmation char
Syntax:IsAffirm( <cChar> ) --> <lTrueOrFalse>
Arguments:<cChar> is a char or string of chars </par>
Returns:<lTrueOrFalse> True if passed char is an affirmation char, otherwise false </par>
Description:This function is used to check if a user's input is true or not according to the msgxxx module used. </par>
Examples:// Wait until user enters Y DO WHILE ! IsAffirm( cYesNo ) ACCEPT "Sure: " TO cYesNo ENDDO
Status:R
Compliance:C
Files:Library is core
See also:IsNegative(), NationMsg()
Back to index


IsNegative

Lang:nation.txt
Component:harbour
Doc. source:.\doc\en\nation.txt
Template:Function
Category:API
Subcategory:Language and Nation
Oneliner:Checks if passed char is a negation char.
Syntax:IsNegative( <cChar> ) --> <lTrueOrFalse>
Arguments:<cChar> is a char or string of chars </par>
Returns:<lTrueOrFalse> True if passed char is a negation char, otherwise false. </par>
Description:This function is used to check if a user's input is true or not according to the msgxxx module used. </par>
Examples:// Wait until user enters N DO WHILE ! IsNegative( cYesNo ) ACCEPT "Sure: " TO cYesNo ENDDO
Status:R
Compliance:C
Files:Library is core
See also:IsAffirm(), NationMsg()
Back to index


Language and Nation MSG

Lang:nation.txt
Component:harbour
Doc. source:.\doc\en\nation.txt
Template:Function
Category:API
Subcategory:Language and Nation
Oneliner:Returns international strings messages.
Syntax:Language and Nation MSG( <nMsg> ) --> <cMessage>
Arguments:<nMsg> is the message number you want to get. </par>
Returns:<cMessage> If <nMsg> is a valid message selector, returns the message. If <nMsg> is nil returns "Invalid Argument", and if <nMsg> is any other type it returns an empty string. </par>
Description:Language and Nation MSG() returns international message descriptions. </par>
Examples:// Displays "Sure Y/N: " and waits until user enters Y // Y/N is the string for NationMsg( 12 ) with default natmsg module. DO WHILE ! IsAffirm( cYesNo ) ACCEPT "Sure " + NationMsg( 12 ) + ": " TO cYesNo ENDDO
Status:C
Compliance:C
Files:Library is core
See also:IsAffirm(), IsNegative()
Back to index


hb_SetMacro

Lang:macro.txt
Component:harbour
Doc. source:.\doc\en\macro.txt
Template:Function
Category:API
Subcategory:Macro
Oneliner:Enable/disable the macro compiler runtime features.
Syntax:hb_SetMacro( <nOption>, [<lOnOff>] ) --> <lOldSetting>
Arguments:<nOption> One of the HB_SM_* constants defined in set.ch. <lOnOff> .T. to enable or .F. to disable a feature
Returns:hb_SetMacro() return the old state of requested feature.
Description:This function enables or disables some features of the macro compiler. The Harbour is extending the macro features compared to an original set available in CA-Cl*pper. Enabling/disabling some of them allows to keep strict CA-Cl*pper compatibility. Available features are:</par> <b>HB_SM_HARBOUR</b> - enables harbour extensions: operators: ++, --, +=, -=, *=, /=, ^= objects: assigments to an instance variable <b>HB_SM_XBASE</b> - enables other Xbase++ dialects extensions:</par> expanding of expresions lists <b>HB_SM_SHORTCUTS</b> - enables optimized evaluation of logical operators (.and., .or.) <b>HB_SM_PREPROC</b> - enables preprocessing of commands This is meaningfull if Harbour is compiled with HB_MACRO_STATEMENTS flag
Examples:INIT PROCEDURE IWANTCLIPPER() hb_SetMacro( HB_SM_HARBOUR, .F. ) hb_SetMacro( HB_SM_XBASE, .F. ) RETURN
Status:R
Compliance:H
Files:Header file is set.ch Library is core
See also:Macro compiler
Back to index


Abs

Lang:math.txt
Component:harbour
Doc. source:.\doc\en\math.txt
Template:Function
Category:API
Subcategory:Math
Oneliner:Return the absolute value of a number.
Syntax:Abs( <nNumber> ) --> <nAbsNumber>
Arguments:<nNumber> Any number.
Returns:<nAbsNumber> The absolute numeric value.
Description:This function yields the absolute value of the numeric value or expression <nNumber>.
Examples:PROCEDURE Main() LOCAL nNumber := 50 LOCAL nNumber1 := 27 CLS ? nNumber - nNumber1 ? nNumber1 - nNumber ? Abs( nNumber - nNumber1 ) ? Abs( nNumber1 - nNumber ) ? Abs( -1 * 345 )
Status:R
Compliance:C
Files:Library is core
See also:
Back to index


Exp

Lang:math.txt
Component:harbour
Doc. source:.\doc\en\math.txt
Template:Function
Category:API
Subcategory:Math
Oneliner:Calculates the value of e raised to the passed power.
Syntax:Exp( <nNumber> ) --> <nValue>
Arguments:<nNumber> Any real number.
Returns:<nValue> The anti-logarithm of <nNumber>
Description:This function returns the value of e raised to the power of <nNumber>. It is the inverse of Log().
Examples:? Exp( 45 )
Status:R
Compliance:C
Files:Library is core
See also:Log()
Back to index


hb_matherBlock

Lang:math.txt
Component:harbour
Doc. source:.\doc\en\math.txt
Template:Function
Category:API
Subcategory:Math
Oneliner:Set/Get math error handling codeblock
Syntax:hb_matherBlock( [<bNewBlock>] ) --> <bOldBlock>
Arguments:<bNewBlock>
Returns:<bOldBlock> is the current error handler codeblock
Description:
Examples:
Status:R
Compliance:
Files:Library is core
See also:
Back to index


hb_matherMode

Lang:math.txt
Component:harbour
Doc. source:.\doc\en\math.txt
Template:Function
Category:API
Subcategory:Math
Oneliner:Set/Get math error handling mode
Syntax:hb_matherMode( [<nNewMode>] ) --> <nOldMode>
Arguments:[<nNumber>] new math error handling mode, one of the following constants, defined in hbmath.ch: HB_MATH_ERRMODE_DEFAULT HB_MATH_ERRMODE_CDEFAULT HB_MATH_ERRMODE_USER HB_MATH_ERRMODE_USERDEFAULT HB_MATH_ERRMODE_USERCDEFAULT
Returns:<nOldMode> old math error handling mode
Description:
Examples:
Status:R
Compliance:
Files:Header file is hbmath.ch Library is core
See also:
Back to index


Int

Lang:math.txt
Component:harbour
Doc. source:.\doc\en\math.txt
Template:Function
Category:API
Subcategory:Math
Oneliner:Return the integer port of a numeric value.
Syntax:Int( <nNumber> ) --> <nIntNumber>
Arguments:<nNumber> Any numeric value.
Returns:<nIntNumber> The integer portion of the numeric value.
Description:This function converts a numeric expression to an integer. All decimal digits are truncated. This function does not round a value upward or downward; it merely truncates a number at the decimal point.
Examples:SET DECIMAL TO 5 ? Int( 632512.62541 ) ? Int( 845414111.91440 )
Status:R
Compliance:C
Files:Library is core
See also:Round(), StrZero()
Back to index


Log

Lang:math.txt
Component:harbour
Doc. source:.\doc\en\math.txt
Template:Function
Category:API
Subcategory:Math
Oneliner:Returns the natural logarithm of a number.
Syntax:Log( <nNumber> ) --> <nLog>
Arguments:<nNumber> Any numeric expression.
Returns:<nExponent> The natural logarithm of <nNumber>.
Description:This function returns the natural logarithm of the number <nNumber>. If <nNumber> is 0 or less than 0, a numeric overflow occurs, which is depicted on the display device as a series of asterisks. This function is the inverse of Exp().
Examples:? Log( 632512 )
Status:R
Compliance:C
Files:Library is core
See also:Exp()
Back to index


Max

Lang:math.txt
Component:harbour
Doc. source:.\doc\en\math.txt
Template:Function
Category:API
Subcategory:Math
Oneliner:Returns the maximum of two numbers or dates.
Syntax:Max( <xValue>, <xValue1> ) --> <xMax>
Arguments:<xValue> Any date or numeric value. <xValue1> Any date or numeric value (same type as <xValue>).
Returns:<xMax> The larger numeric (or later date) value.
Description:This function returns the larger of the two passed espressions. If <xValue> and <xValue1> are numeric data types, the value returned by this function will be a numeric data type as well and will be the larger of the two numbers passed to it. If <xValue> and <xValue1> are date data types, the return value will be a date data type as well. It will be the later of the two dates passed to it.
Examples:? Max( 214514214, 6251242142 ) ? Max( hb_SToD( "20001111" ), hb_SToD( "20140621" ) )
Status:R
Compliance:C
Files:Library is core
See also:Min()
Back to index


Min

Lang:math.txt
Component:harbour
Doc. source:.\doc\en\math.txt
Template:Function
Category:API
Subcategory:Math
Oneliner:Determines the minumum of two numbers or dates.
Syntax:Min( <xValue>, <xValue1> ) --> <xMin>
Arguments:<xValue> Any date or numeric value. <xValue1> Any date or numeric value.
Returns:<xMin> The smaller numeric (or earlier date) value.
Description:This function returns the smaller of the two passed espressions. <xValue> and <xValue1> must be the same data type. If numeric, the smaller number is returned. If dates, the earlier date is returned.
Examples:? Min( 214514214, 6251242142 ) ? Min( hb_SToD( "20001111" ), hb_SToD( "20140621" ) )
Status:R
Compliance:C
Files:Library is core
See also:Max()
Back to index


Mod

Lang:math.txt
Component:harbour
Doc. source:.\doc\en\math.txt
Template:Function
Category:API
Subcategory:Math
Oneliner:Return the modulus of two numbers.
Syntax:Mod( <nNumber>, <nNumber1> ) --> <nRemainder>
Arguments:<nNumber> Numerator in a divisional expression. <nNumber1> Denominator in a divisional expression.
Returns:<nRemainder> The remainder after the division operation.
Description:This functuion returns the remainder of one number divided by another.
Examples:? Mod( 12, 8.521 ) ? Mod( 12, 0 ) ? Mod( 62412.5142, 4522114.12014 )
Status:R
Compliance:C
Files:Library is core
See also:%
Back to index


Round

Lang:math.txt
Component:harbour
Doc. source:.\doc\en\math.txt
Template:Function
Category:API
Subcategory:Math
Oneliner:Rounds off a numeric expression.
Syntax:Round( <nNumber>, <nPlace> ) --> <nResult>
Arguments:<nNumber> Any numeric value. <nPlace> The number of places to round to.
Returns:<nResult> The rounded number.
Description:This function rounds off the value of <nNumber> to the number of decimal places specified by <nPlace>. If the value of <nPlace> is a negative number, the function will attempt to round <nNumber> in whole numbers. Numbers from 5 through 9 will be rounded up, all others will be rounded down.
Examples:? Round( 632512.62541, 5 ) ? Round( 845414111.91440, 3 )
Status:R
Compliance:C
Files:Library is core
See also:Int(), Str(), Val(), SET FIXED
Back to index


Sqrt

Lang:math.txt
Component:harbour
Doc. source:.\doc\en\math.txt
Template:Function
Category:API
Subcategory:Math
Oneliner:Calculates the square root of a number.
Syntax:Sqrt( <nNumber> ) --> <nSqrt>
Arguments:<nNumber> Any numeric value.
Returns:<nSqrt> The square root of <number>.
Description:This function returns the square root of <nNumber>. The precision of this evaluation is based solely on the settings of the SET DECIMAL TO command. Any negative number passed as <nNumber> will always return a 0.
Examples:SET DECIMAL TO 5 ? Sqrt( 632512.62541 ) ? Sqrt( 845414111.91440 )
Status:R
Compliance:C
Files:Library is core
See also:Round()
Back to index


__objAddData

Lang:objfunc.txt
Component:harbour
Doc. source:.\doc\en\objfunc.txt
Template:Function
Category:API
Subcategory:Objects
Oneliner:Add a VAR to an already existing class
Syntax:__objAddData( <oObject>, <cDataName> ) --> oObject
Arguments:<oObject> is the object to work on. <cDataName> is the symbol name of the new VAR to add.
Returns:__objAddData() return a reference to <oObject>.
Description:__objAddData() is a low level class support function that add a new VAR to an object. <oObject> is unchanged if a symbol with the name <cDataName> already exist in <oObject>.
Examples:// create a new THappy class and add a lHappy VAR oHappy := HBClass():New( "THappy" ) __objAddData( oHappy, "lHappy" ) oHappy:lHappy := .T. IF oHappy:lHappy ? "Happy, Happy, Joy, Joy !!!" ELSE ? ":(..." ENDIF
Status:R
Compliance:H
Files:Library is core
See also:__objAddInline(), __objAddMethod(), __objDelData(), __objGetMsgList(), __objGetValueList(), __objHasData(), __objSetValueList()
Back to index


__objAddInline

Lang:objfunc.txt
Component:harbour
Doc. source:.\doc\en\objfunc.txt
Template:Function
Category:API
Subcategory:Objects
Oneliner:Add an INLINE to an already existing class
Syntax:__objAddInline( <oObject>, <cInlineName>, <bInline> ) --> oObject
Arguments:<oObject> is the object to work on. <cInlineName> is the symbol name of the new INLINE to add. <bInline> is a code block to associate with the INLINE method.
Returns:__objAddInline() return a reference to <oObject>.
Description:__objAddInline() is a low level class support function that add a new INLINE method to an object. <oObject> is unchanged if a symbol with the name <cInlineName> already exist in <oObject>.
Examples:// create a new THappy class and add a Smile INLINE method oHappy := HBClass():New( "THappy" ) bInline := {| nType | { ":)", ";)", "*SMILE*" }[ nType ] } __objAddInline( oHappy, "Smile", bInline ) ? oHappy:Smile( 1 ) // :) ? oHappy:Smile( 2 ) // ;) ? oHappy:Smile( 3 ) // *SMILE*
Status:R
Compliance:H
Files:Library is core
See also:__objAddData(), __objAddMethod(), __objDelInline(), __objGetMethodList(), __objGetMsgList(), __objHasMethod() , __objModInline()
Back to index


__objAddMethod

Lang:objfunc.txt
Component:harbour
Doc. source:.\doc\en\objfunc.txt
Template:Function
Category:API
Subcategory:Objects
Oneliner:Add a METHOD to an already existing class
Syntax:__objAddMethod( <oObject>, <cMethodName>, <nFuncPtr> ) --> oObject
Arguments:<oObject> is the object to work on. <cMethodName> is the symbol name of the new METHOD to add. <nFuncPtr> is a pointer to a function to associate with the method.
Returns:__objAddMethod() return a reference to <oObject>.
Description:__objAddMethod() is a low level class support function that add a new METHOD to an object. <oObject> is unchanged if a symbol with the name <cMethodName> already exist in <oObject>. Note that <nFuncPtr> is a special pointer to a function that was created using the @ operator, see example below.
Examples:// create a new THappy class and add a Smile method oHappy := HBClass():New( "THappy" ) __objAddMethod( oHappy, "Smile", @MySmile() ) ? oHappy:Smile( 1 ) // :) ? oHappy:Smile( 2 ) // ;) ? oHappy:Smile( 3 ) // *SMILE* STATIC FUNCTION MySmile( nType ) IF HB_ISNUMERIC( nType ) SWITCH nType CASE 1 ; RETURN ":)" CASE 2 ; RETURN ";)" CASE 3 ; RETURN "*SMILE*" ENDSWITCH ENDIF RETURN NIL
Status:R
Compliance:H
Files:Library is core
See also:__objAddInline(), __objAddData(), __objDelMethod(), __objGetMethodList(), __objGetMsgList(), __objHasMethod(), __objModMethod()
Back to index


__objDelData

Lang:objfunc.txt
Component:harbour
Doc. source:.\doc\en\objfunc.txt
Template:Function
Category:API
Subcategory:Objects
Oneliner:Delete a VAR (instance variable) from class
Syntax:__objDelMethod( <oObject>, <cDataName> ) --> oObject
Arguments:<oObject> is the object to work on. <cDataName> is the symbol name of VAR to be deleted (removed) from the object.
Returns:__objDelData() return a reference to <oObject>.
Description:__objDelData() is a low level class support function that delete (remove) a VAR from an object. <oObject> is unchanged if a symbol with the name <cDataName> does not exist in <oObject>.
Examples:// create a new THappy class and add a lHappy VAR oHappy := HBClass():New( "THappy" ) __objAddData( oHappy, "lHappy" ) ? __objHasData( oHappy, "lHappy" ) // .T. // remove lHappy VAR __objDelData( oHappy, "lHappy" ) ? __objHasData( oHappy, "lHappy" ) // .F.
Status:R
Compliance:H
Files:Library is core
See also:__objAddData(), __objGetMsgList(), __objGetValueList(), __objHasData(), __objSetValueList()
Back to index


__objDelInline

Lang:objfunc.txt
Component:harbour
Doc. source:.\doc\en\objfunc.txt
Template:Function
Category:API
Subcategory:Objects
Oneliner:Delete a METHOD INLINE from class
Syntax:__objDelInline( <oObject>, <cSymbol> ) --> oObject
Arguments:<oObject> is the object to work on. <cSymbol> is the symbol name of METHOD or INLINE method to be deleted (removed) from the object.
Returns:__objDelInMethod() return a reference to <oObject>.
Description:__objDelInMethod() is a low level class support function that delete (remove) a METHOD or an INLINE method from an object. <oObject> is unchanged if a symbol with the name <cSymbol> does not exist in <oObject>.
Examples:// create a new THappy class and add a Smile method oHappy := HBClass():New( "THappy" ) __objAddMethod( oHappy, "Smile", @MySmile() ) ? __objHasMethod( oHappy, "Smile" ) // .T. // remove Smile method __objDelInMethod( oHappy, "Smile" ) ? __objHasMethod( oHappy, "Smile" ) // .F. STATIC FUNCTION MySmile( nType ) LOCAL cSmile DO CASE CASE nType == 1 cSmile := ":)" CASE nType == 2 cSmile := ";)" ENDCASE RETURN cSmile
Status:R
Compliance:H
Files:Library is core
See also:__objAddInline(), __objAddMethod(), __objGetMethodList(), __objGetMsgList(), __objHasMethod(), __objModInline(), __objModMethod()
Back to index


__objDelMethod

Lang:objfunc.txt
Component:harbour
Doc. source:.\doc\en\objfunc.txt
Template:Function
Category:API
Subcategory:Objects
Oneliner:Delete a METHOD from class
Syntax:__objDelMethod( <oObject>, <cSymbol> ) --> oObject
Arguments:<oObject> is the object to work on. <cSymbol> is the symbol name of METHOD or INLINE method to be deleted (removed) from the object.
Returns:__objDelMethod() return a reference to <oObject>.
Description:__objDelMethod() is a low level class support function that deletes (removes) a METHOD or an INLINE method from an object. <oObject> is unchanged if a symbol with the name <cSymbol> does not exist in <oObject>. __objDelInline() is exactly the same as __objDelMethod().
Examples:// create a new THappy class and add a Smile method oHappy := HBClass():New( "THappy" ) __objAddMethod( oHappy, "Smile", @MySmile() ) ? __objHasMethod( oHappy, "Smile" ) // .T. // remove Smile method __objDelMethod( oHappy, "Smile" ) ? __objHasMethod( oHappy, "Smile" ) // .F. STATIC FUNCTION MySmile( nType ) LOCAL cSmile DO CASE CASE nType == 1 cSmile := ":)" CASE nType == 2 cSmile := ";)" ENDCASE RETURN cSmile
Status:R
Compliance:H
Files:Library is core
See also:__objAddInline(), __objAddMethod(), __objGetMethodList(), __objGetMsgList(), __objHasMethod(), __objModInline(), __objModMethod()
Back to index


__objDerivedFrom

Lang:objfunc.txt
Component:harbour
Doc. source:.\doc\en\objfunc.txt
Template:Function
Category:API
Subcategory:Objects
Oneliner:Determine whether a class is derived from another class
Syntax:__objDerivedFrom( <oObject>, <xSuper> ) --> lIsParent
Arguments:<oObject> is the object to check. <xSuper> is the object that may be a parent. <xSuper> can be either an Object or a Character string with the class name.
Returns:__objDerivedFrom() return a logical TRUE (.T.) if <oObject> is derived from <xSuper>.
Description:__objDerivedFrom() is a low level class support function that check is one class is a super class of the other, or in other words, does class <oObject> a child or descendant of <xSuper>.
Examples:// Create three classes and check their relations #include "hbclass.ch" PROCEDURE Main() LOCAL oSuper, oObject, oDress oSuper := TMood():New() oObject := THappy():New() oDress := TShirt():New() ? __objDerivedFrom( oObject, oSuper ) // .T. ? __objDerivedFrom( oSuper, oObject ) // .F. ? __objDerivedFrom( oObject, oDress ) // .F. RETURN CREATE CLASS TMood METHOD New() INLINE Self ENDCLASS CREATE CLASS THappy FROM TMood METHOD Smile() INLINE QOut( "*smile*" ) ENDCLASS CREATE CLASS TShirt VAR Color VAR Size METHOD New() INLINE Self ENDCLASS
Status:R
Compliance:H
Files:Library is core
See also:__objHasData(), __objHasMethod()
Back to index


__objGetMethodList

Lang:objfunc.txt
Component:harbour
Doc. source:.\doc\en\objfunc.txt
Template:Function
Category:API
Subcategory:Objects
Oneliner:Return names of all METHOD for a given object
Syntax:__objGetMethodList( <oObject> ) --> aMethodNames
Arguments:<oObject> is an object to scan.
Returns:__objGetMethodList() return an array of character stings with all METHOD names for a given object. __objGetMethodList() would return an empty array {} if the given object does not contain any METHOD.
Description:__objGetMethodList() is a low level class support function that let you find all class functions names for a given object. It is equivalent to __objGetMsgList( oObject, .F. ).
Examples:// show information about TBrowse class oB := TBrowseNew( 0, 0, 24, 79 ) aMethod := __objGetMethodList( oB ) FOR i := 1 TO Len( aMethod ) ? "METHOD name:", aMethod[ i ] NEXT
Status:R
Compliance:H
Files:Library is core
See also:__objGetMsgList(), __objGetValueList(), __objHasData(), __objHasMethod()
Back to index


__objGetMsgList

Lang:objfunc.txt
Component:harbour
Doc. source:.\doc\en\objfunc.txt
Template:Function
Category:API
Subcategory:Objects
Oneliner:Return names of all VAR or METHOD for a given object
Syntax:__objGetMsgList( <oObject>, [<lData>], [nClassType] ) --> aNames
Arguments:<oObject> is an object to scan. <lData> is an optional logical value that specifies the information to return. A value of .T. instruct the function to return list of all VAR names, .F. return list of all METHOD names. Default value is .T. <nClassType> is on optional numeric code for selecting which class type to return. Default value is HB_MSGLISTALL, returning the whole list.
Returns:__objGetMsgList() return an array of character stings with all VAR names or all METHOD names for a given object. __objGetMsgList() would return an empty array {} if the given object does not contain the requested information.
Description:__objGetMsgList() is a low level class support function that let you find all instance variable or method names for a given object. If specified, the following table shows the values for <nClassType> that allow you to distinguish between VAR and CLASS VAR: table> hboo.ch Meaning HB_MSGLISTALL All types HB_MSGLISTCLASS CLASS VAR only HB_MSGLISTPURE VAR only /table> VAR are instance variable usable within each object from a class, where each object has its own VARs. CLASS VAR are shared by all objects from a Class, so the changed value within Object1 will be reflected when accessing the CLASS VAR from Object2.
Examples:// show information about TBrowse class oB := TBrowseNew( 0, 0, 24, 79 ) aData := __objGetMsgList( oB, .T. ) aClassData := __objGetMsgList( oB, .T., HB_MSGLISTCLASS ) aMethod := __objGetMsgList( oB, .F. ) FOR i := 1 TO Len( aData ) ? "VAR name:", aData[ i ] NEXT FOR i := 1 TO Len( aClassData ) ? "CLASS VAR name:", aClassData[ i ] NEXT FOR i := 1 TO Len( aMethod ) ? "METHOD name:", aMethod[ i ] NEXT
Status:R
Compliance:H
Files:Header file is hboo.ch Library is core
See also:__objGetMethodList(), __objGetValueList(), __objHasData(), __objHasMethod()
Back to index


__objGetValueList

Lang:objfunc.txt
Component:harbour
Doc. source:.\doc\en\objfunc.txt
Template:Function
Category:API
Subcategory:Objects
Oneliner:Return an array of VAR names and values for a given object
Syntax:__objGetValueList( <oObject>, [<aExcept>] ) --> aData
Arguments:<oObject> is an object to scan. <aExcept> is an optional array with VAR names you want to exclude from the scan.
Returns:__objGetValueList() return a 2D array that contain pairs of a VAR symbol name and the value of VAR. __objGetValueList() would return an empty array {} if the given object does not contain the requested information.
Description:__objGetValueList() is a low level class support function that return an array with VAR names and value, each array element is a pair of: aData[ i, HB_OO_DATA_SYMBOL ] contain the symbol name aData[ i, HB_OO_DATA_VALUE ] contain the value of DATA
Examples:// show information about TBrowse class oB := TBrowseNew( 0, 0, 24, 79 ) aData := __objGetValueList( oB ) FOR i := 1 TO Len( aData ) ? "VAR name:", aData[ i, HB_OO_DATA_SYMBOL ], ; " value=", aData[ i, HB_OO_DATA_VALUE ] NEXT
Status:R
Compliance:H
Files:Header file is hboo.ch Library is core
See also:__objGetMethodList(), __objGetMsgList(), __objHasData(), __objHasMethod(), __objSetValueList()
Back to index


__objHasData

Lang:objfunc.txt
Component:harbour
Doc. source:.\doc\en\objfunc.txt
Template:Function
Category:API
Subcategory:Objects
Oneliner:Determine whether a symbol exist in object as VAR
Syntax:__objHasData( <oObject>, <cSymbol> ) --> lExist
Arguments:<oObject> is an object to scan. <cSymbol> is the name of the symbol to look for.
Returns:__objHasData() return .T. if the given <cSymbol> exist as VAR (instance variable) in object <oObject), .F. if it does not exist.
Description:__objHasData() is a low level class support function that let you find out if a symbol is an instance variable in a given object.
Examples:oB := TBrowseNew( 0, 0, 24, 79 ) ? __objHasData( oB, "nLeft" ) // this should return .T. ? __objHasData( oB, "lBugFree" ) // hopefully this should be .F. ? __objHasData( oB, "Left" ) // .F. since this is a METHOD
Status:R
Compliance:H
Files:Library is core
See also:__objGetMethodList(), __objGetMsgList(), __objHasMethod()
Back to index


__objHasMethod

Lang:objfunc.txt
Component:harbour
Doc. source:.\doc\en\objfunc.txt
Template:Function
Category:API
Subcategory:Objects
Oneliner:Determine whether a symbol exist in object as METHOD
Syntax:__objHasMethod( <oObject>, <cSymbol> ) --> lExist
Arguments:<oObject> is an object to scan. <cSymbol> is the name of the symbol to look for.
Returns:__objHasMethod() return .T. if the given <cSymbol> exist as METHOD (class function) in object <oObject), .F. if it does not exist.
Description:__objHasMethod() is a low level class support function that let you find out if a symbol is a class function in a given object.
Examples:oB := TBrowseNew( 0, 0, 24, 79 ) ? __objHasMethod( oB, "nLeft" ) // .F. since this is a VAR ? __objHasMethod( oB, "FixBugs" ) // hopefully this should be .F. ? __objHasMethod( oB, "Left" ) // this should return .T.
Status:R
Compliance:H
Files:Library is core
See also:__objGetMethodList(), __objGetMsgList(), __objHasData()
Back to index


__objModInline

Lang:objfunc.txt
Component:harbour
Doc. source:.\doc\en\objfunc.txt
Template:Function
Category:API
Subcategory:Objects
Oneliner:Modify (replace) an INLINE method in an already existing class
Syntax:__objModInline( <oObject>, <cInlineName>, <bInline> ) --> oObject
Arguments:<oObject> is the object to work on. <cInlineName> is the symbol name of the INLINE method to modify. <bInline> is a new code block to associate with the INLINE method.
Returns:__objModInline() return a reference to <oObject>.
Description:__objModInline() is a low level class support function that modify an INLINE method in an object and replace it with a new code block. <oObject> is unchanged if a symbol with the name <cInlineName> does not exist in <oObject>. __objModInline() is used in inheritance mechanism.
Examples:// create a new THappy class and add a Smile INLINE method oHappy := HBClass():New( "THappy" ) bMyInline := {| nType | { ":)", ";)" }[ nType ] } bYourInline := {| nType | { "*SMILE*", "*WINK*" }[ nType ] } __objAddInline( oHappy, "Smile", bMyInline ) ? oHappy:Smile( 1 ) // :) ? oHappy:Smile( 2 ) // ;) // replace Smile inline method with a new code block __objModInline( oHappy, "Smile", bYourInline ) ? oHappy:Smile( 1 ) // *SMILE* ? oHappy:Smile( 2 ) // *WINK*
Status:R
Compliance:H
Files:Library is core
See also:__objAddInline(), __objDelInline(), __objGetMethodList(), __objGetMsgList(), __objHasMethod()
Back to index


__objModMethod

Lang:objfunc.txt
Component:harbour
Doc. source:.\doc\en\objfunc.txt
Template:Function
Category:API
Subcategory:Objects
Oneliner:Modify (replace) a METHOD in an already existing class
Syntax:__objModMethod( <oObject>, <cMethodName>, <nFuncPtr> ) --> oObject
Arguments:<oObject> is the object to work on. <cMethodName> is the symbol name of the METHOD to modify. <nFuncPtr> is a pointer to a new function to associate with the method.
Returns:__objModMethod() return a reference to <oObject>.
Description:__objModMethod() is a low level class support function that modify a METHOD in an object and replace it with a new function. <oObject> is unchanged if a symbol with the name <cMethodName> does not exist in <oObject>. __objModMethod() is used in inheritance mechanism. Note that <nFuncPtr> is a special pointer to a function that was created using the @ operator, see example below.
Examples:// create a new THappy class and add a Smile method oHappy := HBClass():New( "THappy" ) __objAddMethod( oHappy, "Smile", @MySmile() ) ? oHappy:Smile( 1 ) // :) ? oHappy:Smile( 2 ) // ;) // replace Smile method with a new function __objAddMethod( oHappy, "Smile", @YourSmile() ) ? oHappy:Smile( 1 ) // *SMILE* ? oHappy:Smile( 2 ) // *WINK* STATIC FUNCTION MySmile( nType ) LOCAL cSmile DO CASE CASE nType == 1 cSmile := ":)" CASE nType == 2 cSmile := ";)" ENDCASE RETURN cSmile STATIC FUNCTION YourSmile( nType ) LOCAL cSmile DO CASE CASE nType == 1 cSmile := "*SMILE*" CASE nType == 2 cSmile := "*WINK*" ENDCASE RETURN cSmile
Status:R
Compliance:H
Files:Library is core
See also:__objAddMethod(), __objDelMethod(), __objGetMethodList(), __objGetMsgList(), __objHasMethod()
Back to index


__objSetValueList

Lang:objfunc.txt
Component:harbour
Doc. source:.\doc\en\objfunc.txt
Template:Function
Category:API
Subcategory:Objects
Oneliner:Set object with an array of VAR names and values
Syntax:__objSetValueList( <oObject>, <aData> ) --> oObject
Arguments:<oObject> is an object to set. <aData> is a 2D array with a pair of instance variables and values for setting those variable.
Returns:__objSetValueList() return a reference to <oObject>.
Description:__objSetValueList() is a low level class support function that let you set a group of instance variables with values. each array element in <aData> is a pair of: aData[ i, HB_OO_DATA_SYMBOL ] which contain the variable name to set aData[ i, HB_OO_DATA_VALUE ] contain the new variable value.
Examples:// set some TBrowse instance variable oB := TBrowse():New() aData := Array( 4, 2 ) aData[ 1, HB_OO_DATA_SYMBOL ] = "nTop" aData[ 1, HB_OO_DATA_VALUE ] = 1 aData[ 2, HB_OO_DATA_SYMBOL ] = "nLeft" aData[ 2, HB_OO_DATA_VALUE ] = 10 aData[ 3, HB_OO_DATA_SYMBOL ] = "nBottom" aData[ 3, HB_OO_DATA_VALUE ] = 20 aData[ 4, HB_OO_DATA_SYMBOL ] = "nRight" aData[ 4, HB_OO_DATA_VALUE ] = 70 __objSetValueList( oB, aData ) ? oB:nTop // 1 ? oB:nLeft // 10 ? oB:nBottom // 20 ? oB:nRight // 70
Status:R
Compliance:H
Files:Header file is hboo.ch Library is core
See also:__objGetValueList()
Back to index


FieldBlock

Lang:var.txt
Component:harbour
Doc. source:.\doc\en\var.txt
Template:Function
Category:API
Subcategory:RDD
Oneliner:Return a code block that sets/gets a value for a given field
Syntax:FieldBlock( <cFieldName> ) --> bFieldBlock
Arguments:<cFieldName> is a string that contain the field name.
Returns:FieldBlock() return a code block that when evaluate could retrieve a field value or assigning a new value to the field. If <cFieldName> is not specified or from type other than character, FieldBlock() return NIL.
Description:FieldBlock() return a code block that sets/gets the value of field. When this code block is evaluated without any parameters passed then it returns the current value of the given field. If the code block is evaluated with a parameter, than its value is used to set a new value to the field, this value is also return by the block. If the block is evaluate and there is no field with the name <cFieldName> in the current work area, the code block return NIL. Note that FieldBlock() works on the current work area, if you need a specific work area code block use FieldWBlock() instead.
Examples:// open a file named Test that have a field named "name" LOCAL bField bFiled := FieldBlock( "name" ) USE Test ? "Original value of field 'name' :", Eval( bField ) Eval( bField, "Mr X new name" ) ? "New value for the field 'name' :", Eval( bField )
Status:R
Compliance:If the block is evaluate and there is no field with the name <cFieldName> in the current work area, the code block return NIL. CA-Cl*pper would raise BASE/1003 error if the field does not exist.
Files:Library is core
See also:Eval(), FieldWBlock(), MemVarBlock()
Back to index


FieldWBlock

Lang:var.txt
Component:harbour
Doc. source:.\doc\en\var.txt
Template:Function
Category:API
Subcategory:RDD
Oneliner:Return a sets/gets code block for field in a given work area
Syntax:FieldWBlock( <cFieldName>, <nWorkArea> ) --> bFieldBlock
Arguments:<cFieldName> is a string that contain the field name. <nWorkArea> is the work area number in which <cFieldName> exist.
Returns:FieldWBlock() return a code block that when evaluate could retrieve field value or assigning a new value for a field in a given work area. If <cFieldName> is not specified or from type other than character, or if <nWorkArea> is not specified or is not numeric FieldWBlock() return NIL.
Description:FieldWBlock() return a code block that sets/gets the value of field from a given work area. When this code block is evaluated without any parameters passed then it returns the current value of the given field. If the code block is evaluated with a parameter, than its value is used to set a new value to the field, this value is also return by the block. If the block is evaluate and there is no field with the name <cFieldName> in work area number <nWorkArea>, the code block return NIL.
Examples:LOCAL bField // this block work on the field "name" that exist on work area 2 bFiled := FieldBlock( "name", 2 ) // open a file named One in work area 1 // that have a field named "name" SELECT 1 USE one // open a file named Two in work area 2 // it also have a field named "name" SELECT 2 USE two SELECT 1 ? "Original names: ", One->name, Two->name ? "Name value for file Two :", Eval( bField ) Eval( bField, "Two has new name" ) ? "and now: ", One->name, Two->name
Status:R
Compliance:If the block is evaluate and there is no field with the name <cFieldName> in the given work area, the code block return NIL. CA-Cl*pper would raise BASE/1003 error if the field does not exist.
Files:Library is core
See also:Eval(), FieldBlock(), MemVarBlock()
Back to index


AllTrim

Lang:string.txt
Component:harbour
Doc. source:.\doc\en\string.txt
Template:Function
Category:API
Subcategory:Strings
Oneliner:Removes leading and trailing blank spaces from a string
Syntax:AllTrim( <cString> ) --> cExpression
Arguments:<cString> Any character string
Returns:<cExpression> An string will all blank spaces removed from <cString>
Description:This function returns the string <cExpression> will all leading and trailing blank spaces removed.
Examples:? AllTrim( "Hello Harbour" ) ? AllTrim( " Hello Harbour" ) ? AllTrim( "Hello Harbour " ) ? AllTrim( " hello Harbour " )
Status:R
Compliance:C
Files:Library is core
See also:LTrim(), RTrim(), Trim()
Back to index


Asc

Lang:string.txt
Component:harbour
Doc. source:.\doc\en\string.txt
Template:Function
Category:API
Subcategory:Strings
Oneliner:Returns the ASCII value of a character
Syntax:Asc( <cCharacter> ) --> nAscNumber
Arguments:<cCharacter> Any character expression
Returns:<nAscNumber> ASCII value
Description:This function return the ASCII value of the leftmost character of any character expression passed as <cCharacter>.
Examples:? Asc( "A" ) ? Asc( "¹" )
Status:R
Compliance:C
Files:Library is core
See also:Chr()
Back to index


At

Lang:string.txt
Component:harbour
Doc. source:.\doc\en\string.txt
Template:Function
Category:API
Subcategory:Strings
Oneliner:Locates the position of a substring in a main string.
Syntax:At( <cSearch>, <cString> ) --> nPos
Arguments:<cSearch> Substring to search for <cString> Main string
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.
Examples:? 'At( "cde", "abcdefgfedcba" ) = ' + ; Str( At( "cde", "abcdefgfedcba" ) ) // 3
Status:R
Compliance:C
Files:Library is core
See also:RAt()
Back to index


Chr

Lang:string.txt
Component:harbour
Doc. source:.\doc\en\string.txt
Template:Function
Category:API
Subcategory:Strings
Oneliner:Converts an ASCII value to it character value
Syntax:Chr( <nAsciiNum> ) --> cReturn
Arguments:<nAsciiNum> Any ASCII character code.
Returns:<cReturn> Character expression of that ASCII value
Description:This function returns the ASCII character code for <nAsciiNum>. The number expressed must be an integer value within the range of 0 to 255 inclusive. The Chr() function will send the character returned to whatever device is presently set. The Chr() function may be used for printing special codes as well as normal and graphics character codes.
Examples:? Chr( 32 ) ? Chr( 65 )
Status:R
Compliance:C
Files:Library is core
See also:Asc(), Inkey()
Back to index


HardCR

Lang:memo.txt
Component:harbour
Doc. source:.\doc\en\memo.txt
Template:Function
Category:API
Subcategory:Strings
Oneliner:Replace all soft carriage returns with hard carriages returns.
Syntax:HardCR( <cString> ) --> <cConvertedString>
Arguments:<cString> is a string of chars to convert.
Returns:<cConvertedString> Transformed string.
Description:Returns a string/memo with soft carriage return chars converted to hard carriage return chars.
Examples:? HardCR( Data->CNOTES )
Status:R
Compliance:C
Files:Library is core
See also:MemoTran(), StrTran()
Back to index


hb_At

Lang:string.txt
Component:harbour
Doc. source:.\doc\en\string.txt
Template:Function
Category:API
Subcategory:Strings
Oneliner:Locates the position of a substring in a main string.
Syntax:hb_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:hb_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:? 'hb_At( "cde", "abcdefgfedcba" ) = ' + ; Str( hb_At( "cde", "abcdefgfedcba" ) ) // 3 ? 'hb_At( "cde", "abcdefgfedcba" ) = ' + ; Str( hb_At( "cde", "abcdefgfedcba", 4 ) ) // 0
Status:R
Compliance:This function is sensitive to HB_CLP_STRICT settings during build. <nStart> and <nEnd> are Harbour extensions and do not exist if HB_CLP_STRICT is defined. In that case, the whole string is searched.
Files:Library is core
See also:hb_RAt()
Back to index


hb_MemoRead

Lang:memo.txt
Component:harbour
Doc. source:.\doc\en\memo.txt
Template:Function
Category:API
Subcategory:Strings
Oneliner:Return the text file's contents as a character string
Syntax:hb_MemoRead( <cFileName> ) --> cString
Arguments:<cFileName> is the filename to read from disk. It must include the file extension. If file to be read lives in another directory, you must include the path.
Returns:Returns the contents of a text file as a character string. If <cFileName> cannot be found or read HB_MEMOREAD returns an empty string ("").
Description:hb_MemoRead() is a function that reads the content of a text file (till now) from disk (floppy, HD, CD-ROM, etc.) into a memory string. In that way you can manipulate as any character string or assigned to a memo field to be saved in a database. hb_MemoRead() function is used together with MemoEdit() and hb_MemoWrit() to get from disk text from several sources that would be edited, searched, replaced, displayed, etc. It is used to import data from other sources to our database. Note: hb_MemoRead() does not use the settings SET DEFAULT or SET PATH to search for <cFileName>. It searches for <cFileName> in the current directory. Over a network, hb_MemoRead() attempts to open <cFileName> in read-only mode and shared. If the file is used in mode exclusive by another process, the function will returns a null string (""). hb_MemoRead() vs MemoRead(): hb_MemoRead() is identical to MemoRead() except it won't truncate the last byte (on non-UNIX compatible systems) if it's a EOF char.
Examples:// This example uses hb_MemoRead() to assign the contents of a text // file to a character variable for later search cFile := "account.prg" cString := hb_MemoRead( cFile ) cCopyright := "Melina" IF At( "Melina", cString ) == 0 // check for copyright hb_MemoWrit( cFile, cCopyright + cString ) // if not, add it! ENDIF
Status:R
Compliance:C
Files:Library is core
See also:MemoEdit(), hb_MemoWrit(), REPLACE, MemoRead()
Back to index


hb_MemoWrit

Lang:memo.txt
Component:harbour
Doc. source:.\doc\en\memo.txt
Template:Function
Category:API
Subcategory:Strings
Oneliner:Write a memo field or character string to a text file on disk
Syntax:hb_MemoWrit( <cFileName>, <cString>, [<lWriteEof>] ) --> lSuccess
Arguments:<cFileName> is the filename to be written to disk. It must include the file extension. If file to be read lives in another directory, you must include the path. <cString> Is the memo field or character string, to be write to <cFile>. <lWriteEof> Is a logic variable that settle if the "end of file" character - Chr( 26 ) - is written to disk. This parameter is optional. By default is true (.T.)
Returns:Function returns true (.T.) if the writing operation was successful; otherwise, it returns false (.F.).
Description:This a function that writes a memo field or character string to a text file on disk (floppy, HD, CD-ROM, etc.) If you not specified a path, hb_MemoWrit() writes <cFileName> to the current directory. If <cFileName> exists, it is overwritten. There is a third parameter (optional), <lWriteEof>, (not found in CA-Cl*pper) which let to programmer change the default behavior of - always - to write the EOF character, Chr( 26 ) as in CA-Cl*pper. If there is no third parameter, nothing change, EOF is written as in CA-Cl*pper, the same occurs when <lWriteEof> is set to .T. But, if <lWriteEof> is set to .F., EOF char is Not written to the end of the file. hb_MemoWrit() function is used together with hb_MemoRead() and MemoEdit() to save to disk text from several sources that was edited, searched, replaced, displayed, etc. Note that hb_MemoWrit() do not use the directory settings SET DEFAULT. hb_MemoWrit() vs MemoWrit(): hb_MemoWrit() never writes the obsolete EOF char at the end of the file.
Examples:// This example uses hb_MemoWrit() to write the contents of a character // variable to a text file. cFile := "account.prg" cString := hb_MemoRead( cFile ) cCopyright := "Melina" IF At( "Melina", cString ) == 0 // check for copyright hb_MemoWrit( cFile, cCopyright + cString ) // if not, add it! ENDIF
Status:R
Compliance:C
Files:Library is core
See also:MemoEdit(), MemoRead(), hb_MemoWrit()
Back to index


hb_RAt

Lang:string.txt
Component:harbour
Doc. source:.\doc\en\string.txt
Template:Function
Category:API
Subcategory:Strings
Oneliner: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
Status:R
Compliance:C
Files:Library is core
See also:hb_At(), SubStr(), Right(), RAt()
Back to index


hb_ValToStr

Lang:string.txt
Component:harbour
Doc. source:.\doc\en\string.txt
Template:Function
Category:API
Subcategory:Strings
Oneliner:Converts any scalar type to a string.
Syntax:hb_ValToStr( <xValue> ) --> cString
Arguments:<xValue> is any scalar argument.
Returns:<cString> A string representation of <xValue> using default conversions.
Description:hb_ValToStr() can be used to convert any scalar value to a string.
Examples:Set( _SET_DATEFORMAT, "yyyy-mm-dd" ) ? hb_ValToStr( 4 ) == " 4" ? hb_ValToStr( 4.0 / 2 ) == " 2.00" ? hb_ValToStr( "String" ) == "String" ? hb_ValToStr( hb_SToD( "20010101" ) ) == "2001-01-01" ? hb_ValToStr( NIL ) == "NIL" ? hb_ValToStr( .F. ) == ".F." ? hb_ValToStr( .T. ) == ".T."
Status:R
Compliance:H
Files:Library is core
See also:Str()
Back to index


IsAlpha

Lang:string.txt
Component:harbour
Doc. source:.\doc\en\string.txt
Template:Function
Category:API
Subcategory:Strings
Oneliner:Checks if leftmost character in a string is an alphabetic character
Syntax:IsAlpha( <cString> ) --> lAlpha
Arguments:<cString> Any character string
Returns:lAlpha Logical true (.T.) or false (.F.).
Description:This function return a logical true (.T.) if the first character in <cString> is an alphabetic character. If not, the function will return a logical false (.F.).
Examples:? 'IsAlpha( "hello" ) = ', IsAlpha( "hello" ) ? 'IsAlpha( "12345" ) = ', IsAlpha( "12345" )
Status:R
Compliance:C
Files:Library is core
See also:IsDigit(), IsLower(), IsUpper(), Lower(), Upper()
Back to index


IsDigit

Lang:string.txt
Component:harbour
Doc. source:.\doc\en\string.txt
Template:Function
Category:API
Subcategory:Strings
Oneliner:Checks if leftmost character is a digit character
Syntax:IsDigit( <cString> ) --> lDigit
Arguments:<cString> Any character string
Returns:lDigit Logical true (.T.) or false (.F.).
Description:This function takes the character string <cString> and checks to see if the leftmost character is a digit, from 1 to 9. If so, the function will return a logical true (.T.); otherwise, it will return a logical false (.F.).
Examples:? IsDigit( "12345" ) // .T. ? IsDigit( "abcde" ) // .F.
Status:R
Compliance:C
Files:Library is core
See also:IsAlpha(), IsLower(), IsUpper(), Lower(), Upper()
Back to index


IsLower

Lang:string.txt
Component:harbour
Doc. source:.\doc\en\string.txt
Template:Function
Category:API
Subcategory:Strings
Oneliner:Checks if leftmost character is an lowercased letter.
Syntax:IsLower( <cString> ) --> lLower
Arguments:<cString> Any character string
Returns:lLower Logical true (.T.) or false (.F.).
Description:This function takes the character string <cString> and checks to see if the leftmost character is a lowercased letter. If so, the function will return a logical true (.T.); otherwise, it will return a logical false (.F.).
Examples:? IsLower( "ABCde" ) // .F. ? IsLower( "aBCde" ) // .T.
Status:R
Compliance:C
Files:Library is core
See also:IsAlpha(), IsDigit(), IsUpper(), Lower(), Upper()
Back to index


IsUpper

Lang:string.txt
Component:harbour
Doc. source:.\doc\en\string.txt
Template:Function
Category:API
Subcategory:Strings
Oneliner:Checks if leftmost character is an uppercased letter.
Syntax:IsUpper( <cString> ) --> lUpper
Arguments:<cString> Any character string
Returns:lUpper Logical true (.T.) or false (.F.).
Description:This function checks to see if the leftmost character if <cString> is a uppercased letter. If so, the function will return a logical true (.T.); otherwise, it will return a logical false (.F.).
Examples:? IsUpper( "Abcde" ) // .T. ? IsUpper( "abcde" ) // .F.
Status:R
Compliance:C
Files:Library is core
See also:IsAlpha(), IsLower(), IsDigit(), Lower(), Upper()
Back to index


Left

Lang:string.txt
Component:harbour
Doc. source:.\doc\en\string.txt
Template:Function
Category:API
Subcategory:Strings
Oneliner: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
Status:R
Compliance:C
Files:Library is core
See also:SubStr(), Right(), At(), RAt()
Back to index


Lower

Lang:string.txt
Component:harbour
Doc. source:.\doc\en\string.txt
Template:Function
Category:API
Subcategory:Strings
Oneliner:Universally lowercases a character string expression.
Syntax:Lower( <cString> ) --> cLowerString
Arguments:<cString> Any character expression.
Returns:<cLowerString> Lowercased value of <cString>
Description:This function converts any character expression passes as <cString> to its lowercased representation. Any non alphabetic character withing <cString> will remain unchanged.
Examples:? Lower( "HARBOUR" ) // harbour ? Lower( "Hello All" ) // hello all
Status:R
Compliance:C
Files:Library is core
See also:Upper(), IsLower(), IsUpper()
Back to index


LTrim

Lang:string.txt
Component:harbour
Doc. source:.\doc\en\string.txt
Template:Function
Category:API
Subcategory:Strings
Oneliner:Removes leading spaces from a string
Syntax:LTrim( <cString> ) --> cReturn
Arguments:<cString> Character expression with leading spaces
Returns:LTrim() returns a copy of the original string with leading spaces removed.
Description:This function trims the leading space blank
Examples:? LTrim( "Hello " )
Status:R
Compliance:C
Files:Library is core
See also:Trim(), RTrim(), AllTrim()
Back to index


MemoRead

Lang:memo.txt
Component:harbour
Doc. source:.\doc\en\memo.txt
Template:Function
Category:API
Subcategory:Strings
Oneliner:Return the text file's contents as a character string
Syntax:MemoRead( <cFileName> ) --> cString
Arguments:<cFileName> is the filename to read from disk. It must include the file extension. If file to be read lives in another directory, you must include the path.
Returns:Returns the contents of a text file as a character string. If <cFileName> cannot be found or read MEMOREAD returns an empty string ("").
Description:MemoRead() is a function that reads the content of a text file (till now) from disk (floppy, HD, CD-ROM, etc.) into a memory string. In that way you can manipulate as any character string or assigned to a memo field to be saved in a database. MemoRead() function is used together with MemoEdit() and MemoWrit() to get from disk text from several sources that would be edited, searched, replaced, displayed, etc. It is used to import data from other sources to our database. Note: MemoRead() does not use the settings SET DEFAULT or SET PATH to search for <cFileName>. It searches for <cFileName> in the current directory. Over a network, MemoRead() attempts to open <cFileName> in read-only mode and shared. If the file is used in mode exclusive by another process, the function will returns a null string ("").
Examples:// This example uses MemoRead() to assign the contents of a text // file to a character variable for later search cFile := "account.prg" cString := MemoRead( cFile ) cCopyright := "Melina" IF At( "Melina", cString ) == 0 // check for copyright MemoWrit( cFile, cCopyright + cString ) // if not, add it! ENDIF
Status:R
Compliance:C
Files:Library is core
See also:MemoEdit(), MemoWrit(), REPLACE, hb_MemoRead()
Back to index


MemoTran

Lang:memo.txt
Component:harbour
Doc. source:.\doc\en\memo.txt
Template:Function
Category:API
Subcategory:Strings
Oneliner:Converts hard and soft carriage returns within strings.
Syntax:MemoTran( <cString>, <cHard>, <cSoft> ) --> <cConvertedString>
Arguments:<cString> is a string of chars to convert. <cHard> is the character to replace hard returns with. If not specified defaults to semicolon. <cSoft> is the character to replace soft returns with. If not specified defaults to single space.
Returns:<cConvertedString> Transformed string.
Description:Returns a string/memo with carriage return chars converted to specified chars.
Examples:? MemoTran( DATA->CNOTES )
Status:R
Compliance:C
Files:Library is core
See also:HardCR(), StrTran()
Back to index


MemoWrit

Lang:memo.txt
Component:harbour
Doc. source:.\doc\en\memo.txt
Template:Function
Category:API
Subcategory:Strings
Oneliner:Write a memo field or character string to a text file on disk
Syntax:MemoWrit( <cFileName>, <cString> ) --> lSuccess
Arguments:<cFileName> is the filename to be written to disk. It must include the file extension. If file to be read lives in another directory, you must include the path. <cString> Is the memo field or character string, to be write to <cFile>.
Returns:Function returns true (.T.) if the writing operation was successful; otherwise, it returns false (.F.).
Description:This a function that writes a memo field or character string to a text file on disk (floppy, HD, CD-ROM, etc.) If you not specified a path, MemoWrit() writes <cFileName> to the current directory. If <cFileName> exists, it is overwritten. There is a third parameter (optional), <lWriteEof>, (not found in CA-Cl*pper) which let to programmer change the default behavior of - always - to write the EOF character, Chr( 26 ) as in CA-Cl*pper. MemoWrit() function is used together with MemoRead() and MemoEdit() to save to disk text from several sources that was edited, searched, replaced, displayed, etc. Note that MemoWrit() do not use the directory settings SET DEFAULT.
Examples:// This example uses MemoWrit() to write the contents of a character // variable to a text file. cFile := "account.prg" cString := MemoRead( cFile ) IF At( "Melina", cString ) == 0 // check for copyright MemoWrit( cFile, cCopyright + cString ) // if not, add it! ENDIF
Status:R
Compliance:C
Files:Library is core
See also:MemoEdit(), MemoRead(), hb_MemoWrit()
Back to index


PadC

Lang:string.txt
Component:harbour
Doc. source:.\doc\en\string.txt
Template:Function
Category:API
Subcategory:Strings
Oneliner:Centers an expression for a given width
Syntax:PadC( <xVal>, <nWidth>, <cFill> ) --> cString
Arguments:<xVal> A Number, Character or Date value to pad <nWidth> Width of output string <cFill> Character to fill in the string
Returns:<cString> The Center string of <xVal>
Description:This function takes an date, number or character expression <xVal> and attempt to center the expression within a string of a given width expressed as <nWidth>. The default character used to pad either side of <xVal> will be a blank space. This character may be explicitly specified the value of <cFill>. If the length of <xVal> is longer then <nWidth>, this function will truncate the string <xVal> from the leftmost side to the length of <nWidth>.
Examples:? PadC( "Harbour", 20 ) ? PadC( 34.5142, 20 ) ? PadC( Date(), 35 )
Status:R
Compliance:C
Files:Library is core
See also:AllTrim(), PadL(), PadR()
Back to index


PadL

Lang:string.txt
Component:harbour
Doc. source:.\doc\en\string.txt
Template:Function
Category:API
Subcategory:Strings
Oneliner:Left-justifies an expression for a given width
Syntax:PadL( <xVal>, <nWidth>, <cFill> ) --> cString
Arguments:<xVal> An number, Character or date to pad <nWidth> Width of output string <cFill> Character to fill in the string
Returns:<cString> The left-justifies string of <xVal>
Description:This function takes an date, number, or character expression <xVal> and attempt to left-justify it within a string of a given width expressed as <nWidth>. The default character used to pad left side of <xVal> will be an blank space; however, this character may be explicitly specified the value of <cFill>. If the length of <xVal> is longer then <nWidth>, this function will truncate the string <xVal> from the leftmost side to the length of <nWidth>.
Examples:? PadL( "Harbour", 20 ) ? PadL( 34.5142, 20 ) ? PadL( Date(), 35 )
Status:R
Compliance:C
Files:Library is core
See also:AllTrim(), PadC(), PadR()
Back to index


PadR

Lang:string.txt
Component:harbour
Doc. source:.\doc\en\string.txt
Template:Function
Category:API
Subcategory:Strings
Oneliner:Right-justifies an expression for a given width
Syntax:PadR( <xVal>, <nWidth>, <cFill> ) --> cString
Arguments:<xVal> A Number, Character or Date value to pad <nWidth> Width of output string <cFill> Character to fill in the string
Returns:<cString> The right-justifies string of <xVal>
Description:This function takes an date, number, or character expression <xVal> and attempt to right-justify it within a string of a given width expressed as <nWidth>. The default character used to pad right side of <xVal> will be an blank space; however, this character may be explicitly specified the value of <cFill>. If the length of <xVal> is longer then <nWidth>, this function will truncate the string <xVal> from the leftmost side to the length of <nWidth>.
Examples:? PadR( "Harbour", 20 ) ? PadR( 34.5142, 20 ) ? PadR( Date(), 35 )
Status:R
Compliance:C
Files:Library is core
See also:AllTrim(), PadC(), PadL()
Back to index


RAt

Lang:string.txt
Component:harbour
Doc. source:.\doc\en\string.txt
Template:Function
Category:API
Subcategory:Strings
Oneliner:Searches for last occurrence a substring 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 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.
Examples:? 'RAt( "cde", "abcdefgfcdeedcba" ) = ' + ; hb_ntos( RAt( "cde", "abcdefgfcdeedcba" ) ) // 9 ? 'RAt( "cdr", "abcdefgfedcba" ) = ' + ; hb_ntos( RAt( "cdr", "abcdefgfedcba" ) ) // 0
Status:R
Compliance:C
Files:Library is core
See also:At(), SubStr(), Right(), hb_RAt()
Back to index


Replicate

Lang:string.txt
Component:harbour
Doc. source:.\doc\en\string.txt
Template:Function
Category:API
Subcategory:Strings
Oneliner:Repeats a single character expression
Syntax:Replicate( <cString>, <nSize> ) --> cReplicateString
Arguments:<cString> Character string to be replicated <nSize> Number of times to replicate <cString>
Returns:<cReplicateString> A character expression contain the <cString> fill character.
Description:This function returns a string composed of <nSize> repetitions of <cString>. The length of the character string returned by this function is limited to the memory available. A value of 0 for <nSize> will return a NULL string.
Examples:? Replicate( "a", 10 ) // aaaaaaaaaa ? Replicate( "b", 100000 )
Status:R
Compliance:C
Files:Library is core
See also:Space(), PadC(), PadL(), PadR()
Back to index


Right

Lang:string.txt
Component:harbour
Doc. source:.\doc\en\string.txt
Template:Function
Category:API
Subcategory:Strings
Oneliner:Extract the rightmost substring of a character expression
Syntax:Right( <cString>, <nLen> ) --> cReturn
Arguments:<cString> Character expression to be parsed <nLen> Number of bytes to return beginning at the rightmost position
Returns:<cReturn> Substring of evaluation
Description:This functions returns the rightmost <nLen> characters of <cString>. It is equivalent to the following expressions: SubStr( <cString>, - <nLen> ) SubStr( <cString>, Len( <cString> ) - <nLen> + 1, <nLen> )
Examples:? Right( "Hello Harbour", 5 ) // rbour
Status:R
Compliance:C
Files:Library is core
See also:SubStr(), Left(), At(), RAt()
Back to index


RTrim

Lang:string.txt
Component:harbour
Doc. source:.\doc\en\string.txt
Template:Function
Category:API
Subcategory:Strings
Oneliner:Remove trailing spaces from a string.
Syntax:RTrim( <cExpression> ) --> cString
Arguments:<cExpression> Any character expression
Returns:<cString> A formatted string with out any blank spaced.
Description:This function returns the value of <cString> with any trailing blank removed. This function is identical to RTrim() and the opposite of LTrim(). Together with LTrim(), this function equated to the AllTrim() function.
Examples:? RTrim( "Hello" ) // "Hello" ? RTrim( "" ) // "" ? RTrim( "UA " ) // "UA" ? RTrim( " UA" ) // " UA"
Status:R
Compliance:C
Files:Library is core
See also:AllTrim(), LTrim(), Trim()
Back to index


Space

Lang:string.txt
Component:harbour
Doc. source:.\doc\en\string.txt
Template:Function
Category:API
Subcategory:Strings
Oneliner:Returns a string of blank spaces
Syntax:Space( <nSize> ) --> cString
Arguments:<nSize> The length of the string
Returns:<cString> A string containing blank spaces
Description:This function returns a string consisting of <nSize> blank spaces. If the value of <nSize> is 0, a NULL string ( "" ) will be returned. This function is useful to declare the length of a character memory variable.
Examples:PROCEDURE Main() LOCAL cBigString LOCAL cFirst LOCAL cString := Space( 20 ) // Create an character memory variable // with length 20 ? Len( cString ) // 20 cBigString := Space( 100000 ) // create a memory variable with 100000 // blank spaces ? Len( cBigString ) USE tests NEW cFirst := MakeEmpty( 1 ) ? Len( cFirst ) RETURN FUNCTION MakeEmpty( xField ) LOCAL nRecord LOCAL xRetValue IF ! Empty( Alias() ) nRecord := RecNo() dbGoto( 0 ) IF ValType( xField ) == "C" xField := AScan( dbStruct(), {| aFields | aFields[ 1 ] == Upper( xfield ) } ) ELSE DEFAULT xField TO 0 IF xField < 1 .OR. xField > FCount() xfield := 0 ENDIF ENDIF IF !( xfield == 0 ) xRetvalue := FieldGet( xfield ) ENDIF dbGoto( nrecord ) ENDIF RETURN xRetvalue
Status:R
Compliance:C
Files:Library is core
See also:PadC(), PadL(), PadR(), Replicate()
Back to index


Str

Lang:string.txt
Component:harbour
Doc. source:.\doc\en\string.txt
Template:Function
Category:API
Subcategory:Strings
Oneliner:Convert a numeric expression to a character string.
Syntax:Str( <nNumber>, [<nLength>], [<nDecimals>] ) --> cNumber
Arguments:<nNumber> is the numeric expression to be converted to a character string. <nLength> is the length of the character string to return, including decimal digits, decimal point, and sign. <nDecimals> is the number of decimal places to return.
Returns:Str() returns <nNumber> formatted as a character string. If the optional length and decimal arguments are not specified, Str() returns the character string according to the following rules: Results of Str() with No Optional Arguments <table> Expression Return Value Length Field Variable Field length plus decimals Expressions/constants Minimum of 10 digits plus decimals Val() Minimum of 3 digits Month()/Day() 3 digits Year() 5 digits RecNo() 7 digits </table>
Description:Str() is a numeric conversion function that converts numeric values to character strings. It is commonly used to concatenate numeric values to character strings. Str() has applications displaying numbers, creating codes such as part numbers from numeric values, and creating index keys that combine numeric and character data. Str() is like Transform(), which formats numeric values as character strings using a mask instead of length and decimal specifications. The inverse of Str() is Val(), which converts character numbers to numerics. * If <nLength> is less than the number of whole number digits in <nNumber>, Str() returns asterisks instead of the number. * If <nLength> is less than the number of decimal digits required for the decimal portion of the returned string, Harbour rounds the number to the available number of decimal places. * If <nLength> is specified but <nDecimals> is omitted (no decimal places), the return value is rounded to an integer.
Examples:? Str( 10, 6, 2 ) // " 10.00" ? Str( -10, 8, 2 ) // " -10.00"
Status:R
Compliance:C
Files:Library is core
See also:StrZero(), Transform(), Val()
Back to index


StrTran

Lang:string.txt
Component:harbour
Doc. source:.\doc\en\string.txt
Template:Function
Category:API
Subcategory:Strings
Oneliner:Translate substring value with a main string
Syntax:StrTran( <cString>, <cLocString>, [<cRepString>], [<nPos>], [<nOccurrences>] ) --> cReturn
Arguments:<cString> The main string to search <cLocString> The string to locate in the main string <cRepString> The string to replace the <cLocString> <nPos> The first occurrence to be replaced <nOccurrences> Number of occurrence to replace
Returns:<cReturn> Formated string
Description:This function searches for any occurrence of <cLocString> in <cString> and replaces it with <cRepString>. If <cRepString> is not specified, a NULL byte will replace <cLocString>. If <nPos> is used, its value defines the first occurrence to be replaced. The default value is 1. Additionally, if used, the value of <nOccurrences> tell the function how many occurrences of <cLocString> in <cString> are to the replaced. The default of <nOccurrences> is all occurrences.
Examples:? StrTran( "Harbour Power", " ", " " ) // Harbour Power // Harbour Power The future of xBase ? StrTran( "Harbour Power The Future of xBase", " ", " " , , 2 )
Status:R
Compliance:C
Files:Libraty is rtl
See also:SubStr(), At()
Back to index


StrZero

Lang:string.txt
Component:harbour
Doc. source:.\doc\en\string.txt
Template:Function
Category:API
Subcategory:Strings
Oneliner:Convert a numeric expression to a character string, zero padded.
Syntax:StrZero( <nNumber>, [<nLength>], [<nDecimals>] ) --> cNumber
Arguments:<nNumber> is the numeric expression to be converted to a character string. <nLength> is the length of the character string to return, including decimal digits, decimal point, and sign. <nDecimals> is the number of decimal places to return.
Returns:StrZero() returns <nNumber> formatted as a character string. If the optional length and decimal arguments are not specified, StrZero() returns the character string according to the following rules: Results of StrZero() with No Optional Arguments <table> Expression Return Value Length Field Variable Field length plus decimals Expressions/constants Minimum of 10 digits plus decimals Val() Minimum of 3 digits Month()/Day() 3 digits Year() 5 digits RecNo() 7 digits </table>
Description:StrZero() is a numeric conversion function that converts numeric values to character strings. It is commonly used to concatenate numeric values to character strings. StrZero() has applications displaying numbers, creating codes such as part numbers from numeric values, and creating index keys that combine numeric and character data. StrZero() is like Transform(), which formats numeric values as character strings using a mask instead of length and decimal specifications. The inverse of StrZero() is Val(), which converts character numbers to numerics. * If <nLength> is less than the number of whole number digits in <nNumber>, Str() returns asterisks instead of the number. * If <nLength> is less than the number of decimal digits required for the decimal portion of the returned string, Harbour rounds the number to the available number of decimal places. * If <nLength> is specified but <nDecimals> is omitted (no decimal places), the return value is rounded to an integer. The StrZero() function was part of the CA-Cl*pper samples.
Examples:? StrZero( 10, 6, 2 ) // "010.00" ? StrZero( -10, 8, 2 ) // "-0010.00"
Status:R
Compliance:C
Files:Library is core
See also:Str()
Back to index


SubStr

Lang:string.txt
Component:harbour
Doc. source:.\doc\en\string.txt
Template:Function
Category:API
Subcategory:Strings
Oneliner: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
Status:R
Compliance:C
Files:Library is core
See also:Left(), At(), Right()
Back to index


Transform

Lang:string.txt
Component:harbour
Doc. source:.\doc\en\string.txt
Template:Function
Category:API
Subcategory:Strings
Oneliner:Formats a value based on a specific picture template.
Syntax:Transform( <xExpression>, <cTemplate> ) --> cFormatted
Arguments:<xExpression> Any expression to be formated. <cTemplate> Character string with picture template
Returns:<cFormatted> Formatted expression in character format
Description:This function returns <xExpression> in the format of the picture expression passed to the function as <cTemplate>. Their are two components that can make up <cTemplate> : a function string and a template string. Function strings are those functions that globally tell what the format of <xExpression> should be. These functions are represented by a single character precede by the @ symbol. There are a couple of rules to follow when using function strings and template strings: - First, a single space must fall between the function template and the template string if they are used in conjunction with one another. - Second, if both components make up the value of <cTemplate>, the function string must precede the template string. Otherwise, the function string may appear with out the template string and vice versa. The table below shows the possible function strings available with the Transform() function. <table> @B Left justify the string within the format. @C Issue a CR after format is numbers are positive. @D Put dates in SET DATE format. @E Put dates in BRITISH format. @L Make a zero padded string out of the number. @R Insert non template characters. @X Issue a DB after format is numbers are negative. @Z Display any zero as blank spaces. @( Quotes around negative numbers @! Convert alpha characters to uppercased format. </table> The second part of <cTemplate> consists of the format string. Each character in the string may be formatted based on using the follow characters as template markers for the string. <table> A,N,X,9,# Any data type L Shows logical as "T" or "F" Y Shows logical as "Y" or "N" ! Convert to uppercase $ Dollar sing in place of leading spaces in numeric expression * Asterisks in place of leading spaces in numeric expression , Commas position . Decimal point position </table>
Examples:LOCAL cString := "This is harbour" LOCAL nNumber := 9923.34 LOCAL nNumber1 := -95842.00 LOCAL lValue := .T. LOCAL dDate := Date() ? "working with String" ? "Current String is", cString ? "All uppercased", Transform( cString, "@!" ) ? "Date is", ddate ? "Date is ", Transform( ddate, "@D" ) ? Transform( nNumber, "@L 99999999" ) // "009923.34" ? Transform( 0 , "@L 9999" ) // "0000"
Status:R
Compliance:The @L function template is a FoxPro/Xbase++ Extension
Files:Library is core
See also:@...SAY, DevOutPict()
Back to index


Trim

Lang:string.txt
Component:harbour
Doc. source:.\doc\en\string.txt
Template:Function
Category:API
Subcategory:Strings
Oneliner:Remove trailing spaces from a string.
Syntax:Trim( <cExpression> ) --> cString
Arguments:<cExpression> Any character expression
Returns:<cString> A formatted string with out any blank spaced.
Description:This function returns the value of <cString> with any trailing blank removed. This function is identical to RTrim() and the opposite of LTrim(). Together with LTrim(), this function equated to the AllTrim() function.
Examples:? Trim( "Hello" ) // "Hello" ? Trim( "" ) // "" ? Trim( "UA " ) // "UA" ? Trim( " UA" ) // " UA"
Status:R
Compliance:C
Files:Library is core
See also:RTrim(), LTrim(), AllTrim()
Back to index


Upper

Lang:string.txt
Component:harbour
Doc. source:.\doc\en\string.txt
Template:Function
Category:API
Subcategory:Strings
Oneliner:Converts a character expression to uppercase format
Syntax:Upper( <cString> ) --> cUpperString
Arguments:<cString> Any character expression.
Returns:<cUpperString> Uppercased value of <cString>
Description:This function converts all alpha characters in <cString> to upper case values and returns that formatted character expression.
Examples:? Upper( "harbour" ) // HARBOUR ? Upper( "Harbour" ) // HARBOUR
Status:R
Compliance:C
Files:Library is core
See also:Lower(), IsUpper(), IsLower()
Back to index


Val

Lang:string.txt
Component:harbour
Doc. source:.\doc\en\string.txt
Template:Function
Category:API
Subcategory:Strings
Oneliner:Convert a number from a character type to numeric
Syntax:Val( <cNumber> ) --> nNumber
Arguments:<cNumber> Any valid character string of numbers.
Returns:<nNumber> The numeric value of <cNumber>
Description:This function converts any number previously defined as an character expression <cNumber> into a numeric expression. This functions is the oppose of the Str() function.
Examples:? Val( "31421" ) // 31421
Status:R
Compliance:C
Files:Library is core
See also:Str(), Transform()
Back to index


Col

Lang:terminal.txt
Component:harbour
Doc. source:.\doc\en\terminal.txt
Template:Function
Category:API
Subcategory:Terminal
Oneliner:Returns the current screen column position
Syntax:Col() --> nPosition
Arguments:None.
Returns:<nPosition> Current column position
Description:This function returns the current cursor column position. The value for this function can range between 0 and MaxCol().
Examples:? Col()
Status:R
Compliance:C
Files:Library is core
See also:Row(), MaxRow(), MaxCol()
Back to index


DevOutPict

Lang:terminal.txt
Component:harbour
Doc. source:.\doc\en\terminal.txt
Template:Procedure
Category:API
Subcategory:Terminal
Oneliner:Displays a value to a device using a picture template
Syntax:DevOutPict( <xExp>, <cPicture>, [<cColorString>] )
Arguments:<xExp> is any valid expression. <cPicture> is any picture transformation that Transform() can use. <cColorString> is an optional string that specifies a screen color to use in place of the default color when the output goes to the screen.
Returns:
Description:Outputs any expression using a picture transformation instead of using the default transformation for the type of expression.
Examples:// Output a negative dollar amount using debit notation. DevOutPict( -1.25, "@D$ 99,999.99 ) // -> $( 1.25)
Status:R
Compliance:DevOutPict() is mostly CA-Cl*pper compliant. Any differences are due to enhancements in the Harbour Transform() over CA-Cl*pper.
Files:Library is core
See also:DevOut(), Transform()
Back to index


hb_ColorIndex

Lang:terminal.txt
Component:harbour
Doc. source:.\doc\en\terminal.txt
Template:Function
Category:API
Subcategory:Terminal
Oneliner:Extract one color from a full colorspec string.
Syntax:hb_ColorIndex( <cColorSpec>, <nIndex> ) --> <cColor>
Arguments:<cColorSpec> is a color list <nIndex> is the position of the color item to be extracted, the first position is the zero.
Returns:The selected color string, or if anything goes wrong, an empty string.
Description:CA-Cl*pper has a color spec string, which has more than one color in it, separated with commas. This function will extract a given item from this list. You may use the manifest constants defined in color.ch to identify and extract common colors.
Examples:? hb_ColorIndex( "W/N, N/W", CLR_ENHANCED ) // "N/W"
Status:R
Compliance:H
Files:Library is core
See also:ColorSelect()
Back to index


MaxCol

Lang:terminal.txt
Component:harbour
Doc. source:.\doc\en\terminal.txt
Template:Function
Category:API
Subcategory:Terminal
Oneliner:Returns the maximun number of columns in the current video mode
Syntax:MaxCol() --> nPosition
Arguments:None.
Returns:<nPosition> The maximun number of columns possible in current video mode
Description:This function returns the current cursor column position. The value for this function can range between 0 and MaxCol().
Examples:? MaxCol()
Status:R
Compliance:C
Files:Library is core
See also:Row(), MaxRow(), Col()
Back to index


MaxRow

Lang:terminal.txt
Component:harbour
Doc. source:.\doc\en\terminal.txt
Template:Function
Category:API
Subcategory:Terminal
Oneliner:Returns the current screen row position
Syntax:MaxRow() --> nPosition
Arguments:None.
Returns:<nPosition> The maximun number of rows possible in current video mode
Description:This function returns the current cursor row location. The value for this function can range between 0 and MaxCol().
Examples:? MaxRow()
Status:R
Compliance:C
Files:Library is core
See also:Col(), Row(), MaxCol()
Back to index


RESTORE SCREEN

Lang:terminal.txt
Component:harbour
Doc. source:.\doc\en\terminal.txt
Template:Command
Category:API
Subcategory:Terminal
Oneliner:Restore screen image and coordinate from an internal buffer
Syntax:RESTORE SCREEN
Arguments:none.
Returns:
Description:Rest Screen restore saved image of the whole screen from an internal buffer that was saved by Save Screen, it also restore cursor position. After a call to Rest Screen the internal buffer is cleared. RESTORE SCREEN command is preprocessed into __XRestScreen() function during compile time. Note that RESTORE SCREEN FROM is preprocessed into RestScreen() function.
Examples:// save the screen, display list of files than restore the screen SAVE SCREEN DIR *.* WAIT RESTORE SCREEN
Status:R
Compliance:C
Files:
See also:__XRestScreen(), SAVE SCREEN, __XSaveScreen()
Back to index


Row

Lang:terminal.txt
Component:harbour
Doc. source:.\doc\en\terminal.txt
Template:Function
Category:API
Subcategory:Terminal
Oneliner:Returns the current screen row position
Syntax:Row() --> nPosition
Arguments:None.
Returns:<nPosition> Current screen row position
Description:This function returns the current cursor row location. The value for this function can range between 0 and MaxCol().
Examples:? Row()
Status:R
Compliance:C
Files:Library is core
See also:Col(), MaxRow(), MaxCol()
Back to index


SAVE SCREEN

Lang:terminal.txt
Component:harbour
Doc. source:.\doc\en\terminal.txt
Template:Command
Category:API
Subcategory:Terminal
Oneliner:Save whole screen image and coordinate to an internal buffer
Syntax:SAVE SCREEN
Arguments:none.
Returns:
Description:SAVE SCREEN save the image of the whole screen into an internal buffer, it also save current cursor position. The information could later be restored by REST SCREEN. Each call to SAVE SCREEN overwrite the internal buffer. SAVE SCREEN command is preprocessed into __XSaveScreen() function during compile time. Note that SAVE SCREEN TO is preprocessed into SaveScreen() function.
Examples:// save the screen, display list of files than restore the screen SAVE SCREEN DIR *.* WAIT RESTORE SCREEN
Status:R
Compliance:C
Files:
See also:RESTORE SCREEN, __XRestScreen(), __XSaveScreen()
Back to index


__TypeFile

Lang:file.txt
Component:harbour
Doc. source:.\doc\en\file.txt
Template:Function
Category:API
Subcategory:Terminal
Oneliner:Show the content of a file on the console and/or printer
Syntax:__TypeFile( <cFile>, [<lPrint>] ) --> NIL
Arguments:<cFile> is a name of the file to display. If the file have an extension, it must be specified (there is no default value). <lPrint> is an optional logical value that specifies whether the output should go only to the screen (.F.) or to both the screen and printer (.T.), the default is (.F.).
Returns:__TypeFile() always return NIL.
Description:__TypeFile() function type the content of a text file on the screen with an option to send this information also to the printer. The file is displayed as is without any headings or formatting. If <cFile> contain no path, __TypeFile() try to find the file first in the SET DEFAULT directory and then in search all of the SET PATH directories. If <cFile> can not be found a run-time error occur. Use SET CONSOLE OFF to suppress screen output. You can pause the output using Ctrl-S, press any key to resume. __TypeFile() function is used in the preprocessing of the TYPE command.
Examples:The following examples assume a file name mytext.dat exist in all specified paths, a run-time error would displayed if it does not // display mytext.dat file on screen __TypeFile( "mytext.dat" ) // display mytext.dat file on screen and printer __TypeFile( "mytext.dat", .T. ) // display mytext.dat file on printer only SET CONSOLE OFF __TypeFile( "mytext.dat", .T. ) SET CONSOLE ON
Status:R
Compliance:C
Files:Library is core
See also:COPY FILE, SET DEFAULT, SET PATH, SET PRINTER, TYPE
Back to index


AChoice

Lang:menu.txt
Component:harbour
Doc. source:.\doc\en\menu.txt
Template:Function
Category:API
Subcategory:User interface
Oneliner:Allows selection of an element from an array
Syntax:AChoice( <nTop>, <nLeft>, <nBottom>, <nRight>, <acMenuItems>, [<alSelableItems> | <lSelableItems>], [<cUserFunction> | <bUserBlock>], [<nInitialItem>], [<nWindowRow>] ) --> nPosition
Arguments:<nTop> - topmost row used to display array (default 0) <nLeft> - leftmost row used to display array (default 0) <nBottom> - bottommost row used to display array (default MaxRow()) <nRight> - rightmost row used to display array (default MaxCol()) <acMenuItems> - the character array of items from which to select <alSelableItems> - an array of items, either logical or character, which is used to determine if a particular item may be selected. If the type of a given item is character, it is macro evaluated, and the result is expected to be a logical. A value of .T. means that the item may be selected, .F. that it may not. (See next argument: lSelectableItems) <lSelableItems> - a logical value which is used to apply to all items in acMenuItems. If .T., all items may be selected; if .F., none may be selected. (See previous argument: alSelectableItems) Default .T. <cUserFunction> - the name of a function to be called which may affect special processing of keystrokes. It is specified without parentheses or parameters. When it is called, it will be supplied with the parameters: nMode, nCurElement, and nRowPos. Default NIL. <bUserBlock> - a codeblock to be called which may affect special processing of keystrokes. It should be specified in the form {| nMode, nCurElemenet, nRowPos | ; MyFunc( nMode, nCurElemenet, nRowPos ) }. Default NIL. <nInitialItem> - the number of the element to be highlighted as the current item when the array is initially displayed. 1 origin. Default 1. <nWindowRow> - the number of the window row on which the initial item is to be displayed. 0 origin. Default 0.
Returns:<nPosition> - the number of the item to be selected, or 0 if the selection was aborted.
Description:Allows selection of an element from an array. Please see standard CA-Cl*pper documentation for ACHOICE for additional detail.
Examples:aItems := { "One", "Two", "Three" } nChoice := AChoice( 10, 10, 20, 20, aItems ) IF nChoice == 0 ? "You did not choose an item" ELSE ? "You chose element " + hb_ntos( nChoice ) ?? " which has a value of " + aItems[ nChoice ] ENDIF
Status:
Compliance:C
Files:Library is core
See also:MENU TO
Back to index


Alert

Lang:terminal.txt
Component:harbour
Doc. source:.\doc\en\terminal.txt
Template:Function
Category:API
Subcategory:User interface
Oneliner:Display a dialog box with a message
Syntax:Alert( <xMessage>, [<aOptions>], [<cColorNorm>], [<nDelay>] ) --> nChoice or NIL
Arguments:<xMessage> Message to display in the dialog box. <xMessage> can be of any Harbour type. If <xMessage> is an array of Character strings, each element would be displayed in a new line. If <xMessage> is a Character string, you could split the message to several lines by placing a semicolon (;) in the desired places. <aOptions> Array with available response. Each element should be Character string. If omitted, default is { "Ok" }. <cColorNorm> Color string to paint the dialog box with. If omitted, default color is "W+/R". <nDelay> Number of seconds to wait to user response before abort. Default value is 0, that wait forever.
Returns:Alert() return Numeric value representing option number chosen. If ESC was pressed, return value is zero. The return value is NIL if Alert() is called with no parameters, or if <xMessage> type is not Character and HB_CLP_STRICT option was used. If <nDelay> seconds had passed without user response, the return value is 1.
Description:Alert() display simple dialog box on screen and let the user select one option. The user can move the highlight bar using arrow keys or TAB key. To select an option the user can press ENTER, SPACE or the first letter of the option. If the program is executed with the //NOALERT command line switch, nothing is displayed and it simply returns NIL. This switch could be overridden with __NoNoAlert(). If the GT system is linked in, Alert() display the message using the full screen I/O system, if not, the information is printed to the standard output using OutStd().
Examples:LOCAL cMessage, aOptions, nChoice // harmless message cMessage := "Major Database Corruption Detected!;" + ; "(deadline in few hours);;" + ; "where DO you want to go today?" // define response option aOptions := { "Ok", "www.jobs.com", "Oops" } // show message and let end user select panic level nChoice := Alert( cMessage, aOptions ) DO CASE CASE nChoice == 0 // do nothing, blame it on some one else CASE nChoice == 1 ? "Please call home and tell them you're gonn'a be late" CASE nChoice == 2 // make sure your resume is up to date CASE nChoice == 3 ? "Oops mode is not working in this version" ENDCASE
Status:R
Compliance:This function is sensitive to HB_CLP_STRICT settings during the compilation of src/rtl/alert.prg <b>defined</b>: <xMessage> accept Character values only and return NIL if other types are passed. <b>undefined</b>: <xMessage> could be any type, and internally converted to Character string. If type is Array, multi-line message is displayed. <b>defined</b>: Only the first four valid <aOptions> are taken. <b>undefined</b>: <aOptions> could contain as many as needed options. If HB_COMPAT_C53 was define during compilation of src/rtl/alert.prg the Left-Mouse button could be used to select an option. The interpretation of the //NOALERT command line switch is done only if HB_CLP_UNDOC was define during compilation of src/rtl/alert.prg <cColorNorm> is a Harbour extension, or at least un-documented in Clipper 5.2 NG. <nDelay> is a Harbour extension.
Files:Library is core
See also:@...PROMPT, MENU TO, OutStd(), __NoNoAlert()
Back to index


Browse

Lang:browse.txt
Component:harbour
Doc. source:.\doc\en\browse.txt
Template:Function
Category:API
Subcategory:User interface
Oneliner:Browse a database file
Syntax:Browse( [<nTop>, <nLeft>, <nBottom>, <nRight>] ) --> lOk
Arguments:<nTop> coordinate for top row display. <nLeft> coordinate for left column display. <nBottom> coordinate for bottom row display. <nRight> coordinate for right column display.
Returns:Browse() return .F. if there is no database open in this work area, else it return .T.
Description:Browse() is a general purpose database browser, without any thinking you can browse a file using the following keys: <table> Key Meaning Left Move one column to the left (previous field) Right Move one column to the right (next field) Up Move up one row (previous record) Down Move down one row (next record) Page-Up Move to the previous screen Page-Down Move to the next screen Ctrl Page-Up Move to the top of the file Ctrl Page-Down Move to the end of the file Home Move to the leftmost visible column End Move to the rightmost visible column Ctrl Left Pan one column to the left Ctrl Right Pan one column to the right Ctrl Home Move to the leftmost column Ctrl End Move to the rightmost column Esc Terminate Browse() </table> On top of the screen you see a status line with the following indication: <table> Record ###/### Current record number / Total number of records. <none> There are no records, the file is empty. <new> You are in append mode at the bottom of file. <Deleted> Current record is deleted. <bof> You are at the top of file. </table> You should pass whole four valid coordinate, if less than four parameters are passed to Browse() the coordinate are default to: 1, 0, MaxRow(), MaxCol().
Examples:// this one shows you how to browse around USE Around Browse()
Status:S
Compliance:C
Files:Library is core
See also:dbEdit()*, TBrowse class
Back to index


dbEdit*

Lang:browse.txt
Component:harbour
Doc. source:.\doc\en\browse.txt
Template:Function
Category:API
Subcategory:User interface
Oneliner:Browse records in a table
Syntax:dbEdit( [<nTop>], [<nLeft>], [<nBottom>], [<nRight>], [<acColumns>], [<xUserFunc>], [<xColumnSayPictures>], [<xColumnHeaders>], [<xHeadingSeparators>], [<xColumnSeparators>], [<xFootingSeparators>], [<xColumnFootings>] ) --> lOk
Arguments:<nTop> coordinate for top row display. <nTop> could range from 0 to MaxRow(), default is 0. <nLeft> coordinate for left column display. <nLeft> could range from 0 to MaxCol(), default is 0. <nBottom> coordinate for bottom row display. <nBottom> could range from 0 to MaxRow(), default is MaxRow(). <nRight> coordinate for right column display. <nRight> could range from 0 to MaxCol(), default is MaxCol(). <acColumns> is an array of character expressions that contain database fields names or expressions to display in each column. If not specified, the default is to display all fields from the database in the current work area. <xUserFunc> is a name of a user defined function or a code block that would be called every time unrecognized key is been pressed or when there are no keys waiting to be processed and dbEdit() goes into idle mode. If <xUserFunc> is a character string, it must contain root name of a valid user define function without parentheses. Both the user define function or the code block should accept two parameters: nMode, nCurrentColumn. Both should return a numeric value that correspond to one of the expected return codes (see table below for a list of nMode and return codes). <xColumnSayPictures> is an optional picture. If <xColumnSayPictures> is a character string, all columns would used this value as a picture string. If <xColumnSayPictures> is an array, each element should be a character string that correspond to a picture string for the column with the same index. Look at the help for @...SAY to get more information about picture values. <xColumnHeaders> contain the header titles for each column, if this is a character string, all columns would have that same header, if this is an array, each element is a character string that contain the header title for one column. Header may be split to more than one line by placing semicolon (;) in places where you want to break line. If omitted, the default value for each column header is taken from <acColumns> or field name if <acColumns> was not specified. <xHeadingSeparators> is an array that contain characters that draw the lines separating the headers and the fields data. Instead of an array you can use a character string that would be used to display the same line for all fields. Default value is a double line. <xColumnSeparators> is an array that contain characters that draw the lines separating displayed columns. Instead of an array you can use a character string that would be used to display the same line for all fields. Default value is a single line. <xFootingSeparators> is an array that contain characters that draw the lines separating the fields data area and the footing area. Instead of an array you can use a character string that would be used to display the same line for all footers. Default is to have to no footing separators. <xColumnFootings> contain the footing to be displayed at the bottom of each column, if this is a character string, all columns would have that same footer, if this is an array, each element is a character string that contain the footer for one column. Footer may be split to more than one line by placing semicolon (;) in places where you want to break line. If omitted, no footer are displayed.
Returns:dbEdit() return .F. if there is no database in use or if the number of columns to display is zero, else dbEdit() return .T.
Description:dbEdit() display and edit records from one or more work areas in a grid on screen. Each column is defined by element from <acColumns> and is the equivalent of one field. Each row is equivalent of one database record. Following are active keys that handled by dbEdit(): </par> --------------------------------------------------- <table> Key Meaning Left Move one column to the left (previous field) Right Move one column to the right (next field) Up Move up one row (previous record) Down Move down one row (next record) Page-Up Move to the previous screen Page-Down Move to the next screen Ctrl Page-Up Move to the top of the file Ctrl Page-Down Move to the end of the file Home Move to the leftmost visible column End Move to the rightmost visible column Ctrl Left Pan one column to the left Ctrl Right Pan one column to the right Ctrl Home Move to the leftmost column Ctrl End Move to the rightmost column </table> When <xUserFunc> is omitted, two more keys are active: <table> Key Meaning Esc Terminate Browse() Enter Terminate Browse() </table> When dbEdit() execute <xUserFunc> it pass the following arguments: nMode and the index of current record in <acColumns>. If <acColumns> is omitted, the index number is the FIELD() number of the open database structure. dbEdit() nMode could be one of the following: </par> --------------------------------------------- <table> dbedit.ch Meaning DE_IDLE dbEdit() is idle, all movement keys have been handled. DE_HITTOP Attempt to cursor past top of file. DE_HITBOTTOM Attempt to cursor past bottom of file. DE_EMPTY No records in work area, database is empty. DE_EXCEPT Key exception. </table> The user define function or code block must return a value that tell dbEdit() what to do next. User function return codes: </par> --------------------------- </par> <table> dbedit.ch Meaning DE_ABORT Abort dbEdit(). DE_CONT Continue dbEdit() as is. DE_REFRESH Force reread/redisplay of all data rows. </table> The user function is called once in each of the following cases: - The database is empty. - The user try to move past top of file or past bottom file. - Key exception, the uses had pressed a key that is not handled by dbEdit(). - The keyboard buffer is empty or a screen refresh had just occurred dbEdit() is a compatibility function, it is superseded by the TBrowse class and there for not recommended for new applications.
Examples:// Browse a file using default values USE Test dbEdit()
Status:S
Compliance:<xUserFunc> can take a code block value, this is a Harbour extension. CA-Cl*pper will throw an error if there's no database open, Harbour would return .F. CA-Cl*pper is buggy and will throw an error if the number of columns is zero, Harbour would return .F. The CA-Cl*pper 5.2 NG state that the return value is NIL, this is wrong and should be read logical. There is an undocumented result code (3) from the user defined function in CA-Cl*pper (both 87 and 5.x). This is an Append Mode which: "split the screen to allow data to be appended in windowed area". This mode is not supported by Harbour.
Files:Header files are dbedit.ch, inkey.ch Library is core
See also:@...SAY, Browse(), TBrowse class, Transform()
Back to index


dbSkipper

Lang:browse.txt
Component:harbour
Doc. source:.\doc\en\browse.txt
Template:Function
Category:API
Subcategory:User interface
Oneliner:Helper function to skip a database
Syntax:dbSkipper( <nRecs> ) --> nSkipped
Arguments:<nRecs> is the number of records to skip relative to current record. Positive number would try to move the record pointer forward, while a negative number would try to move the record pointer back <nRecs> records.
Returns:dbSkipper() return the number of actual record skipped.
Description:dbSkipper() is a helper function used in browse mechanism to skip a number of records while giving the caller indication about the actual records skipped.
Examples:// open a file and find if we've got enough records in it USE MonthSales IF dbSkipper( 100 ) == 100 ? "Good work! You can party now" ELSE ? "Too bad, you should really work harder" ENDIF CLOSE
Status:R
Compliance:XPP
Files:Library is core
See also:dbSkip(), SKIP
Back to index


hb_keyPut

Lang:input.txt
Component:harbour
Doc. source:.\doc\en\input.txt
Template:Function
Category:API
Subcategory:User interface
Oneliner:Put an inkey code to the keyboard buffer.
Syntax:hb_keyPut( <nInkeyCode> )
Arguments:<nInkeyCode> is the inkey code, which should be inserted into the keyboard buffer.
Returns:There is no return value.
Description:Inserts an inkey code to the string buffer. The buffer is *not* cleared in this operation. This function allows to insert such inkey codes which are not in the range of 0 to 255. To insert more than one code, call the function repeatedly. The zero code cannot be inserted.
Examples:// Stuff an Alt+PgDn key into the keyboard buffer hb_keyPut( K_ALT_PGDN ) ; ? Inkey() // ==> 417 hb_keyPut( K_F11 ) ; ? Inkey() // ==> -40
Status:R
Compliance:H
Files:Library is core
See also:KEYBOARD, CLEAR TYPEAHEAD, Inkey()
Back to index


Inkey

Lang:input.txt
Component:harbour
Doc. source:.\doc\en\input.txt
Template:Function
Category:API
Subcategory:User interface
Oneliner:Extracts the next key code from the Harbour keyboard buffer.
Syntax:Inkey( [<nTimeout>] [, <nEvents>] ) --> nKey
Arguments:<nTimeout> is an optional timeout value in seconds, with a granularity of 1/10th of a second. If omitted, Inkey() returns immediately. If set to 0, Inkey() waits until an input event occurs. If set to any other value, Inkey() will return either when an input event occurs or when the timeout period has elapsed. If only this parameter is specified and it is not numeric, it will be treated as if it were 0. But if both parameters are specified and this parameter is not numeric, it will be treated as if it were not present. <nEvents> is an optional mask of input events that are to be enabled. If omitted, defaults to hb_set.HB_SET_EVENTMASK. Valid input masks are in inkey.ch and are explained below. It is recommended that the mask names be used rather than their numeric values, in case the numeric values change in future releases of Harbour. To allow more than one type of input event, simply add the various mask names together. <table> inkey.ch Meaning INKEY_MOVE Mouse motion events are allowed INKEY_LDOWN The mouse left click down event is allowed INKEY_LUP The mouse left click up event is allowed INKEY_RDOWN The mouse right click down event is allowed INKEY_RUP The mouse right click up event is allowed INKEY_KEYBOARD All keyboard events are allowed INKEY_ALL All mouse and keyboard events are allowed HB_INKEY_EXTENDED Extended keyboard codes are used. </table> If the parameter is not numeric, it will be treated as if it were set to hb_set.HB_SET_EVENTMASK.
Returns:0 in case of timeout with no input event, otherwise returns a value in the range -47 to 386 for keyboard events or the range 1001 to 1007 for mouse events. Mouse events and non-printable keyboard events are represented by the K_<event> values listed in inkey.ch. Keyboard event return codes in the range 32 through 127 are equivalent to the printable ASCII character set. Keyboard event return codes in the range 128 through 255 are assumed to be printable, but results may vary based on hardware and nationality. If HB_INKEY_EXTENDED mode is used, then the return value for keyboard events ranges from 1 through 767 and 1077 through 1491, although not all codes are used. Extended key codes consist of the PC keyboard scan code and one or more offset values. If no keyboard modifier was used, then HB_INKEY_NONE is added. The Alt key adds HB_INKEY_ALT, the Ctrl key adds HB_INKEY_CTRL, the Shift key adds HB_INKEY_SHIFT, and enhanced keys (KeyPad+/ and CursorPad keys) add HB_INKEY_ENHANCED. For example, F1 is scan code 59, so if you just press F1, you get key code 315, but Alt+F1 gives 443, Ctrl+F1 gives 571, and Shift+ F1 gives 699. And NumPad+/ gives 1077, 1205, 1333, and 1461. At this time, the only value that can combine with other values is HB_INKEY_ENHANCED (i.e., there are no Alt+Ctl combinations, etc.) Note: The extended key code set is larger than the normal key code set. As a result, if you switch between the normal and extended modes, you need to be aware that some codes get translated into a zero in normal mode (because there is no corresponding code in normal mode) and that these codes get removed from the keyboard input buffer in normal mode and you won't be able to go back and fetch them later in extended mode.
Description:Inkey() can be used to detect input events, such as keypress, mouse movement, or mouse key clicks (up and/or down).
Examples:// Wait for the user to press the Esc key ? "Please press the ESC key." DO WHILE Inkey( 0.1 ) != K_ESC ENDDO // KEYBOARD "AB"; ? Inkey(), Inkey() // ==> 65 66
Status:S
Compliance:Inkey() is compliant with the CA-Cl*pper 5.3 Inkey() function with one exception: The Harbour Inkey() function will raise an argument error if the first parameter is less than or equal to 0 and the second parameter (or the default mask) is not valid, because otherwise INKEY would never return, because it was, in effect, asked to wait forever for no events (Note: In CA-Cl*pper, this also blocks SET KEY events).
Files:Library is core
See also:inkey.ch
Back to index


LastKey

Lang:input.txt
Component:harbour
Doc. source:.\doc\en\input.txt
Template:Function
Category:API
Subcategory:User interface
Oneliner:Get the last key extracted from the keyboard buffer.
Syntax:LastKey( [<nInputMask>] ) --> nKey
Arguments:nInputMask is an optional integer value composed of one or more INKEY_ or HB_INKEY_ constants. The sole purpose of this argument is to allow switching between using HB_INKEY_EXTENDED key codes and using the normal CA-Cl*pper-compatible key codes
Returns:<nKey> The last key extracted from the keyboard buffer.
Description:Returns the value of the last key exttracted from the Harbour keyboard buffer
Examples:// Continue looping unless the ESC key was pressed in MainFunc() DO WHILE .T. MainFunc() IF LastKey() == K_ESC EXIT ENDIF ENDDO // KEYBOARD "AB"; ? Inkey(), LastKey() // ==> 65 65
Status:R
Compliance:LastKey() is compliant with CA-Cl*pper 5.3, but has been extended for Harbour.
Files:Library is core
See also:Inkey(), LastKey()
Back to index


MCol

Lang:input.txt
Component:harbour
Doc. source:.\doc\en\input.txt
Template:Function
Category:API
Subcategory:User interface
Oneliner:Returns the mouse cursor column position.
Syntax:MCol() --> nMouseColumn
Arguments:None
Returns:<nMouseColumn> The mouse cursor column position.
Description:This function returns the column position of the mouse cursor. On graphical systems the value represents pixels. On character-based systems the value represents character columns as in CA-Cl*pper.
Examples:IF MCol() < 1 ? "Mouse is on left edge!" ENDIF
Status:R
Compliance:MCol() is compliant with CA-Cl*pper 5.3, but has been extended to work on graphical systems as well as character-based systems.
Files:Library is core
See also:MRow()
Back to index


MENU TO

Lang:menu.txt
Component:harbour
Doc. source:.\doc\en\menu.txt
Template:Command
Category:API
Subcategory:User interface
Oneliner:Invoked a menu defined by set of @...PROMPT
Syntax:MENU TO <cVariable>
Arguments:<cVariable> is a character string that contain the name of the variable to hold the menu choices, if this variable does not exist a PRIVATE variable with the name <cVariable> would be created to hold the result.
Returns:
Description:MENU TO invoked the menu define by previous __AtPrompt() call and display a highlight bar that the user can move to select an option from the menu. If <cVariable> does not exist or not visible, a PRIVATE variable named <cVariable> is created and hold the current menu selection. If there is a variable named <cVariable>, its value is used to select the first highlighted item. Menu prompts and messages are displayed in current Standard color, highlighted bar is displayed using current Enhanced color. Pressing the arrow keys move the highlighted bar. When a menu item is highlighted the message associated with it is displayed on the line specified with SET MESSAGE. If SET WRAP is ON and the user press UP arrow while on the first selection the last menu item is highlighted, if the user press Down arrow while on the last item, the first item is highlighted. Following are active keys that handled by MENU TO: <table> key Meaning Up Move to previous item Down Move to next item Left Move to previous item Right Move to next item Home Move to the first item End Move to the last item Page-Up Select menu item, return position Page-Down Select menu item, return position Enter Select menu item, return position Esc Abort selection, return 0 First letter Select next menu with the same first letter, | return this item position. </table> upon exit the cursor is placed at MaxRow() - 1, 0 MENU TO can be nested without loosing the previous prompts. MENU TO command is preprocessed into __MenuTo() function during compile time.
Examples:// display menu item on each screen corner and let user select one CLS SET MESSAGE TO MaxRow() / 2 CENTER SET WRAP ON @ 0 , 0 PROMPT "1. Upper left" MESSAGE " One " @ 0 , MaxCol() - 16 PROMPT "2. Upper right" MESSAGE " Two " @ MaxRow() - 1, MaxCol() - 16 PROMPT "3. Bottom right" MESSAGE "Three" @ MaxRow() - 1, 0 PROMPT "4. Bottom left" MESSAGE "Four " MENU TO nChoice SetPos( MaxRow() / 2, MaxCol() / 2 - 10 ) IF nChoice == 0 ?? "Esc was pressed" ELSE ?? "Selected option is", nChoice ENDIF
Status:R
Compliance:C
Files:
See also:@...PROMPT, AChoice(), SET MESSAGE, SET INTENSITY, SET WRAP, __AtPrompt()
Back to index


MRow

Lang:input.txt
Component:harbour
Doc. source:.\doc\en\input.txt
Template:Function
Category:API
Subcategory:User interface
Oneliner:Returns the mouse cursor row position.
Syntax:MRow() --> nMouseRow
Arguments:None
Returns:<nMouseRow> The mouse cursor row position.
Description:This function returns the current mouse row cursor position. On graphical systems the value represents pixel rows. On character-based systems the value represents character rows as in CA-Cl*pper.
Examples:IF MRow() < 1 ? "Mouse is on top row!" ENDIF
Status:R
Compliance:MRow() is compliant with CA-Cl*pper 5.3, but has been extended to work on graphical systems as well as character-based systems.
Files:Library is core
See also:MCol()
Back to index


NextKey

Lang:input.txt
Component:harbour
Doc. source:.\doc\en\input.txt
Template:Function
Category:API
Subcategory:User interface
Oneliner:Get the next key code in the buffer without extracting it.
Syntax:NextKey( [<nInputMask>] ) --> nKey
Arguments:nInputMask is an optional integer value composed of one or more INKEY_ or HB_INKEY_ constants. The sole purpose of this argument is to allow switching between using HB_INKEY_EXTENDED key codes and using the normal CA-Cl*pper-compatible key codes
Returns:<nKey> The value of the next key in the Harbour keyboard buffer.
Description:Returns the value of the next key in the Harbour keyboard buffer without extracting it.
Examples:// Use NextKey() with Inkey() to change display characters, or by // itself to exit the loop, so that the caller can detect the Esc. LOCAL nKey, cChar := "+" DO WHILE .T. ?? cChar nKey := NextKey() IF nKey == K_ESC EXIT ELSE IF nKey != 0 cChar := hb_keyChar( nKey ) ENDIF ENDIF ENDDO // KEYBOARD "AB"; ? NextKey(), NextKey() // ==> 65 65
Status:R
Compliance:NextKey() is compliant with CA-Cl*pper 5.3, but has been extended for Harbour.
Files:Library is core
See also:Inkey(), LastKey()
Back to index


OutErr

Lang:terminal.txt
Component:harbour
Doc. source:.\doc\en\terminal.txt
Template:Procedure
Category:API
Subcategory:User interface
Oneliner:Write a list of values to the standard error device
Syntax:OutErr( <xExp,...> )
Arguments:<xExp,...> is a list of expressions to display. Expressions are any mixture of Harbour data types.
Returns:
Description:OutErr() write one or more values into the standard error device. Character and Memo values are printed as is, Dates are printed according to the SET DATE FORMAT, Numeric values are converted to strings, Logical values are printed as .T. or .F., NIL are printed as NIL, values of any other kind are printed as empty string. There is one space separating each two values. Note that Numeric value can take varying length when converted into string depending on its source (see Str() for detail). There is an undocumented CA-Cl*pper command line switch //STDERR which can set the file handle to write output from OutErr(). If not specified the default STDERR is used, //STDERR or //STDERR:0 set OutErr() to output to the same file handle as OutStd(), //STDERR:n set output to file handle n. Like other undocumented features this switch is available only if src/rtl/console.c was compiled with the HB_CLP_UNDOC flag.
Examples:// write error log information OutErr( Date(), Time(), "Core meltdown detected" )
Status:R
Compliance:C
Files:Library is core
See also:?, ??, DevOut(), DevOutPict(), DispOut(), DispOutAt(), OutStd(), QOut(), QQOut(), Str()
Back to index


OutStd

Lang:terminal.txt
Component:harbour
Doc. source:.\doc\en\terminal.txt
Template:Procedure
Category:API
Subcategory:User interface
Oneliner:Write a list of values to the standard output device
Syntax:OutStd( <xExp,...> )
Arguments:<xExp,...> is a list of expressions to display. Expressions are any mixture of Harbour data types.
Returns:
Description:OutStd() write one or more values into the standard output device. Character and Memo values are printed as is, Dates are printed according to the SET DATE FORMAT, Numeric values are converted to strings, Logical values are printed as .T. or .F., NIL are printed as NIL, values of any other kind are printed as empty string. There is one space separating each two values. Note that Numeric value can take varying length when converted into string depending on its source (see Str() for detail). OutStd() is similar to QQOut() with the different that QQOut() send its output to the Harbour console stream, which can or can not be redirected according with the screen driver, and OutStd() send its output to the standard output device (STDOUT) and can be redirected.
Examples:OutStd( "Hello" ) // Result: Hello OutStd( 1, .T., NIL, "A" ) OutStd( "B" ) // Result: 1 .T. NIL AB
Status:R
Compliance:C
Files:Library is core
See also:?, ??, DevOut(), DevOutPict(), DispOut(), DispOutAt(), OutErr(), QOut(), QQOut(), Str()
Back to index


ReadKey*

Lang:input.txt
Component:harbour
Doc. source:.\doc\en\input.txt
Template:Function
Category:API
Subcategory:User interface
Oneliner:Determine which key terminated a READ.
Syntax:ReadKey() --> nKeyCode
Arguments:None.
Returns:ReadKey() returns a numeric code representing the key that caused READ to terminate.
Description:ReadKey() is used after a READ was terminated to determine the exit key pressed. If the GET buffer was updated during READ, 256 is added to the return code. <table> Exit Return code Return code Key (not updated) (updated) Up 4 260 Down 5 261 Page-Up 6 262 Page-Down 7 263 Ctrl Page-Up 34 290 Ctrl Page-Down 35 291 Esc 12 268 Ctrl End 14 270 Enter 15 271 Key >= 32 15 271 otherwise 0 0 </table> ReadKey() is a compatibility function so try not to use it. ReadKey() is superseded by LastKey() which returns the Inkey() code for that key. Updated() could be used to find if the GET buffer was changed during the READ.
Examples:
Status:R
Compliance:ReadKey() is compliant with CA-Cl*pper 5.3
Files:Library is core
See also:@...GET, Inkey(), LastKey(), READ, ReadExit(), Updated()
Back to index


ReadVar

Lang:tgetlist.txt
Component:harbour
Doc. source:.\doc\en\tgetlist.txt
Template:Function
Category:API
Subcategory:User interface
Oneliner:Return variable name of current GET or MENU
Syntax:ReadVar( [<cVarName>] ) --> cOldVarName
Arguments:<cVarName> is a new variable name to set.
Returns:ReadVar() return the old variable name. If no variable previously was set, ReadVar() return "".
Description:ReadVar() is set inside a READ or MENU TO command to hold the uppercase name of the GET / MENU TO variable, and re-set back to old value when those commands finished. You should not normally set a variable name but rather use it to retrieve the name of a GET variable when executing a VALID or WHEN clause, or during SET KEY execution and you are inside a READ or MENU TO.
Examples:// display a menu, press F1 to view the MENU TO variable name CLS @ 1, 10 PROMPT "blood sucking insect that infect beds " @ 2, 10 PROMPT "germ; virus infection " @ 3, 10 PROMPT "defect; snag; (source of) malfunctioning" @ 4, 10 PROMPT "small hidden microphone " @ 6, 10 SAY "(Press F1 for a hint)" SET KEY 28 TO ShowVar MENU TO What_Is_Bug PROCEDURE ShowVar Alert( ReadVar() ) // WHAT_IS_BUG in red Alert() box
Status:R
Compliance:ReadVar() works exactly like CA-Cl*pper's ReadKey(). Note however, that the <cVarName> parameter is not documented and used internally by CA-Cl*pper.
Files:Library is core
See also:@...GET, @...PROMPT, MENU TO, READ, SET KEY, __AtPrompt(), __MenuTo()
Back to index


TBrowseDB

Lang:browse.txt
Component:harbour
Doc. source:.\doc\en\browse.txt
Template:Function
Category:API
Subcategory:User interface
Oneliner:Create a new TBrowse object to be used with database file
Syntax:TBrowseDB( [<nTop>], [<nLeft>], [<nBottom>], [<nRight>] ) --> oBrowse
Arguments:<nTop> coordinate for top row display. <nLeft> coordinate for left column display. <nBottom> coordinate for bottom row display. <nRight> coordinate for right column display.
Returns:TBrowseDB() return new TBrowse object with the specified coordinate and a default :SkipBlock, :GoTopBlock and :GoBottomBlock to browse a database file.
Description:TBrowseDB() is a quick way to create a TBrowse object along with the minimal support needed to browse a database. Note that the returned TBrowse object contain no TBColumn objects and you need to add column for each field by your self.
Examples:for a good example, look at the source code for Browse() function at src/rtl/browse.prg
Status:S
Compliance:H
Files:Library is core
See also:Browse(), TBColumn class, TBrowse class, TBrowseNew()
Back to index


__AtPrompt

Lang:menu.txt
Component:harbour
Doc. source:.\doc\en\menu.txt
Template:Function
Category:API
Subcategory:User interface
Oneliner:Display a menu item on screen and define a message
Syntax:__AtPrompt( <nRow>, <nCol>, <cPrompt>, [<xMsg>] ) --> .F.
Arguments:<nRow> is the row number to display the menu <cPrompt>. Value could range from zero to MaxRow(). <nCol> is the column number to display the menu <cPrompt>. Value could range from zero to MaxCol(). <cPrompt> is the menu item character string to display. <xMsg> define a message to display each time this menu item is highlighted. <xMsg> could be a character string or code block that is evaluated to a character string. If <xMsg> is not specified or of the wrong type, an empty string ("") would be used.
Returns:__AtPrompt() always return .F.
Description:With __AtPrompt() you define and display a menu item, each call to __AtPrompt() add another item to the menu, to start the menu itself you should call the __MenuTo() function (MENU TO command). You can define any row and column combination and they will be displayed at the order of definition. After each call to __AtPrompt(), the cursor is placed one column to the right of the last text displayed, and Row() and Col() are updated. @...PROMPT command is preprocessed into __AtPrompt() function during compile time.
Examples:// display a two line menu with status line at the bottom // let the user select favorite day SET MESSAGE TO 24 CENTER @ 10, 2 PROMPT "Sunday" MESSAGE "This is the 1st item" @ 11, 2 PROMPT "Monday" MESSAGE "Now we're on the 2nd item" MENU TO nChoice DO CASE CASE nChoice == 0 // user press Esc key QUIT CASE nChoice == 1 // user select 1st menu item ? "Guess you don't like Mondays" CASE nChoice == 2 // user select 2nd menu item ? "Just another day for some" ENDCASE
Status:R
Compliance:C(menu)
Files:Library is core
See also:AChoice(), MENU TO, SET MESSAGE, SET INTENSITY, SET WRAP, __MenuTo()
Back to index


__Input

Lang:terminal.txt
Component:harbour
Doc. source:.\doc\en\terminal.txt
Template:Function
Category:API
Subcategory:User interface
Oneliner:Stops application
Syntax:__Input( <cMessage> ) --> <cString>
Arguments:<cMessage> is any valid expression.
Returns:<cString> input value macroed
Description:This function waits for a console input and returns macroed expression entered.
Examples:
Status:S
Compliance:C
Files:Library is core
See also:__Wait(), __Accept()
Back to index


__Keyboard

Lang:input.txt
Component:harbour
Doc. source:.\doc\en\input.txt
Template:Procedure
Category:API
Subcategory:User interface
Oneliner:Use hb_keyPut() instead
Syntax:KEYBOARD <cString> CLEAR TYPEAHEAD
Arguments:<cString> is the optional string to stuff into the Harbour keyboard buffer after clearing it first. Note: The character ";" is converted to Chr( 13 ) (this is an undocumented CA-Cl*pper feature).
Returns:
Description:Clears the Harbour keyboard typeahead buffer and then inserts an optional string into it.
Examples:// Stuff an Enter key into the keyboard buffer KEYBOARD Chr( 13 ) // Clear the keyboard buffer CLEAR TYPEAHEAD // KEYBOARD Chr( 13 ); ? Inkey() // ==> 13 KEYBOARD ";" ? Inkey() // ==> 13 KEYBOARD "Hello"; CLEAR TYPEAHEAD; ? Inkey() // ==> 0
Status:R
Compliance:__Keyboard() is compliant with CA-Cl*pper 5.3
Files:Library is core
See also:CLEAR TYPEAHEAD, KEYBOARD
Back to index


__MenuTo

Lang:menu.txt
Component:harbour
Doc. source:.\doc\en\menu.txt
Template:Function
Category:API
Subcategory:User interface
Oneliner:Invoked a menu defined by set of @...PROMPT
Syntax:__MenuTo( <bBlock>, <cVariable> ) --> nChoice
Arguments:<bBlock> is a set/get code block for variable named <cVariable>. <cVariable> is a character string that contain the name of the variable to hold the menu choices, if this variable does not exist a PRIVATE variable with the name <cVariable> would be created to hold the result.
Returns:__MenuTo() return the number of select menu item, or 0 if there was no item to select from or if the user pressed the Esc key.
Description:__MenuTo() invoked the menu define by previous __AtPrompt() call and display a highlight bar that the user can move to select an option from the menu. If <cVariable> does not exist or not visible, a PRIVATE variable named <cVariable> is created and hold the current menu selection. If there is a variable named <cVariable>, its value is used to select the first highlighted item. Menu prompts and messages are displayed in current Standard color, highlighted bar is displayed using current Enhanced color. Pressing the arrow keys move the highlighted bar. When a menu item is highlighted the message associated with it is displayed on the line specified with SET MESSAGE. If SET WRAP is ON and the user press UP arrow while on the first selection the last menu item is highlighted, if the user press Down arrow while on the last item, the first item is highlighted. Following are active keys that handled by __MenuTo(): <table> key Meaning Up Move to previous item Down Move to next item Left Move to previous item Right Move to next item Home Move to the first item End Move to the last item Page-Up Select menu item, return position Page-Down Select menu item, return position Enter Select menu item, return position Esc Abort selection, return 0 First letter Select next menu with the same first letter, | return this item position. </table> upon exit the cursor is placed at MaxRow() - 1, 0 __MenuTo() can be nested without loosing the previous prompts. MENU TO command is preprocessed into __MenuTo() function during compile time.
Examples:// display menu item on each screen corner and let user select one CLS SET MESSAGE TO MaxRow() / 2 CENTER SET WRAP ON @ 0 , 0 PROMPT "1. Upper left" MESSAGE " One " @ 0 , MaxCol() - 16 PROMPT "2. Upper right" MESSAGE " Two " @ MaxRow() - 1, MaxCol() - 16 PROMPT "3. Bottom right" MESSAGE "Three" @ MaxRow() - 1, 0 PROMPT "4. Bottom left" MESSAGE "Four " MENU TO nChoice SetPos( MaxRow() / 2, MaxCol() / 2 - 10 ) IF nChoice == 0 ?? "Esc was pressed" ELSE ?? "Selected option is", nChoice ENDIF
Status:R
Compliance:C
Files:Library is core
See also:@...PROMPT, AChoice(), SET MESSAGE, SET INTENSITY, SET WRAP, __AtPrompt()
Back to index


__NoNoAlert

Lang:terminal.txt
Component:harbour
Doc. source:.\doc\en\terminal.txt
Template:Procedure
Category:API
Subcategory:User interface
Oneliner:Override //NOALERT command line switch
Syntax:__NoNoAlert()
Arguments:This function takes no arguments.
Returns:
Description:The //NOALERT command line switch cause Clipper to ignore calls to the Alert() function, this function override this behavior and always display Alert() dialog box.
Examples:// make sure alert are been displayed __NoNoAlert()
Status:R
Compliance:C52U
Files:Library is core
See also:
Back to index


__XRestScreen

Lang:terminal.txt
Component:harbour
Doc. source:.\doc\en\terminal.txt
Template:Procedure
Category:API
Subcategory:User interface
Oneliner:Restore screen image and coordinate from an internal buffer
Syntax:__XRestScreen()
Arguments:none.
Returns:
Description:__XRestScreen() restore saved image of the whole screen from an internal buffer that was saved by __XSaveScreen(), it also restore cursor position. After a call to __XRestScreen() the internal buffer is cleared. RESTORE SCREEN command is preprocessed into __XRestScreen() function during compile time. Note that RESTORE SCREEN FROM is preprocessed into RestScreen() function. __XRestScreen() is a compatibility function, it is superseded by RestScreen() which allow you to restore the screen from a variable.
Examples:// save the screen, display list of files than restore the screen SAVE SCREEN DIR *.* WAIT RESTORE SCREEN
Status:R
Compliance:C
Files:Library is core
See also:__XRestScreen(), SAVE SCREEN, __XSaveScreen()
Back to index


__XSaveScreen

Lang:terminal.txt
Component:harbour
Doc. source:.\doc\en\terminal.txt
Template:Procedure
Category:API
Subcategory:User interface
Oneliner:Save whole screen image and coordinate to an internal buffer
Syntax:__XSaveScreen()
Arguments:none.
Returns:
Description:__XSaveScreen() save the image of the whole screen into an internal buffer, it also save current cursor position. The information could later be restored by __XRestScreen(). Each call to __XSaveScreen() overwrite the internal buffer. SAVE SCREEN command is preprocessed into __XSaveScreen() function during compile time. Note that SAVE SCREEN TO is preprocessed into SaveScreen() function. __XSaveScreen() is a compatibility function, it is superseded by SaveScreen() which allow you to save part or all the screen into a variable.
Examples:// save the screen, display list of files than restore the screen SAVE SCREEN DIR *.* WAIT RESTORE SCREEN
Status:R
Compliance:C
Files:Library is core
See also:RESTORE SCREEN, RestScreen(), SaveScreen()
Back to index


Empty

Lang:string.txt
Component:harbour
Doc. source:.\doc\en\string.txt
Template:Function
Category:API
Subcategory:Variable management
Oneliner:Checks if the passed argument is empty.
Syntax:Empty( <xExp> ) --> lIsEmpty
Arguments:<xExp> is any valid expression.
Returns:A logical value. It is true (.T.) if the passed argument is empty otherwise it is false (.F.).
Description:This function checks if an expression has empty value and returns a logical indicating whether it the expression is empty or not.
Examples:PROCEDURE Main() ? Empty( "I'm not empty" ) // .F. ? Empty( NIL ) // .T. ? Empty( 0 ) // .T. ? Empty( .F. ) // .T. ? Empty( "" ) // .T. ? Empty( 1 ) // .F. ? Empty( .T. ) // .F. ? Empty( "smile" ) // .F. ? Empty( Date() ) // .F. RETURN
Status:R
Compliance:C
Files:Library is core
See also:Len()
Back to index


hb_PIsByRef

Lang:var.txt
Component:harbour
Doc. source:.\doc\en\var.txt
Template:Function
Category:API
Subcategory:Variable management
Oneliner:Determine if a parameter is passed by reference.
Syntax:hb_PIsByRef( nParam ) --> <lParamIsByRef>
Arguments:<nParam> is the parameter number to test.
Returns:<lVarIsByRef> a logical value indicating if the parameter is passed by reference to actual function or procedure.
Description:This function return a logical value indicating if the parameter is passed by reference to actual function or procedure. This function is based on the form that Harbour manages to the variables for reference. When a variable is passed by reference, what receives the function or procedure is, a pointer to the previous variable, be this the container variable of the data or a pointer to another variable. The function observes if the variable passed points to a common variable or to a variable passed by reference.
Examples:PROCEDURE Main() LOCAL cVar := "Test local" MEMVAR m_nVar PRIVATE m_nVar := 0 Test( @cVar, @m_nVar, cVar, m_nVar ) RETURN STATIC PROCEDURE Test( Arg1, Arg2, Arg3, Arg4 ) ? hb_PIsByRef( 1 ) // .T. ? hb_PIsByRef( 2 ) // .T. ? hb_PIsByRef( 3 ) // .F. ? hb_PIsByRef( 4 ) // .F. RETURN
Status:S
Compliance:H
Files:Library is core
See also:ValType()
Back to index


Len

Lang:string.txt
Component:harbour
Doc. source:.\doc\en\string.txt
Template:Function
Category:API
Subcategory:Variable management
Oneliner:Returns size of a string or size of an array.
Syntax:Len( <cString> | <aArray> ) --> <nLength>
Arguments:<acString> is a character string or the array to check.
Returns:The length of the string or the number of elements that contains an array.
Description:This function returns the string length or the size of an array or the size of a hash table. If it is used with a multidimensional array it returns the size of the first dimension.
Examples:PROCEDURE Main() LOCAL cName ? Len( "Harbour" ) // --> 7 ? Len( { "One", "Two" } ) // --> 2 cName := "" ACCEPT "Enter your name: " TO cName ? Len( cName ) RETURN
Status:R
Compliance:C
Files:Library is core
See also:Empty(), RTrim(), LTrim(), AAdd(), ASize()
Back to index


MemVarBlock

Lang:var.txt
Component:harbour
Doc. source:.\doc\en\var.txt
Template:Function
Category:API
Subcategory:Variable management
Oneliner:Returns a codeblock that sets/gets a value of memvar variable
Syntax:MemVarBlock( <cMemvarName> ) --> <bBlock>
Arguments:<cMemvarName> - a string that contains the name of variable
Returns:<bBlock> a codeblock that sets/get the value of variable
Description:This function returns a codeblock that sets/gets the value of PRIVATE or PUBLIC variable. When this codeblock is evaluated without any parameters passed then it returns the current value of given variable. If the second parameter is passed for the codeblock evaluation then its value is used to set the new value of given variable - the passed value is also returned as a value of the codeblock evaluation.
Examples:PROCEDURE Main() LOCAL cbSetGet PUBLIC xPublic cbSetGet := MemVarBlock( "xPublic" ) Eval( cbSetGet, "new value" ) ? "Value of xPublic variable", Eval( cbSetGet ) RETURN
Status:R
Compliance:C
Files:Library is core
See also:__mvGet(), __mvPut()
Back to index


Type

Lang:var.txt
Component:harbour
Doc. source:.\doc\en\var.txt
Template:Function
Category:API
Subcategory:Variable management
Oneliner:Retrieves the type of an expression
Syntax:Type( <cExp> ) --> <cRetType>
Arguments:<cExp> must be a character expression.
Returns:<cRetType> a string indicating the type of the passed expression. <table> <cRetType> Meaning "A" Array "B" Block "C" Character (string) "D" Date "L" Logical "M" Memo "N" Numeric "O" Object "P" Pointer "S" Symbol "U" NIL, local or static variable, or not linked-in function "UE" syntax error in the expression or invalid arguments "UI" function with non-reserved name was requested </table>
Description:This function returns a string which represents the data type of the argument. The argument can be any valid Harbour expression. If there is a syntax error in passed expression then "UE" is returned. If there is a call for any non-reserved Harbour function then "UI" is returned (in other words there is no call for passed UDF function during a data type determination - this is CA-Cl*pper compatible behavior). Additionally if requested user defined function is not linked into executable then "U" is returned. The data type of expression is checked by invoking a macro compiler and by evaluation of generated code (if there is no syntax errors). This causes that Type() cannot determine a type of local or static variables - only symbols visible at runtime can be checked. Notice the subtle difference between TYPE and VALTYPE functions. ValType() function doesn't call a macro compiler - it simply checks the type of passed argument of any type. Type() requires a string argument with a valid Harbour expression - the data type of this expression is returned.
Examples:? Type( "{ 1, 2 }" ) // prints "A" ? Type( "iif( .T., SubStr( "TYPE", 2, 1 ), .F. )" ) // prints "C" ? Type( "At( "OK", MyUDF() ) > 0" ) // prints "UI" ? Type( "{ 1, 2 }[ 5 ]" ) // prints "UE" //-------------------------------------------------------- LOCAL c PRIVATE a := "A", b := "B" ? Type( "a + b + c" ) // prints: "U" ('C' variable is a local one) //-------------------------------------------------------- LOCAL cFilter := Space( 60 ) ACCEPT "Enter filter expression:" TO cFilter IF Type( cFilter ) $ "CDLMN" // this is a valid expression SET FILTER TO &cFilter ENDIF
Status:R
Compliance:- Incompatibility with CA-Cl*pper: In the following code: PRIVATE lCond := 0 ? Type( "iof( lCond, 'true', MyUDF() )" ) CA-Cl*pper will print "UE" - in Harbour the output will be "UI" - If "UI" is returned then the syntax of the expression is correct. However invalid arguments can be passed to function/procedure that will cause runtime errors during evaluation of expression. - Harbour supports two new types (Pointer and Symbol) which does not exists in CA-Cl*pper.
Files:Library is core
See also:ValType()
Back to index


ValType

Lang:var.txt
Component:harbour
Doc. source:.\doc\en\var.txt
Template:Function
Category:API
Subcategory:Variable management
Oneliner:Retrieves the data type of an expression
Syntax:ValType( <xExp> ) --> <cRetType>
Arguments:<xExp> is any valid expression.
Returns:<cRetType> a character indicating the type of the passed expression. <table> <cRetType> Meaning "A" Array "B" Block "C" Character (string) "D" Date "L" Logical "M" Memo "N" Numeric "O" Object "P" Pointer "S" Symbol "U" NIL </table>
Description:This function returns one character which represents the data type of the argument.
Examples:PROCEDURE Main() ? ValType( Array( 1 ) ) // "A" ? ValType( {|| 1 + 1 } ) // "B" ? ValType( "Harbour" ) // "C" ? ValType( Date() ) // "D" ? ValType( .T. ) // "L" ? ValType( 1 ) // "N" ? ValType( TBrowse() ) // "O" ? ValType( hb_idleAdd() ) // "P" Harbour extension ? ValType( @QOut() ) // "S" Harbour extension ? ValType( NIL ) // "U" RETURN
Status:R
Compliance:ValType() is CA-Cl*pper compliant, with the addition of the new Harbour types: Pointer and Symbol.
Files:Library is core
See also:Type()
Back to index


__mvClear

Lang:var.txt
Component:harbour
Doc. source:.\doc\en\var.txt
Template:Function
Category:API
Subcategory:Variable management
Oneliner:This function releases all PRIVATE and PUBLIC variables
Syntax:__mvClear()
Arguments:None
Returns:Nothing
Description:This function releases all PRIVATE and PUBLIC variables. It is used to implement CLEAR MEMORY statement. The memory occupied by all visible variables are released - any attempt to access the variable will result in a runtime error. You have to reuse PRIVATE or PUBLIC statement to create again the variable that was cleared by this function.
Examples:
Status:R
Compliance:H
Files:Library is core
See also:__mvPublic()
Back to index


__mvExist

Lang:var.txt
Component:harbour
Doc. source:.\doc\en\var.txt
Template:Function
Category:API
Subcategory:Variable management
Oneliner:Determine if a given name is a PUBLIC or PRIVATE memory variable
Syntax:__mvExist( <cVarName> ) --> <lVariableExist>
Arguments:<cVarName> - string that specifies the name of variable to check
Returns:__mvExist() return TRUE (.T.) if a MEMVAR named <cVarName> exist.
Description:This function determine if a PUBLIC or PRIVATE variable with the name <cVarName> exist or not.
Examples:LOCAL TheLocal STATIC TheStatic PUBLIC ThePublic PRIVATE ThePrivate ? __mvExist( "NotExist" ) // .F. ? __mvExist( "TheLocal" ) // .F. ? __mvExist( "TheStatic" ) // .F. ? __mvExist( "ThePublic" ) // .T. ? __mvExist( "ThePrivate" ) // .T.
Status:R
Compliance:H
Files:Library is core
See also:MEMVAR, PRIVATE, PUBLIC
Back to index


__mvGet

Lang:var.txt
Component:harbour
Doc. source:.\doc\en\var.txt
Template:Function
Category:API
Subcategory:Variable management
Oneliner:This function returns value of memory variable
Syntax:__mvGet( <cVarName> ) --> <xVar>
Arguments:<cVarName> - string that specifies the name of variable
Returns:<xVar> The value of variable
Description:This function returns the value of PRIVATE or PUBLIC variable if this variable exists otherwise it generates a runtime error. The variable is specified by its name passed as the function parameter.
Examples:FUNCTION MemVarBlock( cMemvar ) RETURN {| x | ; iif( PCount() == 0, ; __mvGet( cMemvar ), ; __mvPut( cMemvar, x ) ) }
Status:R
Compliance:H
Files:Library is core
See also:__mvPut()
Back to index


__mvPrivate

Lang:var.txt
Component:harbour
Doc. source:.\doc\en\var.txt
Template:Function
Category:API
Subcategory:Variable management
Oneliner:This function creates a PRIVATE variable
Syntax:__mvPrivate( <variable_name> )
Arguments:<variable_name> = either a string that contains the variable's name or an one-dimensional array of strings with variable names No skeleton are allowed here.
Returns:Nothing
Description:This function can be called either by the harbour compiler or by user. The compiler always passes the item of IT_SYMBOL type that stores the name of variable. If a variable with the same name exists already then the value of old variable is hidden until the new variable is released. The new variable is always initialized to NIL value.
Examples:None Avaliable
Status:R
Compliance:H
Files:Library is core
See also:
Back to index


__mvPublic

Lang:var.txt
Component:harbour
Doc. source:.\doc\en\var.txt
Template:Function
Category:API
Subcategory:Variable management
Oneliner:This function creates a PUBLIC variable
Syntax:__mvPublic( <variable_name> )
Arguments:<variable_name> = either a string that contains the variable's name or an one-dimensional array of strings with variable names No skeleton are allowed here.
Returns:Nothing
Description:This function can be called either by the harbour compiler or by user. The compiler always passes the item of IT_SYMBOL type that stores the name of variable. If a variable with the same name exists already then the new variable is not created - the previous value remains unchanged. If it is first variable with this name then the variable is initialized with .T. value.
Examples:None Avaliable
Status:R
Compliance:H
Files:Library is core
See also:
Back to index


__mvPut

Lang:var.txt
Component:harbour
Doc. source:.\doc\en\var.txt
Template:Function
Category:API
Subcategory:Variable management
Oneliner:This function set the value of memory variable
Syntax:__mvGet( <cVarName> [, <xValue>] ) --> <xValue>
Arguments:<cVarName> - string that specifies the name of variable <xValue> - a value of any type that will be set - if it is not specified then NIL is assumed
Returns:<xValue> A value assigned to the given variable.
Description:This function sets the value of PRIVATE or PUBLIC variable if this variable exists otherwise it generates a runtime error. The variable is specified by its name passed as the function parameter. If a value is not specified then the NIL is assumed
Examples:FUNCTION MemVarBlock( cMemvar ) RETURN {| x | ; iif( PCount() == 0, ; __mvGet( cMemvar ), ; __mvPut( cMemvar, x ) ) }
Status:R
Compliance:H
Files:Library is core
See also:__mvPut()
Back to index


__mvRelease

Lang:var.txt
Component:harbour
Doc. source:.\doc\en\var.txt
Template:Function
Category:API
Subcategory:Variable management
Oneliner:This function releases PRIVATE variables
Syntax:__mvRelease( <skeleton>, <include_exclude_flag> )
Arguments:<skeleton> = string that contains the wildcard mask for variables' names that will be released. Supported wildcards: '*' and '?' <include_exclude_flag> = logical value that specifies if variables that match passed skeleton should be either included in deletion (if .T.) or excluded from deletion (if .F.)
Returns:Nothing
Description:This function releases values stored in memory variables. It shouldn't be called directly, it should be placed into RELEASE ALL command. If the released variable is a PRIVATE variable then previously hidden variable with the same name becomes visible after exit from the procedure where released variable was created. If you access the released variable in the same function/procedure where it was created the the NIL value is returned. You can however assign a new value to released variable without any side effects. PUBLIC variables are not changed by this function.
Examples:None Avaliable
Status:R
Compliance:H
Files:Library is core
See also:
Back to index


__mvScope

Lang:var.txt
Component:harbour
Doc. source:.\doc\en\var.txt
Template:Function
Category:API
Subcategory:Variable management
Oneliner:If variable exists then returns its scope.
Syntax:__mvScope( <cVarName> )
Arguments:<cVarName> = a string with a variable name to check
Returns:The symbolic values are defined in hbmemvar.ch HB_MV_NOT_FOUND =variable is not declared (not found in symbol table) HB_MV_UNKNOWN =if variable doesn't exist (but found in symbol table) HB_MV_ERROR =if information cannot be obtained (memory error or argument error) HB_MV_PUBLIC =for public variables HB_MV_PRIVATE_GLOBAL =for private variables declared outside of current function/procedure HB_MV_PRIVATE_LOCAL =for private variables declared in current function/procedure
Description:
Examples:PROCEDURE Main() PUBLIC mPublic PRIVATE mPrivateGlobal CallProc() ? __mvScope( "mPrivateLocal" ) // HB_MV_UNKNOWN RETURN PROCEDURE CallProc() PRIVATE mPrivateLocal ? __mvScope( "mPublic" ) // HB_MV_PUBLIC ? __mvScope( "mPrivateGlobal" ) // HB_MV_PRIVATE_GLOBAL ? __mvScope( "mPrivateLocal" ) // HB_MV_PRIVATE_LOCAL ? __mvScope( "mFindMe" ) // HB_MV_NOT_FOUND IF __mvScope( "mPublic" ) > HB_MV_ERROR ? "Variable exists" ELSE ? "Variable not created yet" ENDIF RETURN
Status:R
Compliance:H
Files:Library is core
See also:include/hbmemvar.ch
Back to index


__mvXRelease

Lang:var.txt
Component:harbour
Doc. source:.\doc\en\var.txt
Template:Function
Category:API
Subcategory:Variable management
Oneliner:This function releases value stored in PRIVATE or PUBLIC variable
Syntax:__mvXRelease( <variable_name> )
Arguments:<variable_name> = either a string that contains the variable's name or an one-dimensional array of strings with variable names No skeleton are allowed here.
Returns:Nothing
Description:This function releases values stored in memory variable. It shouldn't be called directly, rather it should be placed into RELEASE command. If the released variable is a PRIVATE variable then previously hidden variable with the same name becomes visible after exit from the procedure where released variable was created. If you access the released variable in the same function/procedure where it was created the the NIL value is returned. You can however assign a new value to released variable without any side effects. It releases variable even if this variable was created in different procedure
Examples:PROCEDURE Main() PRIVATE mPrivate mPrivate := "PRIVATE from Main()" ? mPrivate //PRIVATE from Main() Test() ? mPrivate //PRIVATE from Main() RETURN PROCEDURE Main() PRIVATE mPrivate mPrivate := "PRIVATE from Main()" ? mPrivate //PRIVATE from Main() RELEASE mPrivate ? mPrivate //NIL mPrivate := "Again in Main()" RETURN
Status:R
Compliance:H
Files:Library is core
See also:
Back to index


ft_AAddition

Lang:aading.txt
Component:hbnf
Doc. source:hbnf\doc\en\aading.txt
Template:
Category:Array
Subcategory:
Oneliner:Add elements unique of source array to target array
Syntax:ft_AAddition( <aList1>, <aList2> [, <lTrimmer> [, <lCaseSens> ] ] ) ; -> aNewArray
Arguments:<aList1> is the primary array. <aList2> is the secondary array. <lTrimmer> is a logical value denoting whether leading or trailing spaces should be included in the comparison. If .T., then ignores spaces in comparison, defaults to .T., .F. includes spaces. <lCaseSens> is a logical value denoting case sensitivity. If .T., then comparison is sensitive to case, defaults to .T., .F. ignores case.
Returns:An array of the union of aList1 and aList2.
Description:This function will add the elements unique of aList2 with aList1. It returns a new array including all the elements of aList1 plus the unique elements of aList2.
Examples:aList1 := { "apple", "orange", "pear" } aList2 := { "apple ", "banana", "PEAR" } ft_AAddition( aList1, aList2 ) // ignores spaces, sensitive to case // returns { "apple", "orange", "pear", "banana", "PEAR" } ft_AAddition( aList1, aList2, , .F. ) // ignores spaces, not sensitive to case // returns { "apple", "orange", "pear", "banana" } ft_AAddition( aList1, aList2, .F. , .F. ) // sensitive to spaces, not sensitive to case // returns { "apple", "orange", "pear", "apple ", "banana" }
Status:
Compliance:
Files:
See also:
Back to index


ft_AAvg

Lang:aavg.txt
Component:hbnf
Doc. source:hbnf\doc\en\aavg.txt
Template:
Category:Array
Subcategory:
Oneliner:Average numeric values in an array
Syntax:ft_AAvg( <aArray> [, <nStartIndex> [, <nEndIndex> ] ] ) -> nAverage
Arguments:<aArray> is the array containing the elements to be averaged. <nStartIndex> is the first array item to include, defaults to first element. <nEndIndex> is the last array element to include, defaults to all elements.
Returns:The average of the specified array elements.
Description:This function is used to get a numeric average of selected or all elements of an array. This routine requires ft_ASum().
Examples:ft_AAvg( aSubTotals ) // Get Average of Entire Array ft_AAvg( aSubTotals, 5 ) // Get Average of 5th Element On ft_AAvg( aSubTotals, , 10 ) // Get Average of 1st 10 Elements ft_AAvg( aSubTotals, 5, 10 ) // Get Average of Elements 5-10
Status:
Compliance:
Files:
See also:
Back to index


ft_ADesSort

Lang:adessort.txt
Component:hbnf
Doc. source:hbnf\doc\en\adessort.txt
Template:
Category:Array
Subcategory:
Oneliner:Sort an array in descending order
Syntax:ft_ADesSort( <aArray> [, <nStartIndex> [, <nEndIndex> ] ] ) -> aSorted
Arguments:<aArray> is the array to be sorted <nStartIndex> is the first array item to include in the sort, defaults to first element <nEndIndex> is the last array element to include in the sort, defaults to all elements
Returns:The array, sorted in descending order.
Description:This function is used to sort an array in descending order, i.e., Z-A
Examples:ft_ADesSort( aNames ) // Sort the Entire Array ft_ADesSort( aNames, 5 ) // Sort from the 5th Element On ft_ADesSort( aNames, , 10 ) // Sort the 1st 10 Elements ft_ADesSort( aNames, 5, 10 ) // Sort Elements 5-10
Status:
Compliance:
Files:
See also:
Back to index


ft_AEMaxLen

Lang:aemaxlen.txt
Component:hbnf
Doc. source:hbnf\doc\en\aemaxlen.txt
Template:
Category:Array
Subcategory:
Oneliner:Find longest element within an array
Syntax:ft_AEMaxLen( <aArray> [, <nDimension> [, <nStart> [, <nCount> ] ] ] ) ; -> nMaxlen
Arguments:<aArray> is the array containing the elements to be measured. <nDimension> is the array dimension to be measured, defaults to first dimension. <nStart> is the starting array element to include, defaults to first array element. <nCount> is the number of array elements to process from from <nStart>, defaults to remaining elements in array.
Returns:The length of the longest size element of an array.
Description:This function will measure each element of an array dimension and return the longest element.
Examples:ft_AEMaxLen( aArray ) // Measure the 1st dimension of an Array ft_AEMaxLen( aArray, 2 ) // Measure the 2nd dimension of an Array ft_AEMaxLen( aArray, 2, , 9 ) // Measure Elements 1-9 of the // 2nd dimension or subarray ft_AEMaxLen( aArray, 3, 5, 9 ) // Measure Elements 5-9 of the // 3rd dimension or subarray ft_AEMaxLen( aArray, 3, 5 ) // Measure Elements 5 to last in the // 3rd dimension or subarray
Status:
Compliance:
Files:
See also:ft_AEMinLen()
Back to index


ft_AEMinLen

Lang:aeminlen.txt
Component:hbnf
Doc. source:hbnf\doc\en\aeminlen.txt
Template:
Category:Array
Subcategory:
Oneliner:Find shortest element within an array
Syntax:ft_AEMinLen( <aArray> [, <nDimension> [, <nStart> [, <nCount> ] ] ] ) -> nMinlen
Arguments:<aArray> is the array containing the elements to be measured. <nDimension> is the array dimension to be measured, defaults to first dimension. <nStart> is the starting array element to include, defaults to first array element. <nCount> is the number of array elements to process from from <nStart>, defaults to remaining elements in array.
Returns:The length of the shortest size element of an array.
Description:This function will measure each element of an array dimension and return the shortest element.
Examples:ft_AEMinLen( aArray ) // Measure the 1st dimension of an Array ft_AEMinLen( aArray, 2 ) // Measure the 2nd dimension of an Array ft_AEMinLen( aArray, 2, , 9 ) // Measure Elements 1-9 of 2nd dimension ft_AEMinLen( aArray, 3, 5, 9 ) // Measure Elements 5-9 of 3rd dimension ft_AEMinLen( aArray, 3, 5 ) // Measure Elements 5 to end of 3rd dimension
Status:
Compliance:
Files:
See also:ft_AEMaxLen()
Back to index


ft_AMedian

Lang:amedian.txt
Component:hbnf
Doc. source:hbnf\doc\en\amedian.txt
Template:
Category:Array
Subcategory:
Oneliner:Find middle value in array, or average of two middle values
Syntax:ft_AMedian( <aArray> [, <nStart> [, <nEnd> ] ] ) -> nMedian
Arguments:<aArray> is the array containing the elements to be averaged. <nStart> is the first array element to include, defaults to first element. <nEnd> is the last array element to include, defaults to last element.
Returns:The median average of the array elements
Description:This function sorts the elements of a numeric array and then returns the value in the middle element of the sorted array. If there is no exact middle value, then it returns the average of the two middle values. Half of the elements are > median and half are < median. A median average may more reflect a more useful average when there are extreme values in the set.
Examples:ft_AMedian( aArray ) // Return Median for entire array ft_AMedian( aArray, 2 ) // Return Median for elements from 2 to end ft_AMedian( aArray, , 9 ) // Return Median for 1st 9 elements ft_AMedian( aArray, 8, 40 ) // Return Median for elements 8 to 40
Status:
Compliance:
Files:
See also:
Back to index


ft_ANoMatches

Lang:anomatch.txt
Component:hbnf
Doc. source:hbnf\doc\en\anomatch.txt
Template:
Category:Array
Subcategory:
Oneliner:Find the number of array elements meeting a condition
Syntax:ft_ANoMatches( <aArray>, <bCompareBlock> ; [, <nStartIndex> [, <nEndIndex> ] ] ) -> nNoOfMatches
Arguments:<aArray> is the array to be searched <bCompareBlock> is a code block containing the expression for the array elements to be tested with. Each element is passed as a parameter to the block. If the block returns .T., the number of matches will be incremented by one. <nStartIndex> is the first array item to include in the search, defaults to first element. <nEndIndex> is the last array element to include in the search, defaults to all elements.
Returns:The number of elements that cause the code block to return .T.
Description:This function returns the number of array elements that, when passed to the supplied code block, cause that code block to return a .T. value.
Examples:// Search the Entire Array ft_ANoMatches( aTries, {| x | x <= 100 } ) // Search from the 5th Element On ft_ANoMatches( aCodes, {| x | Upper( x ) == cCurrentCode }, 5 ) // Search the 1st 10 Elements ft_ANoMatches( aDates, {| x | IS_BETWEEN( Date() - 7, x, Date() + 7 ) }, 10 ) // Search Elements 5-10 ft_ANoMatches( aNames, {| x | x <= cLastGoodName }, 5, 10 )
Status:
Compliance:
Files:
See also:
Back to index


ft_ArEdit

Lang:aredit.txt
Component:hbnf
Doc. source:hbnf\doc\en\aredit.txt
Template:
Category:Array
Subcategory:
Oneliner:2 dimensional array editing function using TBrowse
Syntax:ft_ArEdit( <nTop>, <nLeft>, <nBottom>, <nRight>, <Array Name>, ; <nElem>, <aHeadings>, <aBlocks> [, <bGetFunc> ] ) -> xElement
Arguments:<nTop>, <nLeft>, <nBottom>, <nRight> are coordinates for TBrowse <Array Name> is name of 2 dimensional to array edit <nElem> is pointer for element in array <aHeadings> is array of column headings <aBlocks> is array of blocks describing each array element [ <bGetFunc> ] is get editing function for handling individual elements
Returns:Value of element positioned on when exit ft_ArEdit() The type of this value depends on what is displayed.
Description:This function allows you to position yourself in an array, add and delete rows with the <F7> and <F8> keys, and pass a UDF with information to edit the individual gets.
Examples:ft_ArEdit( 3, 5, 18, 75, ar, @nElem, aHeadings, aBlocks ) // This example will allow you to browse a 2 dimensional array // But you can't edit it since there is no GetBlock UDF // It allows the user to hit ENTER to select an element or ESC to // return 0 // This second example shows how to edit a 2 dimensional array // as might be done to edit an invoice LOCAL i, ar[ 3, 26 ], aBlocks[ 3 ], aHeadings[ 3 ] LOCAL nElem := 1, bGetFunc // Set up two dimensional array "ar" FOR i := 1 TO 26 ar[ 1, i ] := i // 1 -> 26 Numeric ar[ 2, i ] := Chr( Asc( "A" ) + i - 1 ) // "A" -> "Z" Character ar[ 3, i ] := Chr( Asc( "Z" ) - i + 1 ) // "Z" -> "A" Character NEXT // SET UP aHeadings Array for column headings aHeadings := { "Numbers", "Letters", "Reverse" } // Need to set up individual array blocks for each TBrowse column aBlocks[ 1 ] := {|| Str( ar[ 1, nElem ], 2 ) } // prevent default 10 spaces aBlocks[ 2 ] := {|| ar[ 2, nElem ] } aBlocks[ 3 ] := {|| ar[ 3, nElem ] } // set up TestGet() as the passed Get Function so FT_ArEdit knows how // to edit the individual gets. bGetFunc := {| b, ar, nDim, nElem | TestGet( b, ar, nDim, nElem ) } SetColor( "N/W, W/N, , , W/N" ) CLS ft_ArEdit( 3, 5, 18, 75, ar, @nElem, aHeadings, aBlocks, bGetFunc )
Status:
Compliance:
Files:
See also:
Back to index


ft_ASum

Lang:asum.txt
Component:hbnf
Doc. source:hbnf\doc\en\asum.txt
Template:
Category:Array
Subcategory:
Oneliner:Sum the elements of an array
Syntax:ft_ASum( <aArray> [, <nStartIndex> [, <nEndIndex> ] ] ) -> nSum
Arguments:<aArray> is the array containing the elements to be summed. <nStartIndex> is the first array item to include, defaults to first element. <nEndIndex> is the last array element to include, defaults to all elements.
Returns:The sum of the elements of the array or the lengths of the elements.
Description:This function is to sum the elements of a numeric array or to sum the lengths of a character array.
Examples:ft_ASum( aSubTotals ) // Sum the Entire Array ft_ASum( aSubTotals, 5 ) // Sum from the 5th Element On ft_ASum( aSubTotals, , 10 ) // Sum the 1st 10 Elements ft_ASum( aSubTotals, 5, 10 ) // Sum Elements 5-10
Status:
Compliance:
Files:
See also:
Back to index


ft_RestArr

Lang:savearr.txt
Component:hbnf
Doc. source:hbnf\doc\en\savearr.txt
Template:
Category:Array
Subcategory:
Oneliner:Restore a Clipper array from a disc file
Syntax:ft_RestArr( <cFileName>, <nErrorCode> ) -> aArray
Arguments:<cFileName> is a DOS file name. <nErrorCode> will return any DOS file error. All arguments are required.
Returns:Return an array variable.
Description:ft_RestArr() restores an array which was saved to a disc file using ft_SaveArr(). [10/1/92 Librarian note: This function does not appear to work with multi-dimensional arrays. If you'd care to modify it to support this feature, please do and send it to Glenn Scott 71620,1521.]
Examples:aArray := { ; { "Invoice 1", hb_SToD( "19910415" ), 1234.32, .T. }, ; { "Invoice 2", Date(), 234.98, .F. }, ; { "Invoice 3", Date() + 1, 0, .T. } } nErrorCode := 0 ft_SaveArr( aArray, "invoice.dat", @nErrorCode ) IF nErrorCode == 0 aSave := ft_RestArr( "invoice.dat", @nErrorCode ) IF nErrorCode != 0 ? "Error restoring array" ENDIF ELSE ? "Error writing array" ENDIF
Status:
Compliance:
Files:
See also:ft_SaveArr()
Back to index


ft_SaveArr

Lang:savearr.txt
Component:hbnf
Doc. source:hbnf\doc\en\savearr.txt
Template:
Category:Array
Subcategory:
Oneliner:Save Clipper array to a disc file.
Syntax:ft_SaveArr( <aArray>, <cFileName>, <nErrorCode> ) -> lRet
Arguments:<aArray> is any Clipper array except those containing compiled code blocks. <cFileName> is a DOS file name. <nErrorCode> will return any DOS file error. All arguments are required.
Returns:.F. if there was a DOS file error or the array contained code blocks, otherwise returns .T.
Description:ft_SaveArr() saves any Clipper array, except those containing compiled code blocks, to a disc file. The array can be restored from the disc file using ft_RestArr(). [10/1/92 Librarian note: This function does not appear to work with multi-dimensional arrays. If you'd care to modify it to support this feature, please do and send it to Glenn Scott 71620,1521.]
Examples:aArray := { ; { "Invoice 1", hb_SToD( "19910415" ), 1234.32, .T. }, ; { "Invoice 2", Date(), 234.98, .F. }, ; { "Invoice 3", Date() + 1, 0, .T. } } nErrorCode := 0 ft_SaveArr( aArray, "invoice.dat", @nErrorCode ) IF nErrorCode == 0 aSave := ft_RestArr( "invoice.dat", @nErrorCode ) IF nErrorCode != 0 ? "Error restoring array" ENDIF ELSE ? "Error writing array" ENDIF
Status:
Compliance:
Files:
See also:ft_RestArr()
Back to index


hb_setListenerAdd

Lang:hb_set.txt
Component:harbour
Doc. source:.\doc\en\hb_set.txt
Template:Function
Category:C level API
Subcategory:Environment
Oneliner:
Syntax:C Prototype #include "hbset.h" hb_setListenerAdd( PHB_SET_LISTENER_CALLBACK callback ) --> int
Arguments:<callback> A pointer to a function taking two enum parameters and returning no value. The first parameter identifies the SET parameter that is to be changed and the second parameter identifies whether the call is from before or after the value is changed. The callback function will be called twice whenever a SET parameter is changed using the Harbour SET function. The first call takes place before the SET value is changed and the second one is after the SET parameter has been changed.
Returns:An integer value representing the callback handle, in case the caller needs to deactivate the callback function.
Description:This function allows a subsystem that needs to track the status of some SET parameters to be notified whenever a SET parameter gets changed.
Examples:void callback_function( HB_set_enum set, HB_set_listener_enum when ) { printf("\nCalled for SET parameter %d %s changing.", set, (when ? "after" : "before")); } int handle = hb_setListenerAdd( callback_function );
Status:R
Compliance:NA
Files:Library is core
See also:hb_setListenerRemove()
Back to index


hb_setListenerNotify

Lang:hb_set.txt
Component:harbour
Doc. source:.\doc\en\hb_set.txt
Template:Function
Category:C level API
Subcategory:Environment
Oneliner:
Syntax:C Prototype #include "hbset.h" hb_setListenerNotify( HB_set_enum set, HB_set_listener_enum when ) --> int
Arguments:<set> The number of the SET parameter that is to be or was changed. <when> Set to HB_SET_LISTENER_BEFORE when called before the SET parameter is to be changed and set to HB_SET_LISTENER_AFTER when called after the SET parameter has been changed.
Returns:<int>
Description:This function notifies all SET listener callback functions. It must be called any time you change the value of a SET parameter directly instead of using the Harbour SET function. Both before and after the change.
Examples:hb_setListenerNotify( HB_SET_DECIMALS, HB_SET_LISTENER_BEFORE ); hb_set.HB_SET_DECIMALS = 3; hb_setListenerNotify( HB_SET_DECIMALS, HB_SET_LISTENER_AFTER );
Status:R
Compliance:NA
Files:Library is core
See also:hb_setListenerAdd()
Back to index


hb_setListenerRemove

Lang:hb_set.txt
Component:harbour
Doc. source:.\doc\en\hb_set.txt
Template:Function
Category:C level API
Subcategory:Environment
Oneliner:
Syntax:C Prototype #include "hbset.h" hb_setListenerRemove( int handle ) --> int
Arguments:<handle> The handle for the SET listener callback function to be removed.
Returns:The handle if the callback function could not be located or the negative value of the handle if the callback function was removed.
Description:This function removes a SET listener callback function.
Examples:int handle = hb_setListenerAdd( callback_function ); ... hb_setListenerRemove( handle );
Status:R
Compliance:NA
Files:Library is core
See also:hb_setListenerAdd()
Back to index


hb_idleState

Lang:idle.txt
Component:harbour
Doc. source:.\doc\en\idle.txt
Template:Procedure
Category:C level API
Subcategory:Idle states
Oneliner:Evaluates a single background task and calls the garbage collector.
Syntax:void hb_idleState( void );
Arguments:None
Returns:
Description:hb_idleState() is a C function that requests garbage collection and executes a single background task defined by the codeblock passed with hb_idleAdd() function. It also releases the CPU time slices for platforms that require it. Every call for this function evaluates different task in the order of task creation. There are no arguments passed during codeblock evaluation. This function can be safely called even if there are no background tasks defined. This function is automatically called from the Inkey() function.
Examples:
Status:R
Compliance:H
Files:
See also:hb_idleAdd(), hb_idleDel(), hb_idleState()
Back to index


hb_mathGetErrMode

Lang:math.txt
Component:harbour
Doc. source:.\doc\en\math.txt
Template:Function
Category:C level API
Subcategory:Math
Oneliner:get math error handling mode
Syntax:C Prototype #include "hbmath.h" hb_mathGetErrMode( void ) --> imode
Arguments:
Returns:imode math error handling mode
Description:
Examples:
Status:R
Compliance:NA
Files:Header file is hbmath.h Library is core
See also:hb_mathSetErrMode()
Back to index


hb_mathGetHandler

Lang:math.txt
Component:harbour
Doc. source:.\doc\en\math.txt
Template:Function
Category:C level API
Subcategory:Math
Oneliner:get current Harbour math error handler
Syntax:C Prototype #include "hbmath.h" hb_mathGetHandler( void ) --> HB_MATH_HANDLERPROC handlerproc
Arguments:handlerproc custom math handler typedef int (* HB_MATH_HANDLERPROC)(HB_MATH_EXCEPTION * err)
Returns:<handerproc>
Description:
Examples:
Status:R
Compliance:NA
Files:Header file is hbmath.h Library is core
See also:
Back to index


hb_mathGetLastError

Lang:math.txt
Component:harbour
Doc. source:.\doc\en\math.txt
Template:Function
Category:C level API
Subcategory:Math
Oneliner:get the last math lib error
Syntax:C Prototype #include "hbmath.h" hb_mathGetLastError( HB_MATH_EXCEPTION * phb_exc ) --> int iMathErrorType
Arguments:phb_exc pointer to HB_MATH_EXCEPTION structure, if not NULL, the structure will be filled with information about the last math error: typedef struct _HB_MATH_EXCEPTION { int type; // Math error type, is one of the constants // HB_MATH_ERR_xxx defined in hbmath.ch char *funcname; // Pointer to name of the math C RTL routine // that caused the error. char *error; // Pointer to error description. double arg1; // First and double arg2; // Second double argument to the math routine. double retval; // Corrected return value for the math routine. int retvalwidth; // Width and int retvaldec; // Decimals of the corrected return value, // both default to -1 int handled; // 1, if the math error is already corrected, // 0 otherwise. } HB_MATH_EXCEPTION;
Returns:<iMathErrorType>
Description:
Examples:
Status:R
Compliance:NA
Files:Header file is hbmath.h Library is core
See also:
Back to index


hb_mathIsMathErr

Lang:math.txt
Component:harbour
Doc. source:.\doc\en\math.txt
Template:Function
Category:C level API
Subcategory:Math
Oneliner:Check if harbour math error handling is available
Syntax:C Prototype #include "hbmath.h" hb_mathIsMathErr( void ) --> int iIsMathHandler
Arguments:
Returns:<iIsMathHandler>
Description:
Examples:
Status:R
Compliance:NA
Files:Header file is hbmath.h Library is core
See also:
Back to index


hb_mathResetError

Lang:math.txt
Component:harbour
Doc. source:.\doc\en\math.txt
Template:Procedure
Category:C level API
Subcategory:Math
Oneliner:Reset the internal math error information structure
Syntax:C Prototype #include "hbmath.h" hb_mathResetError( void )
Arguments:
Returns:
Description:
Examples:
Status:R
Compliance:NA
Files:Header file is hbmath.h Library is core
See also:
Back to index


hb_mathSetErrMode

Lang:math.txt
Component:harbour
Doc. source:.\doc\en\math.txt
Template:Function
Category:C level API
Subcategory:Math
Oneliner:set math error handling mode
Syntax:C Prototype #include "hbmath.h" hb_mathSetErrMode( int imode ) --> int ioldmode
Arguments:imode math error handling mode, one of the following constants, defined in hbmath.ch: HB_MATH_ERRMODE_DEFAULT HB_MATH_ERRMODE_CDEFAULT HB_MATH_ERRMODE_USER HB_MATH_ERRMODE_USERDEFAULT HB_MATH_ERRMODE_USERCDEFAULT
Returns:ioldmode old math error handling mode
Description:
Examples:
Status:R
Compliance:NA
Files:Header file is hbmath.h Library is core
See also:hb_mathGetErrMode()
Back to index


hb_mathSetHandler

Lang:math.txt
Component:harbour
Doc. source:.\doc\en\math.txt
Template:Function
Category:C level API
Subcategory:Math
Oneliner:set the harbour math handler
Syntax:C Prototype #include "hbmath.h" hb_mathSetHandler( HB_MATH_HANDLERPROC handlerproc ) --> HB_MATH_HANDLERPROC previous_handerproc
Arguments:handlerproc custom math handler typedef int (* HB_MATH_HANDLERPROC)(HB_MATH_EXCEPTION * err)
Returns:previous_handlerproc previous math handler typedef int (* HB_MATH_HANDLERPROC)(HB_MATH_EXCEPTION * err)
Description:
Examples:
Status:R
Compliance:NA
Files:Header file is hbmath.h Library is core
See also:
Back to index


CLASS VAR

Lang:command.txt
Component:harbour
Doc. source:.\doc\en\command.txt
Template:Command
Category:Class
Subcategory:Data
Oneliner:Define a CLASS VAR variable for a class (NOT for an Object!)
Syntax:CLASS VAR <DataName1> [, <DataNameN>] [ AS <type> ] [ INIT <uValue> ]
Arguments:<DataName1> Name of the VAR <type> Optional data type specification from the following: Character, Numeric, Date, Logical, Codeblock, Nil <uValue> Optional initial value at program startup
Returns:
Description:CLASS VAR variables can also be thought of as the "properties" of an entire class. Each CLASS VAR exists only once, no matter how many objects are created. A common usage is for a counter that is incremented whenever an object is created and decremented when one is destroyed, thus monitoring the number of objects in existence for this class. You can use the "AS <type>" clause to enforce that the CLASS VAR is maintained as a certain type. Otherwise it will take on the type of whatever value is first assigned to it. Use the "INIT <uValue>" clause to initialize that VAR to <uValue> whenever the class is first used.
Examples:CREATE CLASS TWindow VAR hWnd, nOldProc CLASS VAR lRegistered AS LOGICAL ENDCLASS
Status:R
Compliance:H
Files:
See also:Object Oriented Programming, CLASS, METHOD, VAR
Back to index


VAR

Lang:command.txt
Component:harbour
Doc. source:.\doc\en\command.txt
Template:Command
Category:Class
Subcategory:Data
Oneliner:Alternate syntax for VAR: instance variable for the objects.
Syntax:VAR <DataName1> [, <DataNameN>] [ AS <type> ] [ INIT <uValue> ] [[EXPORTED | VISIBLE] | [PROTECTED] | [HIDDEN]] [READONLY | RO]
Arguments:<DataName1> Name of the VAR <type> Optional data type specification from the following: Character, Numeric, Date, Logical, Codeblock, Nil. <uValue> Optional initial value when creating a new object. EXPORTED Specifies that this VAR is accessible to functions and methods outside of the class. VISIBLE is a synonym for EXPORTED. PROTECTED Specifies that this VAR is only accessible to functions and methods within this class and its subclasses. HIDDEN Specifies that this VAR is only accessible to the class where it was defined, and is not inherited by the subclasses. READONLY Restricts assignment to the variable. If specified with the EXPORTED clause, assignment is only permitted from the current class and its subclasses. If specified with the PROTECTED clause, assignment is only permitted from the current class. RO is a synonym for READONLY.
Returns:
Description:VAR elements can also be thought of as the "properties" of an object. They can be of any data type, including codeblock. Once an object has been created, the VAR elements are referenced with the colon (:) as in MyObject:Heading := "Last name". Usually a class also defines methods to manipulate the VAR. You can use the "AS <type>" clause to enforce that the VAR is maintained as a certain type. Otherwise it will take on the type of whatever value is first assigned to it. Use the "INIT <uValue>" clause to initialize that VAR to <uValue> whenever a new object is created. VAR can be a synonym for VAR, or it can use a slightly different syntax for compatibility with other dialects.
Examples:CREATE CLASS TBColumn VAR Block // Code block to retrieve data for the column VAR Cargo // User-definable variable VAR ColorBlock // Code block that determines color of data items VAR ColSep // Column separator character VAR DefColor // Array of numeric indexes into the color table VAR Footing // Column footing VAR FootSep // Footing separator character VAR Heading // Column heading VAR HeadSep // Heading separator character VAR Width // Column display width VAR ColPos // Temporary column position on screen METHOD New() // Constructor ENDCLASS
Status:R
Compliance:H
Files:
See also:Object Oriented Programming, CLASS, METHOD, CLASS VAR, VAR
Back to index


CLASS

Lang:command.txt
Component:harbour
Doc. source:.\doc\en\command.txt
Template:Command
Category:Class
Subcategory:Definition
Oneliner:Define a Class for Object Oriented Programming
Syntax:[CREATE] CLASS <ClassName> [ <FROM, INHERIT> <SuperClass1> [, <SuperClassN>] ] [STATIC]
Arguments:<ClassName> Name of the class to define. By tradition, Harbour classes start with "T" to avoid collisions with user- created classes. <SuperClass1...n> The Parent class(es) to use for inheritance. Harbour supports Multiple Inheritance. STATIC This clause causes the class function to be declared as a static function. It will therefore not be available outside the current module.
Returns:
Description:CLASS creates a class from which you can create objects. The CLASS command begins the class specification, in which the VAR elements (also known as instance variables) and METHODS of the class are named. The following scoping commands may also appear. They control the default scope of VAR and METHOD commands that follow them. <fixed> EXPORTED: VISIBLE: HIDDEN: PROTECTED: </fixed> The class specification ends with the END CLASS command. Classes can inherit from multiple <SuperClasses>, and the chain of inheritance can extend to many levels. A program uses a Class by calling the Class Constructor, usually the New() method, to create an object. That object is usually assigned to a variable, which is used to access the VAR elements and methods. Harbour's OOP syntax and implementation supports Scoping (Protect, Hidden and Readonly) and Delegating, and is largely compatible with Class(y)(tm), TopClass(tm) and Visual Objects(tm).
Examples:CREATE CLASS TBColumn VAR Block // Code block to retrieve data for the column VAR Cargo // User-definable variable VAR ColorBlock // Code block that determines color of data items VAR ColSep // Column separator character VAR DefColor // Array of numeric indexes into the color table VAR Footing // Column footing VAR FootSep // Footing separator character VAR Heading // Column heading VAR HeadSep // Heading separator character VAR Width // Column display width VAR ColPos // Temporary column position on screen METHOD New() // Constructor ENDCLASS
Status:R
Compliance:H
Files:
See also:HBClass(), Object Oriented Programming, VAR, METHOD
Back to index


ENDCLASS

Lang:command.txt
Component:harbour
Doc. source:.\doc\en\command.txt
Template:Command
Category:Class
Subcategory:Definition
Oneliner:End the declaration of a class.
Syntax:ENDCLASS
Arguments:(This statement has no arguments)
Returns:
Description:ENDCLASS marks the end of a class declaration. It is usually followed by the class methods that are not INLINE.
Examples:CREATE CLASS TWindow VAR hWnd, nOldProc ENDCLASS
Status:R
Compliance:H
Files:
See also:Object Oriented Programming, CLASS, METHOD, VAR
Back to index


ERROR HANDLER

Lang:command.txt
Component:harbour
Doc. source:.\doc\en\command.txt
Template:Command
Category:Class
Subcategory:Method
Oneliner:Designate a method as an error handler for the class
Syntax:ERROR HANDLER <MethodName>( [<params,...>] )
Arguments:<MethodName> Name of the method to define <params,...> Optional parameter list
Returns:
Description:ERROR HANDLER names the method that should handle errors for the class being defined.
Examples:CREATE CLASS TWindow ERROR HANDLER MyErrHandler() ENDCLASS
Status:R
Compliance:H
Files:
See also:Object Oriented Programming, ON ERROR, CLASS, METHOD, VAR
Back to index


MESSAGE

Lang:command.txt
Component:harbour
Doc. source:.\doc\en\command.txt
Template:Command
Category:Class
Subcategory:Method
Oneliner:Route a method call to another Method
Syntax:MESSAGE <MessageName> METHOD <MethodName>( [<params,...>] ) MESSAGE <MessageName>() METHOD <MethodName>( [<params,...>] )
Arguments:<MessageName> The pseudo-method name to define <MethodName> The method to create and call when <MessageName> is invoked. <params,...> Optional parameter list for the method
Returns:
Description:The MESSAGE command is a seldom-used feature that lets you re-route a call to a method with a different name. This can be necessary if a method name conflicts with a public function that needs to be called from within the class methods. For example, your app may have a public function called BeginPaint() that is used in painting windows. It would also be natural to have a Window class method called :BeginPaint() that the application can call. But within the class method you would not be able to call the public function because internally methods are based on static functions (which hide public functions of the same name). The MESSAGE command lets you create the true method with a different name (::xBeginPaint()), yet still allow the ::BeginPaint() syntax to call ::xBeginPaint(). This is then free to call the public function BeginPaint().
Examples:CREATE CLASS TWindow VAR hWnd, nOldProc METHOD New( ) CONSTRUCTOR MESSAGE BeginPaint METHOD xBeginPaint() ENDCLASS
Status:R
Compliance:H
Files:
See also:METHOD, VAR, CLASS, Object Oriented Programming
Back to index


METHOD

Lang:command.txt
Component:harbour
Doc. source:.\doc\en\command.txt
Template:Command
Category:Class
Subcategory:Method
Oneliner:Declare a METHOD for a class in the class header
Syntax:METHOD <MethodName>( [<params,...>] ) [CONSTRUCTOR] METHOD <MethodName>( [<params,...>] ) INLINE <Code,...> METHOD <MethodName>( [<params,...>] ) BLOCK <CodeBlock> METHOD <MethodName>( [<params,...>] ) EXTERN <NAME>( [<args,...>] ) METHOD <MethodName>( [<params,...>] ) SETGET METHOD <MethodName>( [<params,...>] ) VIRTUAL METHOD <MethodName>( [<param>] ) OPERATOR <op> METHOD <MethodName>( [<params,...>] ) CLASS <ClassName>
Arguments:<MethodName> Name of the method to define <params,...> Optional parameter list
Returns:
Description:Methods are "class functions" which do the work of the class. All methods must be defined in the class header between the CLASS and ENDCLASS commands. If the body of a method is not fully defined here, the full body is written below the ENDCLASS command using this syntax: METHOD <MethodName>( [<params,...>] ) CLASS <ClassName> Methods can reference the current object with the keyword "Self:" or its shorthand version "::". CLAUSES: CONSTRUCTOR Defines a special method Class Constructor method, used to create objects. This is usually the New() method. Constructors always return the new object. INLINE Fast and easy to code, INLINE lets you define the code for the method immediately within the definition of the Class. Any methods not declared INLINE or BLOCK must be fully defined after the ENDCLASS command. The <Code,...> following INLINE receives a parameter of Self. If you need to receive more parameters, use the BLOCK clause instead. BLOCK Use this clause when you want to declare fast 'inline' methods that need parameters. The first parameter to <CodeBlock> must be Self, as in: METHOD <MethodName> BLOCK {| Self, <arg1>, <arg2>, ..., <argN> | ... } EXTERN If an external function does what the method needs, use this clause to make an optimized call to that function directly. SETGET For calculated Data. The name of the method can be manipulated like a Data element to Set or Get a value. VIRTUAL Methods that do nothing. Useful for Base classes where the child class will define the method's behavior, or when you are first creating and testing a Class. OPERATOR Operator Overloading for classes. See example tests/testop.prg for details. CLASS <ClassName> Use this syntax only for defining a full method after the ENDCLASS command.
Examples:CREATE CLASS TWindow VAR hWnd, nOldProc METHOD New( ) CONSTRUCTOR METHOD Capture() INLINE SetCapture( ::hWnd ) METHOD End() BLOCK {| Self, lEnd | iif( lEnd := ::lValid(), ; ::PostMsg( WM_CLOSE ), ), lEnd } METHOD EraseBkGnd( hDC ) METHOD cTitle( cNewTitle ) SETGET METHOD Close() VIRTUAL ENDCLASS METHOD New( ) CLASS TWindow LOCAL nVar, cStr ... <code> ... ... <code> ... RETURN Self
Status:R
Compliance:H
Files:
See also:HBClass(), Object Oriented Programming, VAR, CLASS
Back to index


ON ERROR

Lang:command.txt
Component:harbour
Doc. source:.\doc\en\command.txt
Template:Command
Category:Class
Subcategory:Method
Oneliner:Designate a method as an error handler for the class
Syntax:ON ERROR <MethodName>( [<params,...>] )
Arguments:<MethodName> Name of the method to define <params,...> Optional parameter list
Returns:
Description:ON ERROR is a synonym for ERROR HANDLER. It names the method that should handle errors for the class being defined.
Examples:CREATE CLASS TWindow ON ERROR MyErrHandler() ENDCLASS
Status:R
Compliance:H
Files:
See also:Object Oriented Programming, ERROR HANDLER, CLASS, METHOD, VAR
Back to index


COPY STRUCTURE

Lang:dbstrux.txt
Component:harbour
Doc. source:.\doc\en\dbstrux.txt
Template:Command
Category:Command
Subcategory:Database
Oneliner:Create a new database based on current database structure
Syntax:COPY STRUCTURE TO <xcFileName> [FIELDS <field,...>]
Arguments:<b>TO <xcFileName></b> is the name of the new database file to create. (.dbf) is the default extension if none is given. It can be specified as a literal file name or as a character expression enclosed in parentheses. <b>FIELDS <field,...></b> is an optional list of field names to copy from the currently open database in the specified order, the default is all fields. Names could be specified as uppercase or lowercase.
Returns:
Description:COPY STRUCTURE create a new empty database file with a structure that is based on the currently open database in this work-area. COPY STRUCTURE can be use to create a sub-set of the currently open database, based on a given field list. COPY STRUCTURE command is preprocessed into __dbCopyStruct() function during compile time.
Examples:// Create a new file that contains the same structure USE TEST COPY STRUCTURE TO MyCopy // Create a new file that contains part of the original structure USE TEST COPY STRUCTURE TO SomePart FIELDS name, address
Status:R
Compliance:C
Files:
See also:COPY STRUCTURE EXTENDED, dbCreate(), dbStruct(), __dbCopyStruct(), __dbCopyXStruct(), __dbCreate(), __dbStructFilter()
Back to index


COPY STRUCTURE EXTENDED

Lang:dbstrux.txt
Component:harbour
Doc. source:.\doc\en\dbstrux.txt
Template:Command
Category:Command
Subcategory:Database
Oneliner:Copy current database structure into a definition file
Syntax:COPY STRUCTURE EXTENDED TO <xcFileName>
Arguments:<xcFileName> The name of the target definition file to create. (.dbf) is the default extension if none is given. It can be specified as a literal file name or as a character expression enclosed in parentheses.
Returns:
Description:COPY STRUCTURE EXTENDED create a new database named <cFileName> with a pre-defined structure (also called "structure extended file"): <table> Field name Type Length Decimals FIELD_NAME C 10 0 FIELD_TYPE C 1 0 FIELD_LEN N 3 0 FIELD_DEC N 3 0 </table> Each record in the new file contains information about one field in the original file. CREATE FROM could be used to create a database from the structure extended file. For prehistoric compatibility reasons, Character fields which are longer than 255 characters are treated in a special way by writing part of the length in the FIELD_DEC according to the following formula (this is done internally): <fixed> FIELD->FIELD_DEC := Int( nLength / 256 ) FIELD->FIELD_LEN := ( nLength % 256 ) </fixed> Later if you want to calculate the length of a field you can use the following formula: <fixed> nLength := iif( FIELD->FIELD_TYPE == "C", ; FIELD->FIELD_DEC * 256 + FIELD->FIELD_LEN, ; FIELD->FIELD_LEN ) </fixed> COPY STRUCTURE EXTENDED command is preprocessed into __dbCopyXStruct() function during compile time.
Examples:// Open a database, then copy its structure to a new file, // Open the new file and list all its records USE Test COPY STRUCTURE EXTENDED TO TestStru USE TestStru LIST
Status:R
Compliance:C
Files:
See also:COPY STRUCTURE, CREATE, CREATE FROM, dbCreate(), dbStruct(), __dbCopyStruct(), __dbCopyXStruct(), __dbCreate()
Back to index


CREATE

Lang:dbstrux.txt
Component:harbour
Doc. source:.\doc\en\dbstrux.txt
Template:Command
Category:Command
Subcategory:Database
Oneliner:Create empty structure extended file
Syntax:CREATE <xcFileName> [VIA <xcRDDName>] [ALIAS <xcAlias>]
Arguments:<xcFileName> is the target file name to create and then open. (.dbf) is the default extension if none is given. It can be specified as literal file name or as a character expression enclosed in parentheses. <b>VIA <xcRDDName></b> is RDD name to create target with. If omitted, the default RDD is used. It can be specified as literal name or as a character expression enclosed in parentheses. <b>ALIAS <xcAlias></b> is an optional alias to USE the target file with. If not specified, alias is based on the root name of <xcFileName>.
Returns:
Description:CREATE a new empty structure extended file with the name <cFileName> and then open it in the current work-area. The new file has the following structure: <table> Field name Type Length Decimals FIELD_NAME C 10 0 FIELD_TYPE C 1 0 FIELD_LEN N 3 0 FIELD_DEC N 3 0 </table> CREATE command is preprocessed into __dbCopyStruct() function during compile time and use this mode.
Examples:// CREATE a new structure extended file, append some records and // then CREATE FROM this file a new database file CREATE template APPEND BLANK FIELD->FIELD_NAME := "CHANNEL" FIELD->FIELD_TYPE := "N" FIELD->FIELD_LEN := 2 FIELD->FIELD_DEC := 0 APPEND BLANK FIELD->FIELD_NAME := "PROGRAM" FIELD->FIELD_TYPE := "C" FIELD->FIELD_LEN := 20 FIELD->FIELD_DEC := 0 APPEND BLANK FIELD->FIELD_NAME := "REVIEW" FIELD->FIELD_TYPE := "C" // this field is 1000 char long FIELD->FIELD_LEN := 232 // 1000 % 256 = 232 FIELD->FIELD_DEC := 3 // 1000 / 256 = 3 CLOSE CREATE TV_Guide FROM template
Status:R
Compliance:C
Files:
See also:COPY STRUCTURE, COPY STRUCTURE EXTENDED, CREATE FROM, dbCreate(), dbStruct(), __dbCopyStruct(), __dbCopyXStruct(), __dbCreate()
Back to index


CREATE FROM

Lang:dbstrux.txt
Component:harbour
Doc. source:.\doc\en\dbstrux.txt
Template:Command
Category:Command
Subcategory:Database
Oneliner:Create new database file from a structure extended file
Syntax:CREATE <xcFileName> FROM <xcFileFrom> [VIA <xcRDDName>] [NEW] [ALIAS <xcAlias>]
Arguments:<xcFileName> is the target file name to create and then open. (.dbf) is the default extension if none is given. It can be specified as literal file name or as a character expression enclosed in parentheses. <b>FROM <xcFileFrom></b> is a structure extended file name from which the target file <xcFileName> is going to be built. It can be specified as literal file name or as a character expression enclosed in parentheses. <b>VIA <xcRDDName></b> is RDD name to create target with. If omitted, the default RDD is used. It can be specified as literal name or as a character expression enclosed in parentheses. <b>NEW</b> open the target file name <xcFileName> in the next available unused work-area and making it the current work-area. If omitted open the target file in current work-area. <b>ALIAS <xcAlias></b> is an optional alias to USE the target file with. If not specified, alias is based on the root name of <xcFileName>.
Returns:
Description:CREATE FROM open a structure extended file <xcFileFrom> where each record contain at least the following fields (in no particular order): FIELD_NAME, FIELD_TYPE, FIELD_LEN and FIELD_DEC. Any other field is ignored. From this information the file <xcFileName> is then created and opened in the current or new work-area (according to the NEW clause), if this is a new work-area it becomes the current. For prehistoric compatibility reasons, structure extended file Character fields which are longer than 255 characters should be treated in a special way by writing part of the length in the FIELD_DEC according to the following formula: <fixed> FIELD->FIELD_DEC := Int( nLength / 256 ) FIELD->FIELD_LEN := ( nLength % 256 ) </fixed> CREATE FROM command is preprocessed into __dbCopyStruct() function during compile time and uses this mode.
Examples:See example in the CREATE command
Status:R
Compliance:C
Files:
See also:COPY STRUCTURE, COPY STRUCTURE EXTENDED, CREATE, dbCreate(), dbStruct(), __dbCopyStruct(), __dbCopyXStruct(), __dbCreate()
Back to index


PACK

Lang:rddmisc.txt
Component:harbour
Doc. source:.\doc\en\rddmisc.txt
Template:Command
Category:Command
Subcategory:Database
Oneliner:Remove records marked for deletion from a database
Syntax:PACK
Arguments:(This command has no arguments)
Returns:
Description:This command removes records that were marked for deletion from the currently selected database. This command does not pack the contents of a memo field; those files must be packed via low-level functions. All open index files will be automatically reindexed once PACK command has completed its operation. On completion, the record pointer is placed on the first record in the database.
Examples:USE tests NEW INDEX tests dbGoto( 10 ) DELETE NEXT 10 PACK USE
Status:R
Compliance:C
Files:
See also:dbEval(), DELETE, Deleted(), ZAP, RECALL
Back to index


ZAP

Lang:rddmisc.txt
Component:harbour
Doc. source:.\doc\en\rddmisc.txt
Template:Command
Category:Command
Subcategory:Database
Oneliner:Remove all records from the current database file
Syntax:ZAP
Arguments:(This command has no arguments)
Returns:
Description:This command removes all of the records from the database in the current work area. This operation also updates any index file in use at the time of this operation. In addition, this command removes all items within an associated memo file. In a network environment, any file that is about to be ZAPped must be used exclusively.
Examples:USE tests NEW INDEX tests ZAP USE
Status:R
Compliance:C
Files:
See also:DELETE, PACK, USE
Back to index


SET ALTERNATE

Lang:set.txt
Component:harbour
Doc. source:.\doc\en\set.txt
Template:Command
Category:Command
Subcategory:Environment
Oneliner:Toggle and echos output to an alternate file
Syntax:SET ALTERNATE TO <cFile> [ADDITIVE] SET ALTERNATE on | OFF | ( <lAlter> )
Arguments:<cFile> Name of alternate file. <lAlter> Logical expression for toggle
Returns:
Description:This command toggles and output console information to the alternate file <cFile>, provided that the command is toggled on or the condition <lAlter> is set to a logical true (.T.). If <cFile> does not has a file extension, .txt will be assumed. The file name may optionally have a drive letter and/or directory path. If none is specified, the current drive and directory will be used. If the ALTERNATE file is created but no ALTERNATE ON command is issued, nothing will be echoed to the file. If ADDITIVE clause is used, then the information will be appended to the existing alternate file. Otherwise, a new file will be created with the specified name (or an existing one will be overwritten) and the information will be appended to the file. The default is to create a new file. A SET ALTERNATE TO command will close the alternate file
Examples:SET ALTERNATE TO test.txt SET ALTERNATE ON ? 'Harbour' ? "is" ? "Power" SET ALTERNATE TO SET ALTERNATE OFF
Status:R
Compliance:C
Files:
See also:CLOSE, SET PRINTER, SET CONSOLE, Set()
Back to index


SET BELL

Lang:set.txt
Component:harbour
Doc. source:.\doc\en\set.txt
Template:Command
Category:Command
Subcategory:Environment
Oneliner:Toggle the bell to sound once a GET has been completed.
Syntax:SET BELL on | OFF | ( <lBell> )
Arguments:<lBell> Logical expression for toggle command
Returns:
Description:This command toggles the bell to sound whenever a character is entered into the last character position of a GET, or if an invalid data type is entered into a GET. If <lBell> is a logical true (.T.), the bell will be turned ON; otherwise, the bell will be turned off.
Examples:SET BELL ON cDummy := Space( 20 ) @ 3, 2 GET cDummy READ SET BELL OFF
Status:R
Compliance:C
Files:
See also:Set()
Back to index


SET CENTURY

Lang:set.txt
Component:harbour
Doc. source:.\doc\en\set.txt
Template:Command
Category:Command
Subcategory:Environment
Oneliner:Toggle the century digits in all dates display
Syntax:SET CENTURY on | OFF | ( <lCent> )
Arguments:<lCent> Logical expression for toggle
Returns:
Description:This command allows the input and display of dates with the century prefix. It will be in the standart MM/DD/YYYY format unless specified by the SET DATE command or Set() function. If <lCent> is a logical true (.T.), the command will be set on; otherwise, the command will be set off
Examples:SET CENTURY ON ? Date() SET CENTURY OFF
Status:R
Compliance:C
Files:
See also:SET DATE, SET EPOCH, CToD(), Date(), DToC(), Set()
Back to index


SET CONSOLE

Lang:set.txt
Component:harbour
Doc. source:.\doc\en\set.txt
Template:Command
Category:Command
Subcategory:Environment
Oneliner:Toggle the console display
Syntax:SET CONSOLE ON | off | ( <lConsole> )
Arguments:<lConsole> Logical expression for toggle command
Returns:
Description:This command turns the screen display either off or on for all screens display other then direct output via the @...SAY commands or the <-> DevOut() function. If <lConsole> is a logical true (.T.), the console will be turned ON; otherwise, the console will be turned off.
Examples:SET CONSOLE ON ? Date() SET CONSOLE OFF ? Date()
Status:R
Compliance:C
Files:
See also:SET DEVICE, Set()
Back to index


SET DATE

Lang:set.txt
Component:harbour
Doc. source:.\doc\en\set.txt
Template:Command
Category:Command
Subcategory:Environment
Oneliner:Assigns a date format or chooses a predefined date data set.
Syntax:SET DATE FORMAT [TO] <cFormat> SET DATE [TO] [ANSI / BRITISH / FRENCH / GERMAN / ITALIAN / JAPAN / USA / AMERICAN]
Arguments:<cFormat> Keyword for date format
Returns:
Description:This command sets the date format for function display purposes. If specified, <cFormat> may be a customized date format in which the letters d, m and y may be used to design a date format. The default is an AMERICAN date format; specifying no parameters will set the date format to AMERICAN. Below is a table of the various predefined dates formats. <table> Syntax Date Format ANSI yy.mm.dd BRITISH dd/mm/yy FRENCH dd/mm/yy GERMAN dd.mm.yy ITALIAN dd-mm-yy JAPAN yy.mm.dd USA mm-dd-yy AMERICAN mm/dd/yy </table>
Examples:SET DATE JAPAN ? Date() SET DATE GERMAN ? Date()
Status:R
Compliance:C
Files:
See also:SET DATE, SET EPOCH, CToD(), Date(), DToC(), Set()
Back to index


SET DECIMALS

Lang:set.txt
Component:harbour
Doc. source:.\doc\en\set.txt
Template:Command
Category:Command
Subcategory:Environment
Oneliner:Toggle the console display
Syntax:SET DECIMALS TO [<nDecimal>]
Arguments:<nDecimal> Number of decimals places
Returns:
Description:This command establishes the number of decimal places that Harbour will display in mathematical calculations, functions, memory variables, and fields. Issuing no parameter with this command will the default number of decimals to 0. For decimals to be seen, the SET FIXED ON command must be activated.
Examples:SET FIXED ON ? 25141251 / 362 SET DECIMALS TO 10 ? 214514.214 / 6325
Status:R
Compliance:C
Files:
See also:SET FIXED, Set()
Back to index


SET DEFAULT

Lang:set.txt
Component:harbour
Doc. source:.\doc\en\set.txt
Template:Command
Category:Command
Subcategory:Environment
Oneliner:Establishes the Harbour search drive and directory.
Syntax:SET DEFAULT TO [<cPath>]
Arguments:<cPath> Drive and/or path.
Returns:
Description:This command changes the drive and directory used for reading and writing database, index, memory, and alternate files. Specifying no parameters with this command will default the operation to the current logged drive and directory.
Examples:SET DEFAULT TO C:\temp
Status:R
Compliance:C
Files:
See also:SET PATH, CurDir(), Set()
Back to index


SET DEVICE

Lang:set.txt
Component:harbour
Doc. source:.\doc\en\set.txt
Template:Command
Category:Command
Subcategory:Environment
Oneliner:Directs all @...SAY output to a device.
Syntax:SET DEVICE TO [printer | SCREEN ]
Arguments:None.
Returns:
Description:This command determines whether the output from the @...SAY command and the DevPos() and DevOut() function will be displayed on the printer. When the device is set to the PRINTER, the SET MARGIN value adjusts the position of the column values accordingly. Also, an automatic page eject will be issued when the current printhead position is less than the last printed row. Finally, if used in conjunction with the @...GET commands, the values for the GETs will all be ignored.
Examples:SET DEVICE TO SCREEN ? 25141251 / 362 SET DEVICE TO PRINTER SET PRINTER TO LPT1 ? 214514.214 / 6325 SET PRINTER OFF SET DEVICE TO SCREEN
Status:R
Compliance:C
Files:
See also:@...SAY, SET PRINTER, SetPRC(), Set()
Back to index


SET EPOCH

Lang:set.txt
Component:harbour
Doc. source:.\doc\en\set.txt
Template:Command
Category:Command
Subcategory:Environment
Oneliner:Specify a base year for interpreting dates
Syntax:SET EPOCH TO <nEpoch>
Arguments:<nEpoch> Base Century.
Returns:
Description:This command sets the base year value for dates that have only two digits. The default setting is 1900. Dates between 0100-01-01 and 2999-12-31 are fully supported.
Examples:SET EPOCH TO 2000
Status:R
Compliance:C
Files:
See also:SET DATE, SET CENTURY, CToD(), Date(), DToC(), Set()
Back to index


SET FIXED

Lang:set.txt
Component:harbour
Doc. source:.\doc\en\set.txt
Template:Command
Category:Command
Subcategory:Environment
Oneliner:Set the number of decimal position to be displayed
Syntax:SET FIXED on | OFF | ( <lFixed> )
Arguments:<lFixed> Logical expression for toggle
Returns:
Description:This command activates a system wide fixed placement of decimals places shown for all numeric outputs. If the value of <lFixed> is a logical true (.T.), FIXED will be turned ON; otherwise it will be turned OFF. When SET DECIMALS OFF is used, the following rules apply to the number of decimal placed displayed. <table> Addition Same as operand with the greatest number of decimal digits Subtraction Same as operand with the greatest number of decimal digits Multiplication Sum of operand decimal digits Division Determined by SET DECIMAL TO Exponential Determined by SET DECIMAL TO Log() Determined by SET DECIMAL TO Exp() Determined by SET DECIMAL TO Sqrt() Determined by SET DECIMAL TO Val() Determined by SET DECIMAL TO </table>
Examples:SET FIXED ON ? 25141251 / 362 SET FIXED OFF
Status:R
Compliance:C
Files:
See also:SET DECIMALS, Exp(), Log(), Sqrt(), Val(), Set()
Back to index


SET FUNCTION

Lang:set.txt
Component:harbour
Doc. source:.\doc\en\set.txt
Template:Command
Category:Command
Subcategory:Environment
Oneliner:Assign a character string to a function key
Syntax:SET FUNCTION <nFunctionKey> TO [<cString>]
Arguments:<nFunctionKey> is a number in the range 1..40 that represent the function key to be assigned. <cString> is a character string to set. If <cString> is not specified, the function key is going to be set to NIL releasing by that any previous Set Function or SetKey() for that function.
Returns:
Description:Set Function assign a character string with a function key, when this function key is pressed, the keyboard is stuffed with this character string. Set Function has the effect of clearing any SetKey() previously set to the same function number and vice versa. <table> nFunctionKey Key to be set 1 .. 12 F1 .. F12 13 .. 20 Shift-F3 .. Shift-F10 21 .. 30 Ctrl-F1 .. Ctrl-F10 31 .. 40 Alt-F1 .. Alt-F10 </table> SET FUNCTION command is preprocessed into __SetFunction() function during compile time.
Examples:// Set F1 with a string CLS SET FUNCTION 1 TO "I Am Lazy" + Chr( 13 ) cTest := Space( 20 ) @ 10, 0 SAY "type something or F1 for lazy mode " GET cTest READ ? cTest
Status:R
Compliance:Harbour use 11 and 12 to represent F11 and F12, while CA-Cl*pper use 11 and 12 to represent Shift-F1 and Shift-F2.
Files:
See also:Inkey(), SetKey(), __Keyboard()
Back to index


SET INTENSITY

Lang:set.txt
Component:harbour
Doc. source:.\doc\en\set.txt
Template:Command
Category:Command
Subcategory:Environment
Oneliner:Toggles the enhanced display of PROMPT's and GETs.
Syntax:SET INTENSITY ON | off | ( <lInte> )
Arguments:<lInte> Logical expression for toggle command
Returns:
Description:This command set the field input color and @...PROMPT menu color to either highlighted (inverse video) or normal color. The default condition is ON (highlighted).
Examples:SET INTENSITY ON
Status:R
Compliance:C
Files:
See also:@...GET,@...PROMPT,@...SAY, Set()
Back to index


SET KEY

Lang:set.txt
Component:harbour
Doc. source:.\doc\en\set.txt
Template:Command
Category:Command
Subcategory:Environment
Oneliner:Assign an action block to a key
Syntax:SET KEY <anKey> TO <bAction>] [WHEN <bCondition>]
Arguments:<anKey> is either a numeric key value, or an array of such values <bAction> is an optional code-block to be assigned <bCondition> is an optional condition code-block
Returns:
Description:The Set Key Command function is translated to the SetKey() function witch returns the current code-block assigned to a key when called with only the key value. If the action block (and optionally the condition block) are passed, the current block is returned, and the new code block and condition block are stored. A group of keys may be assigned the same code block/condition block by using an array of key values in place on the first parameter.
Examples:LOCAL bOldF10 := SetKey( K_F10, {|| Yahoo() } ) ... // some other processing SET KEY K_F10 TO bOldF10 ... // some other processing bBlock := SetKey( K_SPACE ) IF bBlock != NIL ... // make F10 exit current get, but only if in a get - ignores other // wait-states such as menus, achoices, etc... SetKey( K_F10, {|| GetActive():State := GE_WRITE }, ; {|| GetActive() != NIL } )
Status:R
Compliance:SET KEY is mostly CA-Cl*pper compliant. The only difference is the addition of the condition code-block parameter, allowing set-keys to be conditionally turned off or on. This condition-block cannot be returned once set - see SetKeyGet()
Files:
See also:hb_SetKeySave()
Back to index


SET MESSAGE

Lang:set.txt
Component:harbour
Doc. source:.\doc\en\set.txt
Template:Command
Category:Command
Subcategory:Environment
Oneliner:Establishes a message row for @...PROMPT command
Syntax:SET MESSAGE TO [<nRow> [CENTER]]
Arguments:<nRow> Row number to display the message
Returns:
Description:This command is designed to work in conjunction with the MENU TO and @...PROMPT commands. With this command, a row number between 0 and MaxRow() may be specified in <nRow>. This establishes the row on witch any message associated with an @...PROMPT command will appear. If the value of <nRow> is 0, all messages will be suppressed. All messaged will be left-justifies unless the CENTER clause is used. In this case, the individual messages in each @...PROMPT command will be centered at the designated row (unless <nRow> is 0). All messages are independent; therefore, the screen area is cleared out by the centered message will vary based on the length of each individual message. Specifying no parameters with this command set the row value to 0, witch suppresses all messages output. The British spelling of CENTRE is also supported.
Examples:See tests/menuto.prg
Status:R
Compliance:C
Files:
See also:Set(), SET WRAP, @...PROMPT, MENU TO
Back to index


SET PATH

Lang:set.txt
Component:harbour
Doc. source:.\doc\en\set.txt
Template:Command
Category:Command
Subcategory:Environment
Oneliner:Specifies a search path for opening files
Syntax:SET PATH TO [<cPath>]
Arguments:<cPath> Search path for files
Returns:
Description:This command specifies the search path for files required by most commands and functions not found in the current drive and directory. This pertains primarily, but not exclusively, to databases, indexes, and memo files, as well as to memory, labels and reports files. The search hierarchy is: 1 Current drive and directory, 2 The SET DEFAULT path; 3 The SET PATH path.
Examples:SET PATH TO C:\harbour\test
Status:R
Compliance:C
Files:
See also:SET DEFAULT, CurDir(), Set()
Back to index


SET PRINTER

Lang:set.txt
Component:harbour
Doc. source:.\doc\en\set.txt
Template:Command
Category:Command
Subcategory:Environment
Oneliner:Toggles the printer and controls the printer device
Syntax:SET PRINTER on | OFF SET PRINTER ( <lPrinter> ) SET PRINTER TO [<cPrinter>] [ADDITIVE]
Arguments:<lPrinter> Logical condition by which to toggle the printer <cPrinter> A device name or an alternate name
Returns:
Description:This command can direct all output that is not controlled by the @...SAY command and the DevPos() and DevOut() functions to the printer. If specified, the condition <lPrinter> toggles the printer ON if a logical true (.T.) and OFF if a logical false (.F.). If no argument is specified in the command, the alternate file (if one is open) is closed, or the device is reselected and the PRINTER option is turned OFF. If a device is specified in <cPrinter>, the output will be directed to that device instead of to the PRINTER. A specified device may be a literal string or a variable, as long as the variable is enclosed in parentheses. For a network, do not use a trailing colon when redirecting to a device. If an alternate file is specified, <cPrinter> becomes the name of a file that will contain the output. If no file extension is specified an extension of .prn will be defaulted to. If the ADDITIVE clause is specified, the information will be appended to the end of the specified output file. Otherwise, a new file will be created with the specified name (or an existing file will first be cleared) and the information will then be appended to the file. The default is to create a new file.
Examples:SET PRINTER ON SET PRINTER TO LPT1 ? 25141251 / 362 SET PRINTER .F.
Status:R
Compliance:C
Files:
See also:SET DEVICE, SET CONSOLE, DevOut(), Set()
Back to index


SET WRAP

Lang:set.txt
Component:harbour
Doc. source:.\doc\en\set.txt
Template:Command
Category:Command
Subcategory:Environment
Oneliner:Toggle wrapping the PROMPTs in a menu.
Syntax:SET WRAP on | OFF | ( <lWrap> )
Arguments:<lWrap> Logical expression for toggle
Returns:
Description:This command toggles the highlighted bars in a @...PROMPT command to wrap around in a bottom-to-top and top-to-bottom manner. If the value of the logical expression <lWrap> is a logical false (.F.), the wrapping mode is set OFF; otherwise, it is set ON.
Examples:See tests/menuto.prg
Status:R
Compliance:C
Files:
See also:@...PROMPT, MENU TO
Back to index


COPY FILE

Lang:file.txt
Component:harbour
Doc. source:.\doc\en\file.txt
Template:Command
Category:Command
Subcategory:FileSys
Oneliner:Copies a file.
Syntax:COPY FILE <cfile> TO <cfile1>
Arguments:<cFile> Filename of source file <cFile1> Filename of target file
Returns:
Description:This command makes an exact copy of <cFile> and names it <cFile1>. Both files must have the file extension included; the drive and the directory names must also be specified if they are different from the default drive and/or director. <cFile1> also can refer to a OS device (e.g. LPT1). This command does not observe the SET PATH TO or SET DEFAULT TO settings.
Examples:COPY FILE C:\harbour\tests\adir.prg TO C:\temp\adir.prg COPY FILE C:\harbour\tests\adir.prg TO LPT1
Status:R
Compliance:C
Files:
See also:ERASE, RENAME, FRename(), FErase()
Back to index


DELETE FILE

Lang:file.txt
Component:harbour
Doc. source:.\doc\en\file.txt
Template:Command
Category:Command
Subcategory:FileSys
Oneliner:Remove a file from disk
Syntax:DELETE FILE <xcFile>
Arguments:<xcFile> Name of file to remove
Returns:
Description:This command removes a file from the disk. The use of a drive, directo- ry, and wild-card skeleton operator is allowed for the root of the filename. The file extension is required. The SET DEFAULT and SET PATH commands do not affect this command. The file must be considered closed by the operating system before it may be deleted.
Examples:DELETE FILE C:\temp\read.txt
Status:R
Compliance:C
Files:
See also:CurDir(), File(), FErase(), ERASE
Back to index


DIR

Lang:dir.txt
Component:harbour
Doc. source:.\doc\en\dir.txt
Template:Command
Category:Command
Subcategory:FileSys
Oneliner:Display listings of files
Syntax:DIR [<cFileMask>]
Arguments:<cFileMask> File mask to include in the function return. It could contain path and standard wildcard characters as supported by your OS (like * and ?). If <cFileMask> contains no path, then SET DEFAULT path is used to display files in the mask.
Returns:
Description:If no <cFileMask> is given, __Dir() display information about all *.dbf in the SET DEFAULT path, this information contain: file name, number of records, last update date and the size of each file. If <cFileMask> is given, __Dir() list all files that match the mask with the following details: Name, Extension, Size, Date. DIR command is preprocessed into __Dir() function during compile time. __Dir() is a compatibility function, it is superseded by Directory() which returns all the information in a multidimensional array.
Examples:DIR // information for all DBF files in current directory DIR "*.dbf" // list all DBF file in current directory // list all PRG files in Harbour Run-Time library // for MS-DOS compatible operating systems DIR "src\rtl\*.prg" // list all files in the public section on a Unix like machine DIR "/pub"
Status:R
Compliance:C
Files:
See also:ADir(), Directory(), SET DEFAULT, __Dir()*
Back to index


ERASE

Lang:file.txt
Component:harbour
Doc. source:.\doc\en\file.txt
Template:Command
Category:Command
Subcategory:FileSys
Oneliner:Remove a file from disk
Syntax:ERASE <xcFile>
Arguments:<xcFile> Name of file to remove
Returns:
Description:This command removes a file from the disk. The use of a drive, directo- ry, and wild-card skeleton operator is allowed for the root of the filename. The file extension is required. The SET DEFAULT and SET PATH commands do not affect this command. The file must be considered closed by the operating system before it may be deleted.
Examples:ERASE C:\temp\read.txt
Status:R
Compliance:C
Files:
See also:CurDir(), File(), FErase(), DELETE FILE
Back to index


RENAME

Lang:file.txt
Component:harbour
Doc. source:.\doc\en\file.txt
Template:Command
Category:Command
Subcategory:FileSys
Oneliner:Changes the name of a specified file
Syntax:RENAME <cOldFile> TO <cNewFile>
Arguments:<cOldFile> Old filename <cNewFile> New Filename
Returns:
Description:This command changes the name of <cOldFile> to <cNewFile>. Both <cOldFile> and <cNewFile> must include a file extension. This command if not affected by the SET PATH TO or SET DEFAULT TO commands;drive and directory designates must be specified if either file is in a directory other then the default drive and directory. If <cNewFile> id currently open or if it previously exists, this command will not perform the desired operation.
Examples:RENAME test.txt TO test.old
Status:R
Compliance:C
Files:Library is core
See also:CurDir(), ERASE, File(), FErase(), FRename()
Back to index


TYPE

Lang:file.txt
Component:harbour
Doc. source:.\doc\en\file.txt
Template:Command
Category:Command
Subcategory:FileSys
Oneliner:Show the content of a file on the console, printer or file
Syntax:TYPE <xcFile> [TO PRINTER] [TO FILE <xcDestFile>]
Arguments:<xcFile> is a name of the file to display. If the file have an extension, it must be specified (there is no default value). It can be specified as literal file name or as a character expression enclosed in parentheses. TO PRINTER is an optional keyword that specifies that the output should go to both the screen and printer. TO FILE <xcDestFile> copy the source <xcFile> also to a file. If no extension is given (.txt) is added to the output file name. <xcDestFile> can be specified as literal file name or as a character expression enclosed in parentheses.
Returns:
Description:TYPE command type the content of a text file on the screen with an option to send this information also to the printer or to an alternate file. The file is displayed as is without any headings or formatting. If <xcFile> contain no path, TYPE try to find the file first in the SET DEFAULT directory and then in search all of the SET PATH directories. If <xcFile> can not be found a run-time error occur. If <xcDestFile> contain no path it is created in the SET DEFAULT directory. Use SET CONSOLE OFF to suppress screen output. You can pause the output using Ctrl-S, press any key to resume.
Examples:The following examples assume a file name mytext.dat exist in all specified paths, a run-time error would displayed if it does not // display mytext.dat file on screen TYPE mytext.dat // display mytext.dat file on screen and printer TYPE mytext.dat TO PRINTER // display mytext.dat file on printer only SET CONSOLE OFF TYPE mytext.dat TO PRINTER SET CONSOLE ON // display mytext.dat file on screen and into a file myreport.txt TYPE mytext.dat TO FILE myreport
Status:R
Compliance:C
Files:
See also:COPY FILE, SET DEFAULT, SET PATH, SET PRINTER, __TypeFile()
Back to index


LABEL FORM

Lang:tlabel.txt
Component:harbour
Doc. source:.\doc\en\tlabel.txt
Template:Command
Category:Command
Subcategory:Legacy
Oneliner:Displays labels to the screen or an alternate device
Syntax:LABEL FORM <cLabelName> [TO PRINTER] [TO FILE <cFile>] [<cScope>] [WHILE <bWhile> ] [FOR <bFor> ] [SAMPLE] [NOCONSOLE]
Arguments:<cLabelName> Name of label file <cFile> Name of an alternate file <cScope> Expression of a scoping condition <bWhile> WHILE condition <bFor> FOR condition
Returns:
Description:This command allows labels to be printed based on the format outlined in LBL file specified as <cLabelName>. By default, output will go to the screen however this output may be rerouted with either the TO PRINTER or the TO FILE clause. If the TO FILE clause is specified, the name of the ASCII text file containing the generated labels will be <cFile>. If no file extension is specified a .txt extension is added. <cScope> is the scope condition for this command. Valid scopes include NEXT <expN> (number of records to be displayed, where <expN> is the number of records), RECORD <expN> (a specific record to be printed), REST (all records starting from the current record position, and ALL (all records). The default is ALL. Both logical expression may work ill conjunction with one another where <bFor> is the logical expression for the FOR condition (for records to be displayed whitin a given value range) and <bWhile> for the WHILE condition (for records to be displayed until they fail to meet the condition). If the SAMPLE clause is specified, test labels will be generated. If the NOCONSOLE clause is specified, the console will be turned off while this command is being executed. This command follows the search criteria outlined in the SET PATH TO command. The path may be specified, along, with (the drive letter, in <cLabelName>
Examples:PROCEDURE Main() USE test NEW LABEL FORM test.lbl USE RETURN
Status:R
Compliance:C
Files:Library is core
See also:REPORT FORM
Back to index


REPORT FORM

Lang:treport.txt
Component:harbour
Doc. source:.\doc\en\treport.txt
Template:Command
Category:Command
Subcategory:Legacy
Oneliner:Display a report
Syntax:REPORT FORM <cReportName> [TO PRINTER] [TO FILE <cFile>] [<cScope>] [WHILE <bWhile> ] [FOR <bFor> ] [PLAIN |HEADING <cHeading>] [NOEJECT] [SUMMARY] [NOCONSOLE]
Arguments:<cReportName> Name of report file <cFile> Name of alternate file <cScope> Scope. <bWhile> Logical expression of WHILE condition . <bFor> Logical expression of FOR condition. <cHeading> Report heading
Returns:
Description:This command prints out the report named <cReportName>, which is a standard FRM file. The file extension is not required because .frm will be assumed. The SET PATH TO and SET DEFAULT TO commands affect the search for the file <cReportName>; unless a drive and path are specified in <cReportName>, REPORT will search the path specified in the SET PATH command if it cannot find the report form in the current directory. The output of the report will be offset based on the setting of the SET MARGIN TO value. By default, output will go to the console; however, it may be controlled via either the TO PRINTER or TO FILE clause. If the output is to go to the file, the name of the alternate file is specified in <cFile>. Unless specified in <cFile>, the default file extension will be TXT. <cScope> is the scope for this command. Valid scopes include NEXT <expN> (where <expN> is the number of records), RECORD <expN> (a specific record to be displayed), REST (all records from the current record position), and ALL (all records). The default is ALL. Both logical expressions may work in conjuntion with one another, where <bFor> is the logical expression for the FOR condition (for records to be displayed within a given range) and <bWhile> for the WHILE condition (for records to be displayed until the condition fails). If the PLAIN clause is specified, date and page numbers are suppressed. In addition, there is no automatic page breaking, and the report title and column headings appear only once at the top of the form. If the HEADING clause is used, <cHeading> is displayed on the first title of each report page. The value of <cHeading> is evaluated only once before executing the report; varying the values of <cHeading> is not allowed. The PLAIN clause will take precedence over the HEADING clause if both are included. If the NOEJECT clause is used, the initial page eject on the report will not be issued when the output clause TO PRINTER is specified. Otherwise, this clause has no effect. If the SUMMARY Clause is specified, the report will contain only groups, subgroups, and grand total information. The detailed title item information will be ignored. If the NOCONSOLE clause is specified, output to the console will be turned off while this command is being executed.
Examples:PROCEDURE Main() USE test NEW REPORT FORM test.frm USE RETURN
Status:R
Compliance:C
Files:Library is core
See also:LABEL FORM
Back to index


EJECT

Lang:terminal.txt
Component:harbour
Doc. source:.\doc\en\terminal.txt
Template:Procedure
Category:Command
Subcategory:Printer
Oneliner:Issue an command to advance the printer to the top of the form
Syntax:EJECT
Arguments:None
Returns:
Description:This command issue an form-feed command to the printer. If the printer is not properly hooked up to the computer, an error will not be generated and the command will be ignored. Once completed, the values of PRow() and PCol(), the row and column indicators to the printer, will be set to 0. Their values, however, may be manipulated before or after ussuing an EJECT by using the DevPos() function. On compile time this command is translated into __Eject() function.
Examples:USE Clientes NEW SET DEVICE TO PRINTER CurPos := 0 WHILE ! Eof() ? Clientes->nome, Clientes->endereco Curpos++ IF Curpos > 59 Curpos := 0 EJECT ENDIF ENDDO SET DEVICE TO SCREEN USE
Status:R
Compliance:C
Files:
See also:DevPos(), SET PRINTER, PRow(), PCol()
Back to index


FIELD

Lang:memvar.txt
Component:harbour
Doc. source:.\doc\en\memvar.txt
Template:Command
Category:Command
Subcategory:RDD
Oneliner:Declares a list of database field names.
Syntax:FIELD <xField> [, <xFieldn...> [IN <cDatabase>]
Arguments:<xField> A valid field name <xFieldn> Additional field name <cDatabase> An valid alias name
Returns:
Description:This command declares the names of fields <xField> (and <xFieldn> and following) with an optional alias identifier as <cDatabase> for each. This command allow Harbour to resolve any reference to a field specified in the field list by viewing it as a field when it is not referenced by an alias. If a field is not listed in this list and it is not explicity tagged with an alias indentifier, it may be viewed as a memory variable, which may cause run-time errors. This command has no effect on memory variables or on field reference buried within a macro expression.
Examples:PROCEDURE Main() FIELD Id FIELD Name USE tests NEW Name := "Sales" Id := 5 USE RETURN
Status:R
Compliance:C
Files:None.
See also:MEMVAR, PRIVATE, PUBLIC, STATIC
Back to index


@...GET

Lang:sayget.txt
Component:harbour
Doc. source:.\doc\en\sayget.txt
Template:Command
Category:Command
Subcategory:User interface
Oneliner:Creates a GET object and displays it to the screen
Syntax:@ <nRow>, <nCol> [SAY <cSay> [PICTURE <cSayPict>] COLOR <cSayColor> ] GET <xVar> [PICTURE <cGetPict>] [WHEN <lWhen>] [COLOR <cGetColor>] [VALID <lValid> / RANGE <xStart>, <xEnd>]
Arguments:<nRow> The row coordinate. <nCol> The column coordinate. <cSay> Message to display. <cSayPict> Character expression of PICTURE displayed. <cSayColor> Color to be Used for the SAY expression. <xVar> An variable/field name. <cGetPict> Character expression of PICTURE to get. <lWhen> Logical expression to allow GET. <lValid> Logical expression to validate GET input. <xStart> Lower RANGE value. <xEnd> Upper RANGE value. <cGetColor> Color string to be used for the GET expression.
Returns:
Description:This command adds a GET object to the reserved array variable named GETLIST[] and displays it to the screen. The field or variable to be added to the GET object is specified in <xVar> and is displayed at row, column coordinate <nRow>, <nCol>. If the SAY clause is used <cSay> will be displayed starting at <nRow>, <nCol>, with the field variable <xVar> displayed at Row(), Col()+ 1. If <cSayPicr>, the picture template for the SAY expression <cSay>, is used, all formatting rules contained will apply See the TRANSFORM I function for further information. If <cGetPict> is specified, the PICTURE clause of <xVar> will be used for the GET object and all formatting rules will apply. See the table below for GET formatting rules. If the WHEN clause is specified, when <lWhen> evaluates to a logical true (.T.) condition, the GET object will he activated otherwise the GET object will be skipped and no information will be obtained via the screen. The name of a user-defined function returning a logical true (.T.) or false ( F.) or a code block may be, specified in <lWhen> This clause not activated until a READ command or ReadModal() function call is issued. If the VALID clause is specified and <lValid> evaluates to it logical true (.T.) condition the current GET will be considered valid and the get operation will continue onto the next active GET object. If not, the cursor will remain on this GET object until aborted or until the condition in <lValid> evaluates to true (.T.). The name of a user-defined function returning a logical true (.T.) or false (.F.) or it code block may be specified in <lValid>. This clause is not activated until a READ command or ReadModal( ) function call is issued. If the RANGE clause is specified instead of the VALID clause, the two inclusive range values for <xVar> must be specified in <xStart> and <xEnd>. Id <xVar> is a date data type, <xStart> and <xEnd> must also be date data types; if <xVar> is a numeric data type <xStart> and <xEnd> must also be numeric data types. If a value fails the RANGE test ,a message of OUT OF RANGE will appear in the SCOREBOARD area (row = 0, col = 60). The RANGE message may be turned off it the SET SCOREBOARD command or Set() function appropriately toggled. NOTE GET functions/formatting rules: <table> @A Allows only alphabetic characters. @B Numbers will be left justified @C All positive numbers will be followed by CR. @D All dates will be in the SET DATE format. @E Dates will be in British formal: numbers in European format. @K Allows a suggested value to be seen within the GET area but clears It if any non cursor key is pressed when the cursor is in the first Position in the GET area. @R Non template characters will be inserted. @S<nSize> Allows horizontal scrolling of a field or variable that is <nSize> characters wide. @X All negative numbers will be followed by DB @Z Displays zero values as blanks. @! Forces uppercase lettering @( Displays negative numbers in parentheses with leading spaces. @) Displays negative numbers in parentheses without leading spaces. </table> GET templates/formatting rules: <table> A Only alphabetic characters allowed. N Only alphabetic and numeric characters allowed X Any character allowed. L Only T or F allowed For logical data. Y Only Y or N allowed for logical data. 9 Only digits, including signs, will be allowed. # Only digits, signs. and spaces will he allowed. ! Alphabetic characters are converted to Uppercase. $ Dollar will be displayed in place of leading spaces for numeric data types. * Asterisk,, will Be displayed in place of leading spaces for numeric data types. . Position of decimal point. , Position of comma. </table> Format PICTURE functions may he grouped together as well as used in Conjunction with a PICTURE templates;however, a blank space must be included in the PICTURE string if there are both functions and templates.
Examples:PROCEDURE Main() LOCAL cVar := Space( 50 ) LOCAL nId := 0 CLS @ 3, 1 SAY "Name" GET cVar PICTURE "@!S 30" @ 4, 1 SAY "Id" GET nId PICTURE "999.999" READ ? "The name you entered is", cVar ? "The id you entered is", nId RETURN
Status:R
Compliance:C
Files:
See also:@...SAY, READ, Transform()
Back to index


@...PROMPT

Lang:menu.txt
Component:harbour
Doc. source:.\doc\en\menu.txt
Template:Command
Category:Command
Subcategory:User interface
Oneliner:Display a menu item on screen and define a message
Syntax:@ <nRow>, <nCol> PROMPT <cPrompt> [MESSAGE <xMsg>]
Arguments:<nRow> is the row number to display the menu <cPrompt>. Value could range from zero to MaxRow(). <nCol> is the column number to display the menu <cPrompt>. Value could range from zero to MaxCol(). <cPrompt> is the menu item character string to display. <xMsg> define a message to display each time this menu item is highlighted. <xMsg> could be a character string or code block that is evaluated to a character string. If <xMsg> is not specified or of the wrong type, an empty string ("") would be used.
Returns:
Description:With @...Prompt you define and display a menu item, each call to @...Prompt add another item to the menu, to start the menu itself you should call the __MenuTo() function (MENU TO command). You can define any row and column combination and they will be displayed at the order of definition. After each call to @...Prompt, the cursor is placed one column to the right of the last text displayed, and Row() and Col() are updated. @...PROMPT command is preprocessed into __AtPrompt() function during compile time.
Examples:// display a two line menu with status line at the bottom // let the user select favorite day SET MESSAGE TO 24 CENTER @ 10, 2 PROMPT "Sunday" MESSAGE "This is the 1st item" @ 11, 2 PROMPT "Monday" MESSAGE "Now we're on the 2nd item" MENU TO nChoice DO CASE CASE nChoice == 0 // user press Esc key QUIT CASE nChoice == 1 // user select 1st menu item ? "Guess you don't like Mondays" CASE nChoice == 2 // user select 2nd menu item ? "Just another day for some" ENDCASE
Status:R
Compliance:C(menu)
Files:
See also:AChoice(), MENU TO, SET MESSAGE, SET INTENSITY, SET WRAP, __MenuTo()
Back to index


@...SAY

Lang:sayget.txt
Component:harbour
Doc. source:.\doc\en\sayget.txt
Template:Command
Category:Command
Subcategory:User interface
Oneliner:Displays data at specified coordinates of the current device.
Syntax:@ <nRow>, <nCol> SAY <xValue> [ PICTURE <cPict> ] [COLOR <cColor>]
Arguments:<nRow> Row coordinate <nCol> Column coordinate <xValue> Value to display <cPict> PICTURE format <cColor> Color string
Returns:
Description:This command displays the contents of <xValue> at row column coordinates <nRow>, <nCol>. A PICTURE clause may be specified in <cPict>. If the current device is set to the printer, the output will go to the printer; the default is for all output to go to the screen. For a complete list of PICTURES templates and functions, see the @...GET command.
Examples:PROCEDURE Main() CLS @ 2, 1 SAY "Harbour" @ 3, 1 SAY "is" COLOR "b/r+" @ 4, 1 SAY "Power" PICTURE "@!" RETURN
Status:R
Compliance:C
Files:
See also:@...GET, SET DEVICE, Transform()
Back to index


KEYBOARD

Lang:input.txt
Component:harbour
Doc. source:.\doc\en\input.txt
Template:Command
Category:Command
Subcategory:User interface
Oneliner:Stuffs the keyboard with a string.
Syntax:KEYBOARD <cString>
Arguments:<cString> String to be processed, one character at a time, by the Harbour keyboard processor
Returns:
Description:This command stuffs the input buffer with <cString>. The number of characters that can be stuffed into the keyboard buffer is controlled by the SET TYPEAHEAD command and may range from 0 to 32622, with each character being in the ASCII range of 0 to 255. None of the extended keys may be stuffed into the keyboard buffer. Issuing a KEYBOARD " " will clear the keyboard buffer.
Examples:// Stuff an Enter key into the keyboard buffer KEYBOARD Chr( 13 ) // Clear the keyboard buffer CLEAR TYPEAHEAD // KEYBOARD Chr( 13 ); ? Inkey() // ==> 13 KEYBOARD "Hello"; CLEAR TYPEAHEAD; ? Inkey() // ==> 0
Status:R
Compliance:KEYBOARD is compliant with CA-Cl*pper 5.3
Files:
See also:CLEAR TYPEAHEAD, __Keyboard()
Back to index


LOCAL

Lang:memvar.txt
Component:harbour
Doc. source:.\doc\en\memvar.txt
Template:Command
Category:Command
Subcategory:Variable management
Oneliner:Initializes a local memory variable or array
Syntax:LOCAL <xVar> [:= <xInit> ]
Arguments:<xVar> Name of a memory variable or array. <xInit> Value to be assinged to a variable or array
Returns:
Description:This command created a LOCAL memory variable or array. The name of either is specified in <xVar>. If more then one variable is being initialized with the LOCAL command, separate each entry with a comma. If a variable or an array is to be assingned a start-up value, that expression may be specified in <xInit> and folling. Is Strong type compile mode is used, the Compiler will check if the value recived matchs the type specified in <xType>. LOCAL varibles are symbols generated at run time and are resolved at compile time. The visibility and life span of a LOCAL variable or array is limited to the function or procedure in which it is defined. No macro expansions are allowed in the LOCAL declaration statement. No Harbour command other then FUNCTION, PROCEDURE, PUBLIC, PRIVATE, PARAMETERS, MEMVAR, STATIC and FIELD, may precede the LOCAL command. LOCAL array reference may not be initialized (i.e., assigned values) on the same command line as the LOCAL command statement. This can be done later in the program. LOCAL variables and arrays are not affected by the RELEASE command.
Examples:PROCEDURE Main() LOCAL n, lVar n := iif( lVar, "A", 3 ) n := 2 n := "a" n := Seconds() + 2 n := Int( Seconds() + 2 ) RETURN
Status:R
Compliance:C
Files:None
See also:FIELD, PRIVATE, PUBLIC, STATIC, MEMVAR
Back to index


MEMVAR

Lang:memvar.txt
Component:harbour
Doc. source:.\doc\en\memvar.txt
Template:Command
Category:Command
Subcategory:Variable management
Oneliner:Declares private and public variables and arrays.
Syntax:MEMVAR <xVar>
Arguments:<xVar> Memory variable Name
Returns:
Description:This command tells the compiler to resolve any reference to a memory variable designated within this list s if it possessed an explicit memory variable alias with either the M-> or MEMVAR-> prefix.Only those memory variables that do not contain any such explicit are affected by this command. Those memory variabls within macro expansions are not affected by this command. The MEMVAR declaration must apear before any executable commands;it is similat to the LOCAL, STATIC, FIELD, PARAMETERS, FUNCTION, and PROCEDURE commands statements.
Examples:MEMVAR y AS NUMERIC PROCEDURE Main() LOCAL n, lVar n := iif( lVar, "A", 3 ) n := 2 n := "a" n := Seconds() + 2 n := Int( Seconds() + 2 ) y := n ? y RETURN
Status:R
Compliance:C
Files:None.
See also:LOCAL, STATIC, FIELD, PRIVATE, PUBLIC
Back to index


ft_Byt2Bit

Lang:byt2bit.txt
Component:hbnf
Doc. source:hbnf\doc\en\byt2bit.txt
Template:
Category:Conversion
Subcategory:
Oneliner:Convert byte to string of 1's and 0's
Syntax:ft_Byt2Bit( <cByte> ) -> cBitPattern
Arguments:<cByte> is the byte to convert.
Returns:9-character string, consisting of 1's and 0's, representing bits 0 through 7 of parameter byte, with space between bits 3 and 4. Returns NIL if parameters are faulty.
Description:Can be used to show results of bit manipulation, both before and after. Binary representation follows right-to-left convention of bit position numbering, 0 through 7. Space between high and low nibbles for clarity and easy comparison to hexadecimal notation. This function is presented to illustrate that bit-wise operations are possible with Clipper code. For greater speed, write .c or .asm versions and use the Clipper Extend system.
Examples:// These three code lines perform a bitwise AND on bytes with values of // hb_BChar( 20 ) and hb_BChar( 36 ), and deliver the result as a string // in binary (bit) format. ? ft_Byt2Bit( hb_BChar( 20 ) ) // byte1: '0001 0100' ? ft_Byt2Bit( hb_BChar( 36 ) ) // byte2: '0010 0100' ? ft_Byt2Bit( ft_ByteAnd( hb_BChar( 20 ), hb_BChar( 36 ) ) ) // result: '0000 0100'
Status:
Compliance:
Files:
See also:ft_Byt2Hex()
Back to index


ft_Byt2Hex

Lang:byt2hex.txt
Component:hbnf
Doc. source:hbnf\doc\en\byt2hex.txt
Template:
Category:Conversion
Subcategory:
Oneliner:Convert byte to hexadecimal version of its binary value
Syntax:ft_Byt2Hex( cByte ) -> cHexValue
Arguments:<cByte> is the byte to convert.
Returns:Three-character string, consisting of two digits of hexadecimal notation and letter 'h' to signify hex. Returns NIL if parameters are faulty.
Description:Can be used to show results of bit manipulation, both before and after. This function is presented to illustrate that bit-wise operations are possible with Clipper code. For greater speed, write .c or .asm versions and use the Clipper Extend system.
Examples:// These three code lines perform a bitwise AND on bytes with values of // hb_BChar( 20 ) and hb_BChar( 36 ), and deliver the result as a string // in hexadecimal format, using 'h' to signify hexadecimal. ? ft_Byt2Hex( hb_BChar( 20 ) ) // byte1: '14h' ? ft_Byt2Hex( hb_BChar( 36 ) ) // byte2: '24h' ? ft_Byt2Hex( ft_ByteAnd( hb_BChar( 20 ), hb_BChar( 36 ) ) ) // result: '04h'
Status:
Compliance:
Files:
See also:ft_Byt2Bit()
Back to index


ft_D2E

Lang:d2e.txt
Component:hbnf
Doc. source:hbnf\doc\en\d2e.txt
Template:
Category:Conversion
Subcategory:
Oneliner:Convert decimal to scientific notation
Syntax:ft_D2E( <nDec>, <nPrecision> ) -> <cNumE>
Arguments:<nDec> Decimal number to convert <nPrecision> Number of decimal places in result. Defaults to 6 decimal places.
Returns:<cNumE> A string representing a number in scientific notation
Description:Given a decimal number and the desired precision, a string representing the equivalent in scientific notation is returned.
Examples:? ft_D2E( 12.345, 2 ) // -> 1.23E1 ? ft_D2E( -12.345, 3 ) // -> -1.235E1 ? ft_D2E( 0.00000543, 2 ) // -> 5.43E-6
Status:
Compliance:
Files:
See also:ft_E2D()
Back to index


ft_Dec2Bin

Lang:dectobin.txt
Component:hbnf
Doc. source:hbnf\doc\en\dectobin.txt
Template:
Category:Conversion
Subcategory:
Oneliner:Convert decimal to binary
Syntax:ft_Dec2Bin( <nNum> ) -> cBinaryNumber
Arguments:<nNum> is the numeric expression to be converted.
Returns:A character string representing <nNum> in binary format.
Description:This function can be used in conjunction with any bit-wise operations.
Examples:? ft_Dec2Bin( 255 ) // "11111111" ? ft_Dec2Bin( 2 ) // "00000010"
Status:
Compliance:
Files:
See also:
Back to index


ft_Descend

Lang:descendn.txt
Component:hbnf
Doc. source:hbnf\doc\en\descendn.txt
Template:
Category:Conversion
Subcategory:
Oneliner:Create a descending index key value
Syntax:ft_Descend( <exp> ) -> <value>
Arguments:<exp> is any expression of character, numeric, date, or logical type.
Returns:The inverse of <exp>
Description:This function is a replacement for CA-Cl*pper's Descend() function, which is known to produce memory corruption occassionally.
Examples:? ft_Descend( 1 ) // Returns -1
Status:
Compliance:
Files:
See also:ft_XToY()
Back to index


ft_E2D

Lang:e2d.txt
Component:hbnf
Doc. source:hbnf\doc\en\e2d.txt
Template:
Category:Conversion
Subcategory:
Oneliner:Convert scientific notation string to a decimal
Syntax:ft_E2D( <cNumE> ) -> <nDec>
Arguments:<cNumE> Scientific notation string to convert
Returns:<nDec> Decimal number
Description:Given a string in the format x.yEz, the decimal equivalent is returned.
Examples:? ft_E2D( "1.23E1" ) // -> 12.3 ? ft_E2D( "-1.235E1" ) // -> -12.35 ? ft_D2E( "5.43E-6" ) // -> 0.0000543
Status:
Compliance:
Files:
See also:ft_D2E()
Back to index


ft_EscCode

Lang:prtesc.txt
Component:hbnf
Doc. source:hbnf\doc\en\prtesc.txt
Template:
Category:Conversion
Subcategory:
Oneliner:Convert Lotus style escape codes
Syntax:ft_EscCode( <cASCII> ) -> <cPrinterFormat>
Arguments:<cASCII> is the ASCII representation of the printer control codes in Lotus 123 format (e.g. "\027E" for hb_BChar( 27 ) + "E") "\nnn" will be converted to hb_BChar( nnn ) "\\" will be converted to "\"
Returns:The binary version of an ASCII coded printer setup string.
Description:This function is useful for allowing the user to enter printer control codes in Lotus-style ASCII format, and then having this function convert that code to the format that the printer needs to receive.
Examples:cSetup := "\015" // default = Epson compressed print UserInput( @cSetup ) // Let user modify setup code SET DEVICE TO PRINTER // get ready to print ?? ft_EscCode( cSetup ) // Output the converted code
Status:
Compliance:
Files:
See also:
Back to index


ft_Hex2Dec

Lang:hex2dec.txt
Component:hbnf
Doc. source:hbnf\doc\en\hex2dec.txt
Template:
Category:Conversion
Subcategory:
Oneliner:Convert a hex number to decimal
Syntax:ft_Hex2Dec( <cHexNum> ) -> nDecNum
Arguments:<cHexNum> is a character string representing a hex number.
Returns:A decimal number.
Description:Converts a hexadecimal number to a BASE 10 decimal number. Useful for using ft_int86().
Examples:ft_int86( HEX2DEC( "21" ), aRegs ) // Converts 21h, the Dos Interrupt, to its decimal equivalent, // 33, for use by ft_int86().
Status:
Compliance:
Files:
See also:
Back to index


ft_InvClr

Lang:invclr.txt
Component:hbnf
Doc. source:hbnf\doc\en\invclr.txt
Template:
Category:Conversion
Subcategory:
Oneliner:Get the inverse of a color
Syntax:ft_InvClr( [ <cDsrdColor> ] ) -> cColor
Arguments:<cDsrdColor> is the color to get the inverse of. Defaults to current color.
Returns:The inverse of the passed color.
Description:This function inverts a passed color (in the Clipper format: ??/??), e.g., "W/N" is converted to "N/W".
Examples:cInverse := ft_InvClr() // Get Inverse of Current Color cInvErr := ft_InvClr( cErrColor ) // Get Inverse of cErrorColor
Status:
Compliance:
Files:
See also:
Back to index


ft_NToW

Lang:ntow.txt
Component:hbnf
Doc. source:hbnf\doc\en\ntow.txt
Template:
Category:Conversion
Subcategory:
Oneliner:Translate numeric value to words
Syntax:ft_NToW( <nNumber> ) -> cWords
Arguments:<nNumber> An integer to translate
Returns:A text string representing <nNumber>
Description:Translates numeric input to a text string. FT_NTOW is intended to be used with integers only. Since I don't know what your application will be, I can't assume the type of fraction you want returned (ninety nine cents, 99/100, .99, etc). If you want the fraction in words, just pass it as an integer. Do not pass a negative number! Handle negative numbers any way you need to in your code. (ie: CR, DB, Negative, Minus, etc.) Also, numeric 0 is returned as a null string. You will need to make a decision how to output it (zero dollars, no dollars, etc).
Examples:? ft_NToW( 999 ) // -> Nine Hundred Ninety Nine ? ft_NToW( 1000 ) // -> One Thousand ? ft_NToW( 23 ) + " Dollars and " + ft_NToW( 99 ) + " Cents" // -> Twenty Three Dollars and Ninety Nine Cents ? ft_NToW( 23 ) + " Dollars and " + "99/100" // -> Twenty Three Dollars and 99/100 x := -23.99 cents := Str( ( x - Int( x ) ) * 100, 2, 0 ) + "/100" x := Int( x ) string := iif( x < 0, "Credit of ", "Debit of " ) ? string + ft_NToW( Abs( x ) ) + " Dollars and " + "99/100" // -> Credit of Twenty Three Dollars and 99/100
Status:
Compliance:
Files:
See also:
Back to index


ft_Sqzn

Lang:sqzn.txt
Component:hbnf
Doc. source:hbnf\doc\en\sqzn.txt
Template:
Category:Conversion
Subcategory:
Oneliner:Compress a numeric value into a character string
Syntax:ft_Sqzn( <nValue> [, <nSize> [, <nDecimals> ] ] ) -> cCompressed
Arguments:nValue - The numeric value to be compressed nSize - Optional size of numeric field, defaults to 10 nDecimals - Optional number of decimal places, defaults to 0
Returns:cCompressed - Compressed string, 50% the size of nSize
Description:The FT_SQZN function allows a numeric value to be compressed when stored in the database. The compression is 50% the storage space of the original number. The companion function, FT_UNSQZN returns the original number from the compressed string.
Examples:REPLACE ; TRANS->cust_id WITH ft_Sqzn( mcust_id, 8 ), ; TRANS->amount WITH ft_Sqzn( mamount, 12, 2 )
Status:
Compliance:
Files:
See also:ft_Unsqzn()
Back to index


ft_SToD

Lang:stod.txt
Component:hbnf
Doc. source:hbnf\doc\en\stod.txt
Template:
Category:Conversion
Subcategory:
Oneliner:Convert a date string to a Clipper date data type
Syntax:ft_SToD( <cDateStr> ) -> dDateType
Arguments:<cDateStr> is a Clipper string in the format "CCYYMMDD".
Returns:A Clipper date type.
Description:This function allows the programmer to hard code a date into the program without knowing what the current date type is. This function is the converse of the Clipper DToS() function.
Examples:LOCAL dMyDate dMyDate := ft_SToD( "19901127" )
Status:
Compliance:
Files:
See also:
Back to index


ft_Unsqzn

Lang:sqzn.txt
Component:hbnf
Doc. source:hbnf\doc\en\sqzn.txt
Template:
Category:Conversion
Subcategory:
Oneliner:Uncompress a numeric compressed by ft_Sqzn()
Syntax:ft_Unsqzn( <cCompressed>, <nSize> [, <nDecimals> ] ) -> nValue
Arguments:<cCompressed> - Compressed string, obtained from ft_Sqzn() <nSize> - Size of numeric field <nDecimals> - Optional number of decimal places
Returns:nValue - Uncompressed numeric value
Description:The FT_UNSQZN function returns the numeric value from the compressed string. The compression is 50% the storage space of the original number. The original number must have been compressed using the ft_Sqzn() function. This function, along with ft_Sqzn() can be used to reduce disk storage requirements for numeric fields in a database file.
Examples:mcust_id := ft_Unsqzn( TRANS->cust_id, 8 ) mamount := ft_Unsqzn( TRANS->amount, 12, 2 )
Status:
Compliance:
Files:
See also:ft_Sqzn()
Back to index


ft_XToY

Lang:any2any.txt
Component:hbnf
Doc. source:hbnf\doc\en\any2any.txt
Template:
Category:Conversion
Subcategory:
Oneliner:Convert from any data type to any other data type
Syntax:ft_XToY( <xValueToConvert>, <cTypeToConvertTo> ; [, <lWantYesNo> ] ) -> xResult
Arguments:<xValueToConvert> is the value to convert. <cTypeToConvertTo> is the type of value to convert to ("C","D","L","N","A" or "B"). <lWantYesNo> is a logical to signal if 'Y' or 'N' is to be returned if Converting a logical, otherwise '.T.' or '.F.' will be returned for logicals.
Returns:The original value converted to the new type.
Description:This function converts a value of character, date, numeric, logical, array or code block type to any of the other type. While it is guaranteed to return a value of the correct type, that value may not be meaningful (i.e., converting from a code block returns an Empty() value of the desired type).
Examples:nNumericValue := ft_XToY( cInputValue, "N" ) IF ft_XToY( nInputValue, "L" )
Status:
Compliance:
Files:
See also:
Back to index


BinToDec

Lang:ht_conv.txt
Component:hbmisc
Doc. source:hbmisc\doc\en\ht_conv.txt
Template:
Category:Conversion Tools
Subcategory:
Oneliner:Converts a Binary Value to Decimal
Syntax:BinToDec( <cN> ) --> <cNr>
Arguments:<cN> NUMBER TO BE CONVERTED
Returns:<cNr> NUMBER CONVERTED
Description:This function converts a string <cN> from an binary value to a numeric decimal value.
Examples:
Status:
Compliance:
Files:Library is hbmisc
See also:OctalToDec(), HexaToDec()
Back to index


DecToBin

Lang:ht_conv.txt
Component:hbmisc
Doc. source:hbmisc\doc\en\ht_conv.txt
Template:
Category:Conversion Tools
Subcategory:
Oneliner:Converts a Decimal Value to Binary
Syntax:DecToBin( <cN> ) --> <cNr>
Arguments:<cN> NUMBER TO BE CONVERTED
Returns:<cNr> NUMBER CONVERTED
Description:This function converts a string <cN> from an decimal value to an binary value.
Examples:
Status:
Compliance:
Files:Library is hbmisc
See also:DecToHexa(), DecToOctal()
Back to index


DecToHexa

Lang:ht_conv.txt
Component:hbmisc
Doc. source:hbmisc\doc\en\ht_conv.txt
Template:
Category:Conversion Tools
Subcategory:
Oneliner:Converts a Decimal Value to Hexa
Syntax:DecToHexa( <cN> ) --> <cNr>
Arguments:<cN> NUMBER TO BE CONVERTED
Returns:<cNr> NUMBER CONVERTED
Description:This function converts a string <cN> from an decimal value to an hexadecimal value.
Examples:
Status:
Compliance:
Files:Library is hbmisc
See also:DecToBin(), DecToOctal()
Back to index


DecToOctal

Lang:ht_conv.txt
Component:hbmisc
Doc. source:hbmisc\doc\en\ht_conv.txt
Template:
Category:Conversion Tools
Subcategory:
Oneliner:Converts a Decimal Value to Octal
Syntax:DecToOctal( <cN> ) --> <cNr>
Arguments:<cN> NUMBER TO BE CONVERTED
Returns:<cNr> NUMBER CONVERTED
Description:This function converts a string <cN> from an decimal value to an octal value.
Examples:
Status:
Compliance:
Files:Library is hbmisc
See also:DecToHexa(), DecToBin()
Back to index


HexaToDec

Lang:ht_conv.txt
Component:hbmisc
Doc. source:hbmisc\doc\en\ht_conv.txt
Template:
Category:Conversion Tools
Subcategory:
Oneliner:Converts a Hexa Value to Decimal
Syntax:HexaToDec( <cN> ) --> <cNr>
Arguments:<cN> NUMBER TO BE CONVERTED
Returns:<cNr> NUMBER CONVERTED
Description:This function converts a string <cN> from an hexadecimal value to a numeric decimal value.
Examples:
Status:
Compliance:
Files:Library is hbmisc
See also:OctalToDec(), BinToDec()
Back to index


IsBin

Lang:ht_conv.txt
Component:hbmisc
Doc. source:hbmisc\doc\en\ht_conv.txt
Template:
Category:Conversion Tools
Subcategory:
Oneliner:Check if the value is a Binary Number
Syntax:IsBin( <cN> ) --> <cNr>
Arguments:<cN> STRING TO BE CHECKED
Returns:<cNr> .T. IF THE STRING IS BYNARY, otherwise .F.
Description:check if the passed string is a bynary number or not
Examples:
Status:
Compliance:
Files:Library is hbmisc
See also:IsOctal(), IsDec(), IsHexa()
Back to index


IsDec

Lang:ht_conv.txt
Component:hbmisc
Doc. source:hbmisc\doc\en\ht_conv.txt
Template:
Category:Conversion Tools
Subcategory:
Oneliner:Check if the value is a Decimal Number
Syntax:IsDec( <cN> ) --> <cNr>
Arguments:<cN> STRING TO BE CHECKED
Returns:<cNr> .T. IF THE STRING IS DECIMAL;otherwise .F.
Description:check if the passed string is a decimal number or not
Examples:
Status:
Compliance:
Files:Library is hbmisc
See also:IsOctal(), IsBin(), IsHexa()
Back to index


IsHexa

Lang:ht_conv.txt
Component:hbmisc
Doc. source:hbmisc\doc\en\ht_conv.txt
Template:
Category:Conversion Tools
Subcategory:
Oneliner:Check if the value is a Hexal Number
Syntax:IsHexa( <cN> ) --> <cNr>
Arguments:<cN> STRING TO BE CHECKED
Returns:<cNr> .T. IF THE STRING IS HEXA;otherwise .F.
Description:check if the passed string is a hexa number or not
Examples:
Status:
Compliance:
Files:Library is hbmisc
See also:IsOctal(), IsDec(), IsBin()
Back to index


IsOctal

Lang:ht_conv.txt
Component:hbmisc
Doc. source:hbmisc\doc\en\ht_conv.txt
Template:
Category:Conversion Tools
Subcategory:
Oneliner:Check if the value is a Octal Number
Syntax:IsOctal( <cN> ) --> <cNr>
Arguments:<cN> STRING TO BE CHECKED
Returns:<cNr> .T. IF THE STRING IS OCTAL;otherwise .F.
Description:check if the passed string is a octal number or not
Examples:
Status:
Compliance:
Files:Library is hbmisc
See also:IsBin(), IsDec(), IsHexa()
Back to index


OctalToDec

Lang:ht_conv.txt
Component:hbmisc
Doc. source:hbmisc\doc\en\ht_conv.txt
Template:
Category:Conversion Tools
Subcategory:
Oneliner:Converts a Octal Value to Decimal
Syntax:OctalToDec( <cN> ) --> <cNr>
Arguments:<cN> NUMBER TO BE CONVERTED
Returns:<cNr> NUMBER CONVERTED
Description:This function converts a string <cN> from an octal value to a numeric decimal value.
Examples:
Status:
Compliance:
Files:Library is hbmisc
See also:BinToDec(), HexaToDec()
Back to index


ScreenText

Lang:screen1.txt
Component:hbct
Doc. source:hbct\doc\en\screen1.txt
Template:
Category:CT video functions (Harbour ex
Subcategory:
Oneliner:
Syntax:ScreenText( <nTop>, <nLeft>, <nBottom>, <nRight> )
Arguments:<nTop> - top row number, default 0 <nLeft> - left column number, default 0 <nBottom> - top row number, default MaxRow() <nRight> - right column number, default MaxCol()
Returns:Returns string with characters taken from given screen region.
Description:Returns string with characters taken from given screen region. TODO: add documentation
Examples:
Status:Started
Compliance:
Files:Library is hbct.
See also:
Back to index


AddMonth

Lang:dattime2.txt
Component:hbct
Doc. source:hbct\doc\en\dattime2.txt
Template:
Category:CT3 date and time functions
Subcategory:
Oneliner:add months to a date
Syntax:AddMonth( [<dDate>,] <nMonths> ) -> dShiftedDate
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:AddMonth() is compatible with CT3's ADDMOTH().
Files:Library is hbct.
See also:
Back to index


BoM

Lang:datetime.txt
Component:hbct
Doc. source:hbct\doc\en\datetime.txt
Template:
Category:CT3 date and time functions
Su