Harbour Reference Guide

Based on Harbour 3.2.0dev (r1303231801)

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
  724. THtml
  725. TNortonGuide
  726. TOs2
  727. TRtf
  728. TTroff

    Category: Harbour Tools string functions

  729. JustRight

    Category: HBCT Date and Time Functions

  730. SetDate
  731. SetTime
  732. TimeValid
  733. WaitPeriod

    Category: HBCT video functions

  734. CharPix
  735. NToColor
  736. SetFont
  737. VGAPalette
  738. VideoType

    Category: Keyboard/Mouse

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

    Category: Math

  776. ft_GCD
  777. ft_NetPV
  778. ft_Rand1
  779. ft_Round

    Category: Menus/Prompts

  780. ft_Adder
  781. ft_Blink
  782. ft_BrwsWhl
  783. ft_ClrSel
  784. ft_DispMsg
  785. ft_Fill
  786. ft_Menu1
  787. ft_Menu2
  788. ft_MenuTo
  789. ft_Pending
  790. ft_PickDay
  791. ft_Prompt
  792. FT_SLEEP
  793. ft_XBox

    Category: NetWare

  794. ft_NWLStat
  795. ft_NWSemClose
  796. ft_NWSemEx
  797. ft_NWSemLock
  798. ft_NWSemOpen
  799. ft_NWSemSig
  800. ft_NWSemUnlock
  801. ft_NWSemWait
  802. ft_NWUID

    Category: Run time errors

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

    Category: String

  875. ft_At2
  876. ft_BitClr
  877. ft_BitSet
  878. ft_ByteAnd
  879. ft_ByteNeg
  880. ft_ByteNot
  881. ft_ByteOr
  882. ft_ByteXor
  883. ft_Color2N
  884. ft_FindITh
  885. ft_IsBit
  886. ft_IsBitOn
  887. ft_Metaph
  888. ft_N2Color
  889. ft_NoOccur
  890. ft_PChr
  891. ft_Proper
  892. ft_RAt2

    Category: String Tools

  893. gt_AsciiSum
  894. gt_AscPos
  895. gt_AtDiff
  896. gt_CharEven
  897. gt_CharMix
  898. gt_CharOdd
  899. gt_ChrCount
  900. gt_ChrFirst
  901. gt_ChrTotal
  902. gt_StrCount
  903. gt_StrCSPN
  904. gt_StrDiff
  905. gt_StrExpand
  906. gt_StrLeft
  907. gt_StrPBRK
  908. gt_StrRight
  909. StrFormat

    Category: TBrowse class

  910. TBrowseNew

    Category: Video

  911. ft_Adapter
  912. ft_CLS
  913. ft_GetMode
  914. ft_GetVCur
  915. ft_GetVPg
  916. ft_PopVid
  917. ft_PushVid
  918. ft_RestAtt
  919. ft_RevAttr
  920. ft_RevChr
  921. ft_RgnStack
  922. ft_RstRgn
  923. ft_SaveAtt
  924. ft_SavRgn
  925. ft_SetAttr
  926. ft_SetMode
  927. ft_SetVcur
  928. ft_SetVpg
  929. ft_Shadow
  930. ft_VidStr
  931. ft_WrtChr

    Category: Zip Functions

  932. hb_GetZipComment
  933. hb_SetBuffer
  934. hb_SetDiskZip
  935. hb_SetZipComment
  936. hb_UnzipFile
  937. hb_ZipDeleteFiles
  938. hb_ZipFile
  939. hb_ZipFileByPKSpan
  940. hb_ZipFileByTDSpan
  941. 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.h: 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 CToD('//'), 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 65,519 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 INDEX test IF ! NetErr() SEEK test->Name := "HARBOUR" IF Found() ? test->Name 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 65,535, inclusive. If an error occurs, the return value of this function will be -1. 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> fileio.ch Meaning 0 FC_NORMAL Normal/Default,Read/Write 1 FC_READONLY Read-only file attribute is set 2 FC_HIDDEN Hidden,Excluded from normal DIR search 4 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 fileio.ch Meaning 0 FO_READ Read only 1 FO_WRITE Write only 2 FO_READWRITE Read/write 16 FO_EXCLUSIVE Exclusive read only 32 FO_DENYWRITE Prevent others from writing 48 FO_DENYREAD Deny read only 64 FO_DENYNONE Not deny, Let to others Read / Write 64 FO_SHARED same as FO_DENYNONE </table> If there is an error in opening a file, a -1 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> fileio.ch File position 0 FS_SET Beginning of file 1 FS_RELATIVE Current file pointer position 2 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 := At( hb_eol(), SubStr( cLine, 1, nNumRead ) ) ) == 0 cB := cLine ELSE cB := SubStr( 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 (FS_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 Simplified zh_sim Chinese Traditional zh_tra 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 ) LOCAL cSmile DO CASE CASE nType == 1 cSmile := ":)" CASE nType == 2 cSmile := ";)" CASE nType == 3 cSmile := "*SMILE*" ENDCASE RETURN cSmile
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 Value Meaning HB_MSGLISTALL 0 All types HB_MSGLISTCLASS 1 CLASS VAR only HB_MSGLISTPURE 2 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 read from 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 read from 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 Value Meaning DE_ABORT 0 Abort dbEdit(). DE_CONT 1 Continue dbEdit() as is. DE_REFRESH 2 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 32,622, 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
Subcategory:
Oneliner:_B_egin _O_f _M_onth
Syntax:BoM( [<dDate>] ) -> dDateBeginOfMonth
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:BoM() is compatible with CT3's BoM().
Files:Library is hbct.
See also:EoM(),BoQ(),EoQ(),BoY(),EoY()
Back to index


BoQ

Lang:datetime.txt
Component:hbct
Doc. source:hbct\doc\en\datetime.txt
Template:
Category:CT3 date and time functions
Subcategory:
Oneliner:_B_egin _O_f _Q_uarter
Syntax:BoQ( [<dDate>] ) -> dDateBeginOfQuarter
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:BoQ() is compatible with CT3's BoQ().
Files:Library is hbct.
See also:BoM(),EoM(),EoQ(),BoY(),EoY()
Back to index


BoY

Lang:datetime.txt
Component:hbct
Doc. source:hbct\doc\en\datetime.txt
Template:
Category:CT3 date and time functions
Subcategory:
Oneliner:_B_egin _O_f _Y_ear
Syntax:BoY( [<dDate>] ) -> dDateBeginOfYear
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:BoY() is compatible with CT3's BoY().
Files:Library is hbct.
See also:BoM(),EoM(),BoQ(),EoQ(),EoY()
Back to index


CToDoW

Lang:dattime2.txt
Component:hbct
Doc. source:hbct\doc\en\dattime2.txt
Template:
Category:CT3 date and time functions
Subcategory:
Oneliner:convert name of day of the week to its ordinal number
Syntax:CToDoW( <cName> ) -> nOrdinal
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:CToDoW() is compatible with CT3's CToDoW().
Files:Library is hbct.
See also:NToCDoW()
Back to index


CToMonth

Lang:dattime2.txt
Component:hbct
Doc. source:hbct\doc\en\dattime2.txt
Template:
Category:CT3 date and time functions
Subcategory:
Oneliner:convert name of month to its ordinal number
Syntax:CToMonth( <cName> ) -> nOrdinal
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:CToMonth() is compatible with CT3's CToMonth().
Files:Library is hbct.
See also:NToCMonth()
Back to index


DaysInMonth

Lang:dattime2.txt
Component:hbct
Doc. source:hbct\doc\en\dattime2.txt
Template:
Category:CT3 date and time functions
Subcategory:
Oneliner:Returns the number of days in month
Syntax:DAYSINMONTH (<nMonth>, <lLeapYear>) -> nDaysInMonth
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:DaysInMonth() is a new function in Harbour's CT3 library.
Files:Library is hbct.
See also:DaysToMonth()
Back to index


DaysToMonth

Lang:dattime2.txt
Component:hbct
Doc. source:hbct\doc\en\dattime2.txt
Template:
Category:CT3 date and time functions
Subcategory:
Oneliner:Total number of days from first of Jan to beginning of nMonth.
Syntax:DaysToMonth( <nMonth>, <lLeapYear> ) -> nDaysToMonth
Arguments:
Returns:
Description:lLeap is FALSE for a non-leap year but TRUE if it is. If so and nMonth is greater than 2, ndays is incremented TODO: add further documentation
Examples:
Status:Started
Compliance:DaysToMonth() is a new function in Harbour's CT3 library.
Files:Library is hbct.
See also:DaysInMonth()
Back to index


DMY

Lang:dattime2.txt
Component:hbct
Doc. source:hbct\doc\en\dattime2.txt
Template:
Category:CT3 date and time functions
Subcategory:
Oneliner:Returns the date as a string in DD Month YY format
Syntax:DMY( [<dDate>][, <lMode>] ) -> cDateString
Arguments:
Returns:
Description:Returns the date as a string in DD Month YY format. If lmode is TRUE, a "." is inserted after the DD TODO: add further documentation
Examples:
Status:Started
Compliance:DMY() is compatible with CT3's DMY().
Files:Library is hbct.
See also:MDY()
Back to index


DoY

Lang:dattime2.txt
Component:hbct
Doc. source:hbct\doc\en\dattime2.txt
Template:
Category:CT3 date and time functions
Subcategory:
Oneliner:Determines the day of the year for a specific date
Syntax:DMY( [<dDate>] ) -> nDayOfYear
Arguments:
Returns:
Description:Determines the day of the year for a specific date if dDate is invalid, returns 0 TODO: add further documentation
Examples:
Status:Started
Compliance:DoY() is compatible with CT3's DoY().
Files:Library is hbct.
See also:
Back to index


EoM

Lang:datetime.txt
Component:hbct
Doc. source:hbct\doc\en\datetime.txt
Template:
Category:CT3 date and time functions
Subcategory:
Oneliner:_E_nd _O_f _M_onth
Syntax:EoM( [<dDate>] ) -> dDateEndOfMonth
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:EoM() is compatible with CT3's EoM().
Files:Library is hbct.
See also:BoM(),BoQ(),EoQ(),BoY(),EoY()
Back to index


EoQ

Lang:datetime.txt
Component:hbct
Doc. source:hbct\doc\en\datetime.txt
Template:
Category:CT3 date and time functions
Subcategory:
Oneliner:_E_nd _O_f _Q_uarter
Syntax:EoQ( [<dDate>] ) -> dDateEndOfQuarter
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:EoQ() is compatible with CT3's EoQ().
Files:Library is hbct.
See also:BoM(),EoM(),BoQ(),BoY(),EoY()
Back to index


EoY

Lang:datetime.txt
Component:hbct
Doc. source:hbct\doc\en\datetime.txt
Template:
Category:CT3 date and time functions
Subcategory:
Oneliner:_E_nd _O_f _Y_ear
Syntax:EoY( [<dDate>] ) -> dDateEndOfYear
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:EoY() is compatible with CT3's EoY().
Files:Library is hbct.
See also:BoM(),EoM(),BoQ(),EoQ(),BoY()
Back to index


IsLeap

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


LastDayOM

Lang:dattime2.txt
Component:hbct
Doc. source:hbct\doc\en\dattime2.txt
Template:
Category:CT3 date and time functions
Subcategory:
Oneliner:Returns the the number of days in the month.
Syntax:LastDayOM( [<dDate|nMonth>] ) -> nDaysInMonth
Arguments:
Returns:
Description:<dDate|nMonth> can be a date or a month number. If empty uses the system date. If nMonth is a 2, LastDayOM() will not know if it is a leap year or not. If dDate is invalid, returns 0 TODO: add further documentation
Examples:
Status:Started
Compliance:LastDayOM() is compatible with CT3's LastDayOM().
Files:Library is hbct.
See also:EoM()
Back to index


MDY

Lang:dattime2.txt
Component:hbct
Doc. source:hbct\doc\en\dattime2.txt
Template:
Category:CT3 date and time functions
Subcategory:
Oneliner:Returns the date as a string in Month DD, YY or Month DD, YYYY
Syntax:MDY( [<dDate>] ) -> cDateString
Arguments:
Returns:
Description:Returns the date as a string in Month DD, YY or Month DD, YYYY If dDate is NULL, the system date is used TODO: add further documentation
Examples:
Status:Started
Compliance:MDY() is compatible with CT3's MDY().
Files:Library is hbct.
See also:DMY()
Back to index


NToCDoW

Lang:dattime2.txt
Component:hbct
Doc. source:hbct\doc\en\dattime2.txt
Template:
Category:CT3 date and time functions
Subcategory:
Oneliner:(num of day) -> day name
Syntax:NToCDoW( <nDay> ) -> cDay
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:NToCDoW() is compatible with CT3's NToCDoW().
Files:Library is hbct.
See also:CToDoW()
Back to index


NToCMonth

Lang:dattime2.txt
Component:hbct
Doc. source:hbct\doc\en\dattime2.txt
Template:
Category:CT3 date and time functions
Subcategory:
Oneliner:(num of month ) -> Month Name
Syntax:NToCMonth( <nMonth> ) -> cMonth
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:NToCMonth() is compatible with CT3's NToCMonth().
Files:Library is hbct.
See also:CToMonth()
Back to index


Quarter

Lang:dattime2.txt
Component:hbct
Doc. source:hbct\doc\en\dattime2.txt
Template:
Category:CT3 date and time functions
Subcategory:
Oneliner:Returns a number equal to the quarter in which a date falls
Syntax:Quarter( [<dDate>] ) -> nQuarter
Arguments:
Returns:
Description:Returns a number equal to the quarter in which ddate falls. If ddate is empty, the system date is employed. TODO: add further documentation
Examples:
Status:Started
Compliance:Quarter() is compatible with CT3's Quarter().
Files:Library is hbct.
See also:
Back to index


Week

Lang:dattime2.txt
Component:hbct
Doc. source:hbct\doc\en\dattime2.txt
Template:
Category:CT3 date and time functions
Subcategory:
Oneliner:Returns the calendar week a number
Syntax:Week( [<dDate>][, <lSWN>] ) -> nWeek
Arguments:
Returns:
Description:Returns the calendar week a number. If no date is specified, the system date is used. An empty date via hb_SToD("") returns 0. If <lSWN> is .T., Week() will calculate the "simple week number", defined by - week #1 starts on January, 1st - week #(n+1) starts seven days after start of week #n If <lSWN> is .F. (default), the ISO8601 week number, defined by - weeks start on mondays - week #1 is the one that includes January, 4 will be calculated TODO: add further documentation
Examples:
Status:Started
Compliance:Week() is compatible with CT3's Week().
Files:Library is hbct.
See also:
Back to index


CSetArgErr

Lang:ctc.txt
Component:hbct
Doc. source:hbct\doc\en\ctc.txt
Template:
Category:CT3 general functions
Subcategory:
Oneliner:Sets argument error behaviour
Syntax:CSetArgErr( [<nNewMode>] ) -> <nOldMode>
Arguments:[<nNewMode>] New argument error throwing mode
Returns:<nOldMode> The current or old argument error throwing mode.
Description:All CT3 functions are very compliant in their reaction to wrong parameters. By using the CSetArgErr() function, you can make the library throw an error with the severity <nNewMode>. It is then up to the error handler to substitute the return value. <nNewMode> can be one of the severity modes defined in ct.ch: CT_ARGERR_WHOCARES corresponds to ES_WHOCARES CT_ARGERR_WARNING corresponds to ES_WARNING CT_ARGERR_ERROR corresponds to ES_ERROR CT_ARGERR_CATASTROPHIC corresponds to ES_CATASTROPHIC CT_ARGERR_IGNORE The last is the default behaviour and switches any argument error throwing off.
Examples:
Status:Ready
Compliance:CSetArgErr() is a new function in Harbour's CT3 library.
Files:Library is hbct.
See also:
Back to index


ctcexit

Lang:ctc.txt
Component:hbct
Doc. source:hbct\doc\en\ctc.txt
Template:
Category:CT3 general functions
Subcategory:
Oneliner:Uninitializes the CT3 library, C part
Syntax:ctcexit() -> NIL
Arguments:none
Returns:nil
Description:The ctcexit() function uninitializes the C part of the CT3 library. Do not call this function directly.
Examples:
Status:Ready
Compliance:ctcexit() is a new function in Harbour's CT3 library.
Files:Library is hbct.
See also:ctinit(),ctexit()
Back to index


ctcinit

Lang:ctc.txt
Component:hbct
Doc. source:hbct\doc\en\ctc.txt
Template:
Category:CT3 general functions
Subcategory:
Oneliner:Initializes the CT3 library, C part
Syntax:ctcinit() -> lInitialized
Arguments:None
Returns:lInitialized .T. if the function has been correctly initialized
Description:The ctcinit() function initializes the C source part of the CT3 library. Do not call this function directly.
Examples:
Status:Ready
Compliance:ctcinit() is a new function in Harbour's CT3 library.
Files:Library is hbct.
See also:ctinit(),ctexit()
Back to index


ctexit

Lang:ct.txt
Component:hbct
Doc. source:hbct\doc\en\ct.txt
Template:
Category:CT3 general functions
Subcategory:
Oneliner:Uninitializes the CT3 library
Syntax:ctexit() -> nil
Arguments:none
Returns:nil
Description:The ctexit() function uninitializes the CT3 library. Identical code is declared as EXIT FUNCTION, thus should be executed automatically at the end of the application, but it is a good idea to call it explicitly somewhere at the end of your program to make sure that the deinitialization takes place.
Examples:
Status:Ready
Compliance:ctexit() is a new function in Harbour's CT3 library.
Files:Library is hbct.
See also:
Back to index


ctinit

Lang:ct.txt
Component:hbct
Doc. source:hbct\doc\en\ct.txt
Template:
Category:CT3 general functions
Subcategory:
Oneliner:Initializes the CT3 library
Syntax:ctinit() -> lInitialized
Arguments:None
Returns:lInitialized .T. if the function has been correctly initialized
Description:The ctinit() function initializes the CT3 library. Identical code is declared as INIT FUNCTION, thus should be executed automatically at the beginning of the application, but it is a good idea to call it once again explicitly somewhere at the beginning of your program to check the initialization.
Examples:
Status:Ready
Compliance:ctinit() is a new function in Harbour's CT3 library.
Files:Library is hbct.
See also:
Back to index


Acos

Lang:trig.txt
Component:hbct
Doc. source:hbct\doc\en\trig.txt
Template:
Category:CT3 math functions
Subcategory:
Oneliner:Arcus cosine of the argument
Syntax:Acos( nCosine ) -> nRadiant
Arguments:<nCosine> the cosine of an angle
Returns:<nRadiant> the angle whose cosine is <nCosine>
Description:The function Acos() is the inverse function of Cos(). It takes a cosine value and returns the smallest(!) angle whose cosine equals to the argument. The return value is given in radiants (full angle equals 2*Pi - see DToR() if you need to convert it into degress). Note, that <nCosine> must be between -1 and 1 and that <nRadiant> is always between 0 and Pi().
Examples:? Acos( 0.0 ) // --> Pi() / 2 ? Acos( 0.5 ) // --> 1.04719...
Status:Ready
Compliance:Acos() is compatible with CT3's Acos().
Files:Library is hbct.
See also:Sin(),Cos(),Tan(),Cot(),Asin(),Atan(),Atn2(),Sinh(),Cosh(),Tanh(),RToD(),DToR(),Pi()
Back to index


Asin

Lang:trig.txt
Component:hbct
Doc. source:hbct\doc\en\trig.txt
Template:
Category:CT3 math functions
Subcategory:
Oneliner:Arcus sine of the argument
Syntax:Asin( nSine ) -> nRadiant
Arguments:<nSine> the sine of an angle
Returns:<nRadiant> the angle whose sine is <nSine>
Description:The function Asin() is the inverse function of Sin(). It takes a sine value and returns the smallest(!) angle whose sine equals to the argument. The return value is given in radiants (full angle equals 2*Pi - see DToR() if you need to convert it into degress). Note, that <nSine> must be between -1 and 1 and that <nRadiant> is always between -Pi()/2 and Pi()/2.
Examples:? Asin( 0.0 ) // --> 0.0 ? Asin( 0.5 ) // --> 0.5235...
Status:Ready
Compliance:Asin() is compatible with CT3's Asin().
Files:Library is hbct.
See also:Sin(),Cos(),Tan(),Cot(),Acos(),Atan(),Atn2(),Sinh(),Cosh(),Tanh(),RToD(),DToR(),Pi()
Back to index


Atan

Lang:trig.txt
Component:hbct
Doc. source:hbct\doc\en\trig.txt
Template:
Category:CT3 math functions
Subcategory:
Oneliner:Arcus tangent of the argument
Syntax:Acos( nTangent ) -> nRadiant
Arguments:<nTangent> the tangent of an angle
Returns:<nRadiant> the angle whose tangent is <nTangent>
Description:The function Atan() is the inverse function of Tan(). It takes a tangent value and returns the smallest(!) angle whose tangent equals to the argument. The return value is given in radiants between -Pi()/2 and Pi()/2 (full angle equals 2*Pi - see DToR() if you need to convert it into degress).
Examples:? Atan( 0.0 ) // --> 0.0 ? Atan( 0.5 ) // --> 0.4636...
Status:Ready
Compliance:Atan() is compatible with CT3's Atan().
Files:Library is hbct.
See also:Sin(),Cos(),Tan(),Cot(),Asin(),Acos(),Atan(),Sinh(),Cosh(),Tanh(),RToD(),DToR(),Pi()
Back to index


Atn2

Lang:trig.txt
Component:hbct
Doc. source:hbct\doc\en\trig.txt
Template:
Category:CT3 math functions
Subcategory:
Oneliner:Arcus tangent a sine and a cosine argument
Syntax:Atn2( nSine, nCosine ) -> nRadiant
Arguments:<nSine> the sine of an angle <nCosine> the cosine of an angle
Returns:<nRadiant> the angle whose tangent is <nSine>/<nCosine>
Description:The function Atn2() is an alternate function for calculating the arcus tangent, Atn2(x,y) = Atan(x/y). It takes two arguments, the sine and the cosine of the angle that should be calculated. Thus, in contrast to the Atan() function, Atn2() can distinguish whether the sine or the cosine has a negative sign (or both being positive or negative), so that the return value can be between -Pi() and Pi() and covers the full angle. The return value is given in radiants (full angle equals 2*Pi - see DToR() if you need to convert it into degress).
Examples:? Atn2( 0.0, 1.0 ) // --> 0.0 ? Atn2( Sqrt( 1 / 2 ), Sqrt( 1 / 2 ) ) // --> Pi() / 4
Status:Ready
Compliance:Atn2() is compatible with CT3's Atn2().
Files:Library is hbct.
See also:Sin(),Cos(),Tan(),Cot(),Asin(),Acos(),Atan(),Sinh(),Cosh(),Tanh(),RToD(),DToR(),Pi()
Back to index


Ceiling

Lang:ctmath2.txt
Component:hbct
Doc. source:hbct\doc\en\ctmath2.txt
Template:
Category:CT3 math functions
Subcategory:
Oneliner:Rounds up a number to the next integer
Syntax:Ceiling( <nNumber> ) -> nUpRoundedNumber
Arguments:<nNumber> number to round up
Returns:<nUpRoundedNumber> the rounded number
Description:The function Ceiling() determines the smallest integer that is bigger than <nNumber>.
Examples:? Ceiling( 1.1 ) // --> 2.0 ? Ceiling( -1.1 ) // --> -1.0
Status:Ready
Compliance:Ceiling() is compatible with CT3's Ceiling().
Files:Library is hbct.
See also:Floor()
Back to index


Cos

Lang:trig.txt
Component:hbct
Doc. source:hbct\doc\en\trig.txt
Template:
Category:CT3 math functions
Subcategory:
Oneliner:Cosine of the argument
Syntax:Cos( nRadiant ) -> nCosine
Arguments:<nRadiant> an angle size given in radiants
Returns:<nCosine> the cosine of <nRadiant>
Description:The function Cos() calculates the cosine of an angle whose size is given in radiants (full angle equals 2*Pi - see DToR() for angle size given in degress). A common geometric interpretation of the Cos() function is the ankathede-hypotenuse-ratio of a right-angled triangle.
Examples:? Cos( 0.0 ) // --> 1.0 ? Cos( 1.0 ) // --> 0.5403...
Status:Ready
Compliance:Cos() is compatible with CT3's Cos().
Files:Library is hbct.
See also:Sin(),Tan(),Cot(),Asin(),Acos(),Atan(),Atn2(),Sinh(),Cosh(),Tanh(),RToD(),DToR(),Pi()
Back to index


Cosh

Lang:trig.txt
Component:hbct
Doc. source:hbct\doc\en\trig.txt
Template:
Category:CT3 math functions
Subcategory:
Oneliner:Hyperbolic Cosine of the argument
Syntax:Cosh( nArea ) -> nHyperbolicCosine
Arguments:<nArea> the size of the area (see below)
Returns:<nHyperbolicCosine> the hyperbolic cosine of <nArea>
Description:The function Cosh() calculates the hyperbolic cosine of the argument. In analytical mathematics it is defined as 1/2*(Exp(nArea)+Exp(-nArea)). A common geometric interpretation of the Cosh() function is the maximum x value of the points in the area with the given size <nArea>, that is bound by the x axis, a straight line through the point of origin (this one is fixed by the area) and the hyperbola x^2-y^2=1.
Examples:? Cosh( 0.0 ) // --> 1.0 ? Cosh( 1.0 ) // --> 1.5430...
Status:Ready
Compliance:Cosh() is new in Harbours CT3's library.
Files:Library is hbct.
See also:Sin(),Cos(),Tan(),Cot(),Asin(),Acos(),Atan(),Atn2(),Sinh(),Tanh(),RToD(),DToR(),Pi()
Back to index


Cot

Lang:trig.txt
Component:hbct
Doc. source:hbct\doc\en\trig.txt
Template:
Category:CT3 math functions
Subcategory:
Oneliner:Cotangent of the argument
Syntax:Cot( nRadiant ) -> nCotangent
Arguments:<nRadiant> an angle size given in radiants
Returns:<nCotangent> the cotangent of <nRadiant>
Description:The function Cot() calculates the cotangent of an angle whose size is given in radiants (full angle equals 2*Pi - see DToR() for angle size given in degress). A common geometric interpretation of the Cot() function is the ankathede-counterkathede-ratio of a right-angled triangle, or, Cot(x) = Cos(x)/Sin(x)=1/Tan(x).
Examples:? Cot( 1.0 ) // --> 0.6420...
Status:Ready
Compliance:Cot() is compatible with CT3's Cot().
Files:Library is hbct.
See also:Sin(),Cos(),Tan(),Asin(),Acos(),Atan(),Atn2(),Sinh(),Cosh(),Tanh(),RToD(),DToR(),Pi()
Back to index


DToR

Lang:trig.txt
Component:hbct
Doc. source:hbct\doc\en\trig.txt
Template:
Category:CT3 math functions
Subcategory:
Oneliner:Convert degree to radiant
Syntax:DToR( nDegree ) -> nRadiant
Arguments:<nDegree> the size of that angle in degree
Returns:<nRadiant> the size of an angle in radiant
Description:The function DToR() can be used to convert sizes of angles given in degrees to radiant (as expected by sin, cos or tan functions).
Examples:? DToR( 180 ) // --> Pi() ? DToR( 60 ) // --> Pi() / 3
Status:Ready
Compliance:DToR() is compatible with CT3's DToR().
Files:Library is hbct.
See also:Sin(),Cos(),Tan(),Cot(),Asin(),Acos(),Atan(),Atn2(),Sinh(),Cosh(),Tanh(),RToD(),Pi()
Back to index


Fact

Lang:ctmath2.txt
Component:hbct
Doc. source:hbct\doc\en\ctmath2.txt
Template:
Category:CT3 math functions
Subcategory:
Oneliner:Calculates faculty
Syntax:Fact( <nNumber> ) -> nFaculty
Arguments:<nNumber> number between 0 and 21
Returns:<nFaculty> the faculty of <nNumber>
Description:The function Fact() calculates the faculty to the integer given in <nNumber>. The faculty is defined as n! = 1*2*...*n and is often used in statistics. Note, that faculties above 21 are too big so that the function must return a -1.
Examples:? Fact( 0 ) // --> 1 ? Fact( 1 ) // --> 1 ? Fact( 4 ) // --> 24
Status:Ready
Compliance:Fact() is compatible with CT3's Fact().
Files:Library is hbct.
See also:
Back to index


Floor

Lang:ctmath2.txt
Component:hbct
Doc. source:hbct\doc\en\ctmath2.txt
Template:
Category:CT3 math functions
Subcategory:
Oneliner:Rounds down a number to the next integer
Syntax:Floor( <nNumber> ) -> nDownRoundedNumber
Arguments:<nNumber> number to round down
Returns:<nDownRoundedNumber> the rounded number
Description:The function Floor() determines the biggest integer that is smaller than <nNumber>.
Examples:? Floor( 1.1 ) // --> 1.0 ? Floor( -1.1 ) // --> -2.0
Status:Ready
Compliance:Floor() is compatible with CT3's Floor().
Files:Library is hbct.
See also:Ceiling()
Back to index


FV

Lang:finan.txt
Component:hbct
Doc. source:hbct\doc\en\finan.txt
Template:
Category:CT3 math functions
Subcategory:
Oneliner:Future value of a capital
Syntax:FV( nDeposit, nInterest, nPeriods ) --> nFutureValue
Arguments:<nDeposit> amount of money invested per period <nInterest> rate of interest per period, 1 == 100% <nPeriods> period count
Returns:<nFutureValue> Total value of the capital after <nPeriods> of paying <nDeposit> and <nInterest> interest being paid every period and added to the capital (resulting in compound interest)
Description:FV() calculates the value of a capital after <nPeriods> periods. Starting with a value of 0, every period, <nDeposit> (Dollars, Euros, Yens, ...) and an interest of <nInterest> for the current capital are added for the capital (<nInterest>=Percent/100). Thus, one gets the non-linear effects of compound interests: value in period 0 = 0 value in period 1 = ((value in period 0)*(1+<nInterest>/100)) + <nDeposit> value in period 2 = ((value in period 1)*(1+<nInterest>/100)) + <nDeposit> etc.... value in period <nPeriod> = ((value in period <nPeriod>-1)*(1+<nInterest>/100))< + <nDeposit> = <nDeposit> * sum from i=0 to <nPeriod>-1 over (1+<nInterest>/100)^i = <nDeposit> * ((1+<nInterest>/100)^n-1) / (<nInterest>/100)
Examples:// Payment of 1000 per year for 10 years at a interest rate // of 5 per cent per year ? FV( 1000, 0.05, 10 ) // --> 12577.893
Status:Ready
Compliance:FV() is compatible with CT3's FV().
Files:Library is hbct.
See also:PV(),Payment(),Periods(),Rate()
Back to index


GetPrec

Lang:ctmath.txt
Component:hbct
Doc. source:hbct\doc\en\ctmath.txt
Template:
Category:CT3 math functions
Subcategory:
Oneliner:Get precision of math functions
Syntax:GetPrec() -> nDigits
Arguments:
Returns:nDigits digit count between 1 and 16
Description:Be aware that calls to this functions do _NOT_ affect the calculation precision of the math functions at the moment.
Examples:
Status:Ready
Compliance:GetPrec() is compatible with CT3's GETPREC.
Files:Library is hbct.
See also:
Back to index


Log10

Lang:ctmath2.txt
Component:hbct
Doc. source:hbct\doc\en\ctmath2.txt
Template:
Category:CT3 math functions
Subcategory:
Oneliner:Decadic logarithm of a number
Syntax:Log10( <nNumber> ) -> nLogarithm
Arguments:<nNumber> number to logarithm
Returns:<nLogarithm> decadic logarithm of <nNumber>
Description:The function Log10() calculates the decadic logarithm of <nNumber>, i.e. 10^<nLogarithm> == <nNumber>.
Examples:? Log10( 10.0 ) // --> 1.0 ? Log10( Sqrt( 10.0 ) ) // --> 0.5
Status:Ready
Compliance:Log10() is compatible with CT3's Log10().
Files:Library is hbct.
See also:
Back to index


Payment

Lang:finan.txt
Component:hbct
Doc. source:hbct\doc\en\finan.txt
Template:
Category:CT3 math functions
Subcategory:
Oneliner:Payments for a loan
Syntax:Payment( nLoan, nInterest, nPeriods ) --> nPayment
Arguments:<nLoan> amount of money you get from the bank <nInterest> rate of interest per period, 1 == 100% <nPeriods> period count
Returns:<nPayment> Periodical payment one has to make to pay the loan <nLoan> back
Description:Payment() calculates the payment one has to make periodically to pay back a loan <nLoan> within <nPeriods> periods and for a rate of interest <nInterest> per period. debt in period 0 = <nLoan> debt in period 1 = ((debt in period 0)-<nPayment>)*(1+<nInterest>/100) debt in period 2 = ((debt in period 1)-<nPayment>)*(1+<nInterest>/100) etc... debt in period <nPeriod> = ((debt in period <nPeriod>-1)-<nPayment>)*(1+<nInterest>/100) -> has to be 0, so <nPayment> = <nLoan>*(<nInterest>/100)/(1-(1+<nInterest>/100)^(-n))
Examples:// You get a loan of 5172.56 at a interest rate of 0.5% per // month (6% per year). // For 5 years, you have to pay back every month ? Payment( 5172.56, 0.005, 60 ) // --> 100.00
Status:Ready
Compliance:Payment() is compatible with CT3's Payment().
Files:Library is hbct.
See also:PV(),FV(),Periods(),Rate()
Back to index


Periods

Lang:finan.txt
Component:hbct
Doc. source:hbct\doc\en\finan.txt
Template:
Category:CT3 math functions
Subcategory:
Oneliner:Number of periods for a loan
Syntax:Periods( nLoan, nPayment, nInterest ) --> nPeriods
Arguments:<nLoan> amount of money you get from the bank <nPayment> amount of money you pay back per period <nInterest> rate of interest per period, 1 == 100%
Returns:<nPeriods> number of periods you need to pay the loan back
Description:Periods() calculates the number of periods one needs to pay back a loan of <nLoan> with periodical payments of <nPayment> and for a rate of interest <nInterest> per period. debt in period 0 = <nLoan> debt in period 1 = ((debt in period 0)-<nPayment>)*(1+<nInterest>/100) debt in period 2 = ((debt in period 1)-<nPayment>)*(1+<nInterest>/100) etc... debt in period <nPeriod> = ((debt in period <nPeriod>-1)-<nPayment>)*(1+<nInterest>/100) -> has to be 0, so <nPeriods> = -Log(1-<nLoan>*(<nInterest>/100)/<nPayment>)/Log(1+<nInterest>/100)) Note, however that in the case of nPayment <= <nLoan>*(<nInterest>/100), one would need infinite time to pay the loan back. The functions does then return -1.
Examples:// You get a loan of 5172.56 at a interest rate of 0.5% per // month (6% per year). // You can afford to pay 100 back every month, so you need ? Periods( 5172.56, 100, 0.005 ) // --> 60.0 // months to cancel the loan.
Status:Ready
Compliance:Periods() is compatible with CT3's Periods().
Files:Library is hbct.
See also:PV(),FV(),Payment(),Rate()
Back to index


Pi

Lang:trig.txt
Component:hbct
Doc. source:hbct\doc\en\trig.txt
Template:
Category:CT3 math functions
Subcategory:
Oneliner:Returns Pi, the perimeter-to-diameter-ratio of a circle
Syntax:Pi() -> nPi
Arguments:
Returns:<nPi> the math constant Pi with maximum precision available
Description:The function Pi() can be used if the constant Pi is needed with maximum precision. One of the most known interpretations of this number is the constant perimeter-to-diameter-ratio of circles.
Examples:// the diameter of a circle-like swimming pool is 3.4 meters, how // long is the perimeter ? ? Str( Pi() * 3.4, 5, 3 ) + " meters" // --> 10.681 meters
Status:Ready
Compliance:Pi() is compatible with CT3's Pi().
Files:Library is hbct.
See also:Sin(),Cos(),Tan(),Cot(),Asin(),Acos(),Atan(),Atn2(),Sinh(),Cosh(),Tanh(),RToD(),DToR()
Back to index


PV

Lang:finan.txt
Component:hbct
Doc. source:hbct\doc\en\finan.txt
Template:
Category:CT3 math functions
Subcategory:
Oneliner:Present value of a loan
Syntax:PV( nPayment, nInterest, nPeriods ) --> nPresentValue
Arguments:<nPayment> amount of money paid back per period <nInterest> rate of interest per period, 1 == 100% <nPeriods> period count
Returns:<nPresentValue> Present value of a loan when one is paying back <nDeposit> per period at a rate of interest of <nInterest> per period
Description:PV() calculates the present value of a loan that is paid back in <nPeriods> payments of <nPayment> (Dollars, Euros, Yens,...) while the rate of interest is <nInterest> per period: debt in period 0 = <nPresentValue> debt in period 1 = ((debt in period 0)-<nPayment>)*(1+<nInterest>/100) debt in period 2 = ((debt in period 1)-<nPayment>)*(1+<nInterest>/100) etc... debt in period <nPeriod> = ((debt in period <nPeriod>-1)-<nPayment>)*(1+<nInterest>/100) -> has to be 0, so <nPresentValue> = <nPayment>*(1-(1+<nInterest>/100)^(-n))/(<nInterest>/100)
Examples:// You can afford to pay back 100 Dollars per month for 5 years // at a interest rate of 0.5% per month (6% per year), so instead // of 6000 Dollars (the amount you will pay back) the bank will pay // you ? PV( 100, 0.005, 60 ) // --> 5172.56
Status:Ready
Compliance:PV() is compatible with CT3's PV().
Files:Library is hbct.
See also:FV(),Payment(),Periods(),Rate()
Back to index


Rate

Lang:finan.txt
Component:hbct
Doc. source:hbct\doc\en\finan.txt
Template:
Category:CT3 math functions
Subcategory:
Oneliner:Estimate rate of interest for a loan
Syntax:Rate( nLoan, nPayment, nPeriods ) --> nRate
Arguments:<nLoan> amount of money you get from the bank <nPayment> amount of money you pay back per period <nPeriods> number of periods you pay the loan back
Returns:<nInterest> estimated rate of interest per period, 1 == 100%
Description:Rate() calculates the rate of interest per period for the given loan, payment per periods and number of periods. This is done with the same equation used in the Payment() or Periods() function: <nPayment> = <nLoan>*(<nInterest>/100)/(1-(1+<nInterest>/100)^(-<nPeriods>)) However, this equation can not be solved for <nInterest> in a "closed" manner, i.e. <nInterest> = ..., so that the result can only be estimated.
Examples:// You get a loan of 5172.56, pay 100 back every month for // 5 years (60 months). The effective interest rate per // period (=month) is ? Rate( 5172.56, 100, 60 ) // --> 0.005
Status:Ready
Compliance:Rate() is compatible with CT3's Rate().
Files:Library is hbct.
See also:PV(),FV(),Payment(),Periods()
Back to index


RToD

Lang:trig.txt
Component:hbct
Doc. source:hbct\doc\en\trig.txt
Template:
Category:CT3 math functions
Subcategory:
Oneliner:Convert radiant to degree
Syntax:RToD( nRadiant ) -> nDegree
Arguments:<nRadiant> the size of an angle in radiant
Returns:<nDegree> the size of that angle in degree
Description:The function RToD() can be used to convert sizes of angles given in radiant (like those returned by the asin, acos or atan function) to degrees that are commonly used geometry and technics.
Examples:? RToD( Pi() ) // --> 180 ? Tanh( Pi() / 3 ) // --> 60
Status:Ready
Compliance:RToD() is compatible with CT3's RToD().
Files:Library is hbct.
See also:Sin(),Cos(),Tan(),Cot(),Asin(),Acos(),Atan(),Atn2(),Sinh(),Cosh(),Tanh(),DToR(),Pi()
Back to index


SetPREC

Lang:ctmath.txt
Component:hbct
Doc. source:hbct\doc\en\ctmath.txt
Template:
Category:CT3 math functions
Subcategory:
Oneliner:Set precision of math functions
Syntax:SetPREC( <nPrecision> ) -> cEmptyString
Arguments:<nPrecision> digit count between 1 and 16, defaults to 16
Returns:cEmptyString this function always returns an empty string
Description:Be aware that calls to this functions do _NOT_ affect the calculation precision of the math functions at the moment.
Examples:
Status:Ready
Compliance:SetPREC() is compatible with CT3's SETPREC.
Files:Library is hbct.
See also:
Back to index


Sign

Lang:ctmath2.txt
Component:hbct
Doc. source:hbct\doc\en\ctmath2.txt
Template:
Category:CT3 math functions
Subcategory:
Oneliner:Sign of a number
Syntax:Sign( <nNumber> ) -> nSign
Arguments:<nNumber> a number
Returns:<nSign> sign of <nNumber>
Description:The function Sign() determines the sign of <nNumber>. If <nNumber> is > 0, then Sign(<nNumber>) returns 1 If <nNumber> is < 0, then Sign(<nNumber>) returns -1 If <nNumber> is == 0, then Sign(<nNumber>) returns 0
Examples:? Sign( 1.1 ) // --> 1 ? Sign( -1.1 ) // --> -1 ? Sign( 0.0 ) // --> 0
Status:Ready
Compliance:Sign() is compatible with CT3's Sign().
Files:Library is hbct.
See also:
Back to index


Sin

Lang:trig.txt
Component:hbct
Doc. source:hbct\doc\en\trig.txt
Template:
Category:CT3 math functions
Subcategory:
Oneliner:Sine of the argument
Syntax:SIN (nRadiant) -> nSine
Arguments:<nRadiant> an angle size given in radiants
Returns:<nSine> the sine of <nRadiant>
Description:The function Sin() calculates the sine of an angle whose size is given in radiants (full angle equals 2*Pi - see DToR() for angle size given in degress). A common geometric interpretation of the Sin() function is the counterkathede-hypotenuse-ratio of a right-angled triangle.
Examples:? Sin( 0.0 ) // --> 0.0 ? Sin( 1.0 ) // --> 0.8414...
Status:Ready
Compliance:Sin() is compatible with CT3's Sin().
Files:Library is hbct.
See also:Cos(),Tan(),Cot(),Asin(),Acos(),Atan(),Atn2(),Sinh(),Cosh(),Tanh(),RToD(),DToR(),Pi()
Back to index


Sinh

Lang:trig.txt
Component:hbct
Doc. source:hbct\doc\en\trig.txt
Template:
Category:CT3 math functions
Subcategory:
Oneliner:Hyperbolic Sine of the argument
Syntax:Sinh( nArea ) -> nHyperbolicSine
Arguments:<nArea> the size of the area (see below)
Returns:<nHyperbolicSine> the hyperbolic sine of <nArea>
Description:The function Sinh() calculates the hyperbolic sine of the argument. In analytical mathematics it is defined as 1/2*(Exp(nArea)-Exp(-nArea)). A common geometric interpretation of the Sinh() function is the maximum y value of the points in the area with the given size <nArea>, that is bound by the x axis, a straight line through the point of origin (this one is fixed by the area) and the hyperbola x^2-y^2=1.
Examples:? Sinh( 0.0 ) // --> 0.0 ? Sinh( 1.0 ) // --> 1.1752...
Status:Ready
Compliance:Sinh() is new in Harbours CT3's library.
Files:Library is hbct.
See also:Sin(),Cos(),Tan(),Cot(),Asin(),Acos(),Atan(),Atn2(),Cosh(),Tanh(),RToD(),DToR(),Pi()
Back to index


Tan

Lang:trig.txt
Component:hbct
Doc. source:hbct\doc\en\trig.txt
Template:
Category:CT3 math functions
Subcategory:
Oneliner:Tangent of the argument
Syntax:Tan( nRadiant ) -> nTangent
Arguments:<nRadiant> an angle size given in radiants
Returns:<nTangent> the tangent of <nRadiant>
Description:The function Tan() calculates the tangent of an angle whose size is given in radiants (full angle equals 2*Pi - see DToR() for angle size given in degress). A common geometric interpretation of the Tan() function is the counterkathede-ankathede-ratio of a right-angled triangle, or, Tan(x) = Sin(x)/Cos(x).
Examples:? Tan( 0.0 ) // --> 0.0 ? Tan( 1.0 ) // --> 1.5574...
Status:Ready
Compliance:Tan() is compatible with CT3's Tan().
Files:Library is hbct.
See also:Sin(),Cos(),Cot(),Asin(),Acos(),Atan(),Atn2(),Sinh(),Cosh(),Tanh(),RToD(),DToR(),Pi()
Back to index


Tanh

Lang:trig.txt
Component:hbct
Doc. source:hbct\doc\en\trig.txt
Template:
Category:CT3 math functions
Subcategory:
Oneliner:Hyperbolic Tangent of the argument
Syntax:Tanh( nArea ) -> nHyperbolicTangent
Arguments:<nArea> the size of the area (see below)
Returns:<nHyperbolicTangent> the hyperbolic tangent of <nArea>
Description:The function Tanh() calculates the hyperbolic tangent of the argument. In analytical mathematics it is defined as Sinh(x)/Cosh(x).
Examples:? Tanh( 0.0 ) // --> 0.0 ? Tanh( 1.0 ) // --> 0.7615...
Status:Ready
Compliance:Tanh() is new in Harbours CT3's library.
Files:Library is hbct.
See also:Sin(),Cos(),Tan(),Cot(),Asin(),Acos(),Atan(),Atn2(),Sinh(),Cosh(),RToD(),DToR(),Pi()
Back to index


XToC

Lang:misc1.txt
Component:hbct
Doc. source:hbct\doc\en\misc1.txt
Template:
Category:CT3 miscellaneous functions
Subcategory:
Oneliner:
Syntax:XToC( <expValue> ) --> cValue
Arguments:<expValue> Designate an expression of some of the following data type: NUMBER, CHARACTER, DATE, LOGICAL.
Returns:XToC() return a string with the representation of data type of expValue.
Description:Each data type always returns a string with a particular fixed length: ----------------------------------------------------------- Data Type Result Length Similar function ----------------------------------------------------------- Numeric sizeof( DOUBLE ) FToC() Logical 1 Date 8 DToS() String Unchanged ----------------------------------------------------------- TODO: add documentation
Examples:
Status:Started
Compliance:
Files:Library is hbct.
See also:CToF(), FToC()
Back to index


BitToC

Lang:numconv.txt
Component:hbct
Doc. source:hbct\doc\en\numconv.txt
Template:
Category:CT3 number and bit manipulatio
Subcategory:
Oneliner:
Syntax:BitToC( <nInteger>, <cBitPattern>[,<lMode>] ) -> <cBitString>
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:
Files:Library is hbct.
See also:CToBit()
Back to index


CToBit

Lang:numconv.txt
Component:hbct
Doc. source:hbct\doc\en\numconv.txt
Template:
Category:CT3 number and bit manipulatio
Subcategory:
Oneliner:
Syntax:CToBit( <cBitString>, <cBitPattern> ) -> <nWord>
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:
Files:Library is hbct.
See also:BitToC()
Back to index


CToF

Lang:ftoc.txt
Component:hbct
Doc. source:hbct\doc\en\ftoc.txt
Template:
Category:CT3 number and bit manipulatio
Subcategory:
Oneliner:
Syntax:CToF( <cFloatingPointNumber> ) --> nFloatingPointNumber
Arguments:<cFloatingPointNumber> Designate a string that contains a Harbour number in flotaing point format. ATTENTION: different implementations or platforms of Harbour, they could produce different format in the string returned by FToC().
Returns:CToF() return the floating point number that corresponds to the string passed.
Description:Character strings created with FToC() or XToC() are convert into Harbour floating point number TODO: add documentation
Examples:
Status:Started
Compliance:
Files:Library is hbct.
See also:FToC(), XToC()
Back to index


CToN

Lang:numconv.txt
Component:hbct
Doc. source:hbct\doc\en\numconv.txt
Template:
Category:CT3 number and bit manipulatio
Subcategory:
Oneliner:
Syntax:CToN( <xNumber>[, <nBase>][,<lMode>] ) -> <nNumber>
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:
Files:Library is hbct.
See also:NToC()
Back to index


Exponent

Lang:exponent.txt
Component:hbct
Doc. source:hbct\doc\en\exponent.txt
Template:
Category:CT3 number and bit manipulatio
Subcategory:
Oneliner:Evaluate the exponent of a floating point number
Syntax:Exponent( <nFloatingPointNumber> ) --> nExponent
Arguments:<nFloatingPointNumber> Designate any Harbour number.
Returns:Exponent() returns the exponent of the <nFloatingPointNumber> number in base 2.
Description:This function supplements Mantissa() to return the exponent of the <nFloatingPointNumber> number. Values > 1 or values < -1 return a positive number 0 to 1023. Values < 1 or values > -1 return a negative number -1 to -1023. The Exponent( 0 ), return 0. The following calculation reproduces the original value: 2^Exponent(<nFloatingPointNumber>) * Mantissa(<nFloatingPointNumber>) = <nFloatingPointNumber> TODO: add documentation
Examples:
Status:Started
Compliance:Exponent() is compatible with CT3's Exponent()
Files:Library is hbct.
See also:Mantissa()
Back to index


FToC

Lang:ftoc.txt
Component:hbct
Doc. source:hbct\doc\en\ftoc.txt
Template:
Category:CT3 number and bit manipulatio
Subcategory:
Oneliner:
Syntax:FToC( <nFloatingPointNumber> ) --> cFloatingPointNumber
Arguments:<nFloatingPointNumber> Designate any Harbour number.
Returns:FToC() return a string with the size of DOUBLE. ATTENTION: different implementations or platforms of Harbour, they could produce different format in the string returned by FToC().
Description:Harbour internal numbers in Floating Point are stored in data type DOUBLE. FToC() returns these bits as an string. In this way, numbers con be saved more compactly. TODO: add documentation
Examples:
Status:Started
Compliance:
Files:Library is hbct.
See also:CToF(), XToC()
Back to index


Mantissa

Lang:exponent.txt
Component:hbct
Doc. source:hbct\doc\en\exponent.txt
Template:
Category:CT3 number and bit manipulatio
Subcategory:
Oneliner:Evaluate the mantissa of a floating point number
Syntax:Mantissa( <nFloatingPointNumber> ) --> nMantissa
Arguments:<nFloatingPointNumber> Designate any Harbour number.
Returns:Mantissa() returns the mantissa of the <nFloatingPointNumber> number.
Description:This function supplements Exponent() to return the mantissa of the <nFloatingPointNumber> number. Note: The mantissa value can be 0 or in the range of 1 to 2. The following calculation reproduces the original value: Mantissa( <nFloatingPointNumber> ) * 2 ^ Exponent( <nFloatingPointNumber> ) = <nFloatingPointNumber> TODO: add documentation
Examples:
Status:Started
Compliance:Mantissa() is compatible with CT3's Mantissa().
Files:Library is hbct.
See also:Exponent()
Back to index


NToC

Lang:numconv.txt
Component:hbct
Doc. source:hbct\doc\en\numconv.txt
Template:
Category:CT3 number and bit manipulatio
Subcategory:
Oneliner:
Syntax:NToC( <xNumber>[, <nBase>][,<nLength>][,<cPadChar>] ) -> <cNumber>
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:
Files:Library is hbct.
See also:CToN()
Back to index


Celsius

Lang:num1.txt
Component:hbct
Doc. source:hbct\doc\en\num1.txt
Template:
Category:CT3 numeric functions
Subcategory:
Oneliner:Temperature conversion Fahrenheit to Celsius
Syntax:Celsius( nDegreeFahrenheit ) --> nDegreeCelsius
Arguments:<nDegreeFahrenheit> temperature in degree Fahrenheit
Returns:<nDegreeCelsius> temperate in degree Celsius
Description:Celsius() converts temperature values measured in the Fahrenheit scale to the Celsius scale.
Examples:// melting point of water in standard conditions ? Celsius( 32.0 ) // --> 0.0 // boiling point of water in standard conditions ? Celsius( 212.0 ) // --> 100.0
Status:Ready
Compliance:Celsius() is compatible with CT3's Celsius().
Files:Library is hbct.
See also:Fahrenheit()
Back to index


Fahrenheit

Lang:num1.txt
Component:hbct
Doc. source:hbct\doc\en\num1.txt
Template:
Category:CT3 numeric functions
Subcategory:
Oneliner:Temperature conversion Celsius to Fahrenheit
Syntax:Fahrenheit( nDegreeCelsius ) --> nDegreeFahrenheit
Arguments:<nDegreeCelsius> temperate in degree Celsius
Returns:<nDegreeFahrenheit> temperature in degree Fahrenheit
Description:Fahrenheit() converts temperature values measured in the Celsius scale to the Fahrenheit scale.
Examples:// melting point of water in standard conditions ? Fahrenheit( 0.0 ) // --> 32.0 // boiling point of water in standard conditions ? Fahrenheit( 100.0 ) // --> 212.0
Status:Ready
Compliance:Fahrenheit() is compatible with CT3's Fahrenheit().
Files:Library is hbct.
See also:Celsius()
Back to index


Infinity

Lang:num1.txt
Component:hbct
Doc. source:hbct\doc\en\num1.txt
Template:
Category:CT3 numeric functions
Subcategory:
Oneliner:Returns the largest floating point number available in the system
Syntax:Infinity( [<lPlatformIndependant>] ) --> nLargestNumber
Arguments:[<lPlatformIndependant>] .T., if the function should return the maximum floating point value available (DBL_MAX) .F., function should try to return the same value as the original CT3 lib did Default: .F.
Returns:<nLargestNumber> the largest floating point number available in the system
Description:Infinity() returns the largest floating point number available in the system. For platform independance, this is set to DBL_MAX.
Examples:
Status:Ready
Compliance:Infinity() must not necessarily return the same number as CT3's Infinity().
Files:Library is hbct.
See also:
Back to index


PrintReady

Lang:print.txt
Component:hbct
Doc. source:hbct\doc\en\print.txt
Template:
Category:CT3 printer functions
Subcategory:
Oneliner:
Syntax:PrintReady( [<nPrinter>] ) -> lPrinterReady
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:
Files:Library is hbct.
See also:
Back to index


PrintStat

Lang:print.txt
Component:hbct
Doc. source:hbct\doc\en\print.txt
Template:
Category:CT3 printer functions
Subcategory:
Oneliner:
Syntax:PrintStat( [<nPrinter>] ) -> nState
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:
Files:Library is hbct.
See also:
Back to index


AddAscii

Lang:addascii.txt
Component:hbct
Doc. source:hbct\doc\en\addascii.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Add an integer value to an ascii value of a string
Syntax:AddAscii( <[@]cString>, <nValue>, [<nPosition>], [<lCarryOver>] ) --> cString
Arguments:<[@]cString> is the string that should be edited <nValue> is a integer value that should be added to the ASCII value of the character at the <nPosition>th position [<nPosition>] is the position of the character that should be edited. If not supplied, the last character of <[@]cString> is edited. [<lCarryOver>] NEW: is set to .T. if the substring from position 1 to position <nPosition> should be treated as an integer written to the base 256. Thus, the addition of <nValue> can affect to whole substring (see EXAMPLES). Default is .F., the original behaviour of this function.
Returns:The edited string is returned. The return value can be suppressed by using the CSetRef() function. The string must then be passed by reference [@].
Description:AddAscii() can be used to add or subtract integer values from ASCII values in a string. The new <lCarryOver> parameter allows to treat a string as an integer written to the base 256. Since <nValue> is limited to a signed long, only substrings 4 characters long can be affected by one AddAscii() call. If the length of <[@]cString> is smaller than <nPosition>, the string remains unchanged. The same happens, if uninterpretable parameters are passed to this function.
Examples:// Add 32 to the ASCII value of the character at the last position // in the string ? AddAscii( "SmitH", 32 ) // --> "Smith"
Status:Ready
Compliance:AddAscii() is compatible with CT3's AddAscii(). A new, 4th, parameter has been added who defaults to the original behaviour if omitted.
Files:Library is hbct.
See also:CSetRef()
Back to index


AfterAtNum

Lang:atnum.txt
Component:hbct
Doc. source:hbct\doc\en\atnum.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Returns string portion after nth occurence of substring
Syntax:AfterAtNum( <cStringToMatch>, <cString>, [<nCounter>], [<nIgnore>] ) --> cRestString
Arguments:<cStringToMatch> is the substring scanned for <cString> is the scanned string [<nCounter>] determines how many occurences are of <cStringToMatch> in <cString> are searched Default: search last occurence [<nIgnore>] determines how many character from the start should be ignored in the search Default: 0
Returns:<cRestString> the portion of <cString> after the <nCounter>th occurence of <cStringToMatch> in <cString> If such a rest does not exist, an empty string is returned.
Description:This function scans <cString> for <cStringToMatch>. After the <nCounter>th match (or the last one, depending on the value of <nCounter>) has been found, the portion of <cString> after that match will be returned. If there aren't enough matches or the last match is identical to the end of <cString>, an empty string will be returned. After a match has been found, the function continues to scan after that match if the CSetAtMupa() switch is turned off, with the second character of the matched substring otherwise. The function will also consider the settings of SetAtLike().
Examples:? AfterAtNum( "!", "What is the answer ? 4 ! 5 !" ) // -> "" ? AfterAtNum( "!", "What is the answer ? 4 ! 5 ?" ) // -> " 5 ?" <TODO: add some examples here with CSetAtMupa() and SetAtLike()>
Status:Ready
Compliance:AfterAtNum() is compatible with CT3's AfterAtNum().
Files:Library is hbct.
See also:AtNum(),BeforAtNum(),CSetAtMupa(),SetAtLike()
Back to index


AsciiSum

Lang:asciisum.txt
Component:hbct
Doc. source:hbct\doc\en\asciisum.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:calculate the sum of the ASCII values of the characters in a string
Syntax:AsciiSum( <cString> ) --> nAsciiSum
Arguments:<cString> the string to be processed
Returns:<nAsciiSum> sum of the ASCII values in <cString>
Description:The AsciiSum() function sums up the ASCII values of the characters in <cString>. Be aware that the function is not position sensitive, i.e. a change of position of a certain character in the string does not change the ascii sum.
Examples:? AsciiSum( "ABC" ) // --> 197 ? AsciiSum( "ACB" ) // --> 197
Status:Ready
Compliance:AsciiSum() is compatible with CT3's AsciiSum().
Files:Library is hbct.
See also:Checksum()
Back to index


AscPos

Lang:ascpos.txt
Component:hbct
Doc. source:hbct\doc\en\ascpos.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:ASCII value of a character at a certain position
Syntax:AscPos( <cString>, [<nPosition>] ) --> nAsciiValue
Arguments:<cString> is the processed string [<nPosition>] is an optional position within <cString> Default: last position in <cString>
Returns:<nAsciiValue> the ASCII value of the character at the specified position
Description:The AscPos() function returns the ASCII value of the character that can be found at the position <nPosition> in <cString>. If <nPosition> is larger than the length of <cString>, 0 is returned.
Examples:? AscPos( "0123456789" ) // --> 57 ? AscPos( "0123456789", 1 ) // --> 48
Status:Ready
Compliance:AscPos() is compatible with CT3's AscPos().
Files:Library is hbct.
See also:ValPos()
Back to index


AtAdjust

Lang:atadjust.txt
Component:hbct
Doc. source:hbct\doc\en\atadjust.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Adjusts a sequence within a string to a specified position
Syntax:AtAdjust( <cStringToMatch>, <cString>, <nAdjustPosition>, [<nCounter>], [<nIgnore>], [<nFillChar|cFillChar>] ) -> cString
Arguments:<cStringToMatch> is the sequence to be adjusted within <cString> <cString> is the string that contains <cStringToMatch> <nAdjustPosition> specifies the position to that <cStringToMatch> will be adjusted [<nCounter>] specifies which occurence of <cStringToMatch> in <cString> is to be adjusted Default: last occurence [<nIgnore>] specifies how many characters should be omitted in the scan [<nFillChar|cFillChar>] specifies the character that is used for the adjustment
Returns:cString the changed string
Description:<TODO: add a description, some examples and tests here>
Examples:
Status:Ready
Compliance:AtAdjust() works like CT3's AtAdjust()
Files:Library is hbct.
See also:SetAtLike(),CSetAtMupa()
Back to index


AtNum

Lang:atnum.txt
Component:hbct
Doc. source:hbct\doc\en\atnum.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Returns the start position of the nth occurence of a substring in a string
Syntax:ATNUM (<cStringToMatch>, <cString>, [<nCounter>], [<nIgnore>] ) --> nPosition
Arguments:<cStringToMatch> is the substring scanned for <cString> is the scanned string [<nCounter>] determines how many occurences are of <cStringToMatch> in <cString> are searched Default: search last occurence [<nIgnore>] determines how many character from the start should be ignored in the search Default: 0
Returns:<nPosition> the position of the <nCounter>th occurence of <cStringToMatch> in <cString>. If such an occurence does not exist, 0 is returned.
Description:This function scans <cString> for <cStringToMatch>. After the <nCounter>th match (or the last one, depending on the value of <nCounter>) has been found, the position of that match will be returned. If there aren't enough matches or there is no last match, 0 will be returned. After a match has been found, the function continues to scan after that match if the CSetAtMupa() switch is turned off, with the second character of the matched substring otherwise. The function will also consider the settings of SetAtLike().
Examples:? AtNum( "!", "What is the answer ? 4 ! 5 !" ) // -> 28 ? AtNum( "!", "What is the answer ? 4 ! 5 ?" ) // -> 24 <TODO: add some examples here with CSetAtMupa() and SetAtLike()>
Status:Ready
Compliance:AtNum() is compatible with CT3's AtNum().
Files:Library is hbct.
See also:AtNum() AfterAtNum() CSetAtMupa() SetAtLike()
Back to index


AtRepl

Lang:atrepl.txt
Component:hbct
Doc. source:hbct\doc\en\atrepl.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Search and replace sequences in a string
Syntax:AtRepl( <cStringToMatch>, <cString>, <cReplacement>, [<nCounter>], [<lMode>], [<nIgnore>] ) --> cString
Arguments:<cStringToMatch> is the substring searched for in <cString> <cString> is the processed string <cReplacement> is the replacement for sequences found [<nCounter>] specifies the number of replacements Default: last occurence [<lMode>] if set to .T., only the <nCounter>th sequence of <cStringToMatch> will be replaced, else all sequences will be replaced. Default: .F. [<nIgnore>]) specifies how many characters in <cString> from the beginning should be ignored by the function Default: 0
Returns:<cString>
Description:The AtRepl() function searches and replaces sequences in a string. First, the function ignores the first <nIgnore> characters of <cString>. Then, if <lMode> is set to .T., it searches for the <nCounter>th occurence of <cStringToMatch> in <cString>. If successful, the sequence will be replaced with <cReplacement>. If <lMode> is set to .F., the same search is performed, but EVERY occurence of <cStringToMatch> till the <nCounter>th (inclusive) will be replaced with <cReplacement>. Note that, in this case, the replacements are performed even if the <nCounter>th occurence does not exist. By using the CSetAtMupa() switch you can decide whether the function restarts searching after a found sequence of after the first character of that sequence. The function allows the use of wildcards in <cStringToMatch> and looks for the settings of SetAtLike().
Examples:? AtRepl( "ABC", "ABCDABCDABC", "xx" ) // --> "xxDxxDxx" ? AtRepl( "ABC", "ABCDABC", "ZYXW" ) // --> "ZYXWDZYXW" ? AtRepl( "ABC", "ABCDABCDABC", "xx", 2 ) // --> "xxDxxDABC" ? AtRepl( "ABC", "ABCDABCDABC", "xx", 2, .T. ) // --> "ABCDxxDABC"
Status:Ready
Compliance:AtRepl() is compatible with CT3's AtRepl(). Note the new, 6th parameter !
Files:Library is hbct.
See also:CSetAtMupa() SetAtLike()
Back to index


AtToken

Lang:token1.txt
Component:hbct
Doc. source:hbct\doc\en\token1.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Position of a token in a string
Syntax:AtToken( <cString>, [<cTokenizer>], [<nTokenCount>], [<nSkipWidth>] ) -> nPosition
Arguments:<cString> is the processed string [<cTokenizer>] is a list of characters separating the tokens in <cString> Default: Chr( 0 ) + Chr( 9 ) + Chr( 10 ) + Chr( 13 ) + Chr( 26 ) + hb_BChar( 138 ) + hb_BChar( 141 ) + Chr( 32 ) + ",.;:!\?/\\<>()#&%+-*" [<nTokenCount>] specifies the count of the token whose position should be calculated Default: last token [<nSkipWidth>] specifies the maximum number of successive tokenizing characters that are combined as ONE token stop, e.g. specifying 1 can yield to empty tokens Default: 0, any number of successive tokenizing characters are combined as ONE token stop
Returns:<nPosition> The start position of the specified token or 0 if such a token does not exist in <cString>.
Description:The AtToken() function calculates the start position of tne <nTokenCount>th token in <cString>. By setting the new <nSkipWidth> parameter to a value different than 0, you can specify how many tokenizing characters are combined at most to one token stop. Be aware that this can result to empty tokens there the start position is not defined clearly. Then, AtToken() returns the position there the token WOULD start if its length is larger than 0. To check for empty tokens, simply look if the character at the returned position is within the tokenizer list.
Examples:AtToken( "Hello, World!" ) // --> 8 (empty strings after tokenizer are not a token !)
Status:Ready
Compliance:AtToken() is compatible with CT3's ATTOKEN, but has an additional 4th parameter to let you specify a skip width equal to that in the Token() function.
Files:Library is hbct.
See also:Token(),NumToken(),TokenLower(),TokenUpper(),TokenSep()
Back to index


BeforAtNum

Lang:atnum.txt
Component:hbct
Doc. source:hbct\doc\en\atnum.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Returns string portion before nth occurence of substring
Syntax:BeforAtNum( <cStringToMatch>, <cString>, [<nCounter>], [<nIgnore>] ) --> cRestString
Arguments:<cStringToMatch> is the substring scanned for <cString> is the scanned string [<nCounter>] determines how many occurences are of <cStringToMatch> in <cString> are searched Default: search last occurence [<nIgnore>] determines how many character from the start should be ignored in the search Default: 0
Returns:<cRestString> the portion of <cString> before the <nCounter>th occurence of <cStringToMatch> in <cString> If such a string does not exist, an empty string is returned.
Description:This function scans <cString> for <cStringToMatch>. After the <nCounter>th match (or the last one, depending on the value of <nCounter>) has been found, the portion of <cString> before that match will be returned. If there aren't enough matches or the last match is identical to the start of <cString> (i.e. the last match is the first match), an empty string will be returned. After a match has been found, the function continues to scan after that match if the CSetAtMupa() switch is turned off, with the second character of the matched substring otherwise. The function will also consider the settings of SetAtLike().
Examples:? BeforAtNum( "!", "What is the answer ? 4 ! 5 !" ) // -> "What is the answer ? 4 ! 5 " ? BeforAtNum( "!", "What is the answer ? 4 ! 5 ?" ) // -> "What is the answer ? 4 " <TODO: add some examples here with CSetAtMupa() and SetAtLike()>
Status:Ready
Compliance:BeforAtNum() is compatible with CT3's BeforAtNum().
Files:Library is hbct.
See also:AtNum() AfterAtNum() CSetAtMupa() SetAtLike()
Back to index


CharAdd

Lang:charop.txt
Component:hbct
Doc. source:hbct\doc\en\charop.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Adds corresponding ASCII value of two strings
Syntax:CharAdd( <[@]cString1>, <cString2> ) --> cAddString
Arguments:<[@]cString1> first string <cString2> second string
Returns:<cAddString> string with added ASCII values
Description:The CharAdd() function constructs a new string from the two strings passed as parameters. To do this, it adds the ASCII values of the corresponding characters of both strings and places a character in the resulting string whose ASCII value equals to that sum (modulo 256). If the first string is passed by reference, the resulting string is stored in <cString1>, too. By setting the CSetRef()-switch to .T., the return value can be omitted. If <cString2> is shorter than <cString1> and the last character of <cString2> has been processed, the function restarts with the first character of <cString2>.
Examples:? CharAdd( "012345678", hb_BChar( 1 ) ) // --> "123456789" ? CharAdd( "123456789", hb_BChar( 255 ) ) // --> "012345678" ? CharAdd( "0000", hb_BChar( 0 ) + hb_BChar( 1 ) + hb_BChar( 2 ) + hb_BChar( 3 ) ) // --> "0123"
Status:Ready
Compliance:CharAdd() is compatible with CT3's CharAdd().
Files:Library is hbct.
See also:CharSub() CharAnd() CharNot() CharOr() CharXor() CharShl() CharShr() CharRll() CharRlr() CSetRef()
Back to index


CharAnd

Lang:charop.txt
Component:hbct
Doc. source:hbct\doc\en\charop.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Combine corresponding ASCII value of two strings with bitwise AND
Syntax:CharAnd( <[@]cString1>, <cString2> ) --> cAndString
Arguments:<[@]cString1> first string <cString2> second string
Returns:<cAndString> string with bitwise AND combined ASCII values
Description:The CharAnd() function constructs a new string from the two strings passed as parameters. To do this, it combines the ASCII values of the corresponding characters of both strings with a bitwise AND-operation and places a character in the resulting string whose ASCII value equals to the result of that operation. If the first string is passed by reference, the resulting string is stored in <cString1>, too. By setting the CSetRef()-switch to .T., the return value can be omitted. If <cString2> is shorter than <cString1> and the last character of <cString2> has been processed, the function restarts with the first character of <cString2>.
Examples:// clear the LSB ? CharAnd( "012345678", hb_BChar( 254 ) ) // --> "002244668" ? CharAnd( "012345678", hb_BChar( 254 ) + hb_BChar( 252 ) ) // --> "002044648"
Status:Ready
Compliance:CharAnd() is compatible with CT3's CharAnd().
Files:Library is hbct.
See also:CharAdd() CharSub() CharNot() CharOr() CharXor() CharShl() CharShr() CharRll() CharRlr() CSetRef()
Back to index


CharEven

Lang:charevod.txt
Component:hbct
Doc. source:hbct\doc\en\charevod.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Returns the characters on the even positions in a string
Syntax:CharEven( <cString> ) --> cEvenString
Arguments:<cString> processed string
Returns:<cEvenString> a string containing all character from even positions in <cString>
Description:The CharEven() function looks for the characters on the even positions in a given string, collects them and returns them as a string.
Examples:? CharEven( " H E L L O !" ) // -> "HELLO!"
Status:Ready
Compliance:CharEven() is compatible with CT3's CharEven().
Files:Library is hbct.
See also:CharOdd() CharMix()
Back to index


CharHist

Lang:charlihb.txt
Component:hbct
Doc. source:hbct\doc\en\charlihb.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Generates a character histogram of a string
Syntax:CharHist( [<cString>] ) -> aCharacterCount
Arguments:[<cString>] is the string for whom the function generates a character histogram Default: "" (empty string)
Returns:<aCharacterCount> an array with 256 elements where the nth element contains the count of character #(n-1) in cString
Description:The CharHist() function generates a character histogram of those characters that are contained in <cString>. This histogram is stored in an 256-element array where the nth element contains the count of ASCII character #(n-1) in <cString>.
Examples:? CharHist( "Hello World !" )[ 109 ] // --> 3 // Chr( 108 ) == "l"
Status:Ready
Compliance:CharHist() is only available in Harbour's CT3 library.
Files:Library is hbct.
See also:CharList(),CharNoList(),CharSList()
Back to index


CharList

Lang:charlist.txt
Component:hbct
Doc. source:hbct\doc\en\charlist.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Generates a list of all characters in a string
Syntax:CharList( [<cString>] ) -> cCharacterList
Arguments:[<cString>] is the string for whom the function generates a list of all characters Default: "" (empty string)
Returns:<cCharacterList> a list of the characters in <cString>
Description:The CharList() function generates a list of those characters that are contained in <cString>. This list can contain each character only once, so that its maximum length is 256. The list lists those characters first that are occuring in <cString> first.
Examples:? CharList( "Hello World !" ) // --> "Helo Wrd!"
Status:Ready
Compliance:CharList() is compatible with CT3's CharList().
Files:Library is hbct.
See also:CharNoList(),CharSList(),CharHist()
Back to index


CharMirr

Lang:charmirr.txt
Component:hbct
Doc. source:hbct\doc\en\charmirr.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Mirror a string
Syntax:CharMirr( <[@]cString>, [<lDontMirrorSpaces>] ) -> cMirroredString
Arguments:<[@]cString> is the string that should be mirrored [<lDontMirrorSpaces>] if set to .T., spaces at the end of <cString> will not be mirrored but kept at the end Default: .F., mirror the whole string
Returns:<cMirroredString> the mirrored string
Description:The CharMirr() function mirrors a string, i.e. the first character will be put at the end, the second at the last but one position etc.. One can use this function for index searches, but then, the spaces at the end of the string should not be mirrored. One can omit the return value of the function by setting the CSetRef() switch to .T., but <cString> must then be passed by reference to get a result.
Examples:? CharMirr( "racecar" ) // "racecar" ? CharMirr( "racecar ", .T. ) // "racecar " ? CharMirr( "racecar ", .F. ) // " racecar"
Status:Ready
Compliance:CharMirr() is compatible with CT3's CharMirr().
Files:Library is hbct.
See also:CSetRef()
Back to index


CharMix

Lang:charmix.txt
Component:hbct
Doc. source:hbct\doc\en\charmix.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Mix two strings
Syntax:CharMix( <cString1>[, <cString2>] ) --> cMixedString
Arguments:<cString1> String that will be mixed with the characters from <cString2> [<cString2>] String whose characters will be mixed with the one from <cString1>. Default: " " (string with one space char)
Returns:<cMixedString> Mixed string
Description:The CharMix() function mixes the strings <cString1> and <cString2>. To do this it takes one character after the other alternatively from <cString1> and <cString2> and puts them in the output string. This procedure is stopped when the end of <cString1> is reached. If <cString2> is shorter than <cString1>, the function will start at the begin of <cString2> again. If on the other hand <cString2> is longer than <cString1>, the surplus characters will be omitted.
Examples:? CharMix( "ABC", "123" ) // "A1B2C3" ? CharMix( "ABCDE", "12" ) // "A1B2C1D2E1" ? CharMix( "AB", "12345" ) // "A1B2" ? CharMix( "HELLO", " " ) // "H E L L O " ? CharMix( "HELLO", "" ) // "HELLO"
Status:Ready
Compliance:CharMix() is compatible with CT3's CharMix(). NOTE: CA-Tools version of CharMix() will hang if the second parameter is an empty string, this version will not.
Files:Library is hbct.
See also:CharEven() CharOdd()
Back to index


CharNoList

Lang:charlist.txt
Component:hbct
Doc. source:hbct\doc\en\charlist.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Generates a list of all characters not contained in a string
Syntax:CharNoList( [<cString>] ) -> cCharacterList
Arguments:[<cString>] is the string for whom the function generates a list of all characters not contained in that string Default: "" (empty string)
Returns:<cCharacterList> a list of the characters that are not contained in <cString>
Description:The CharNoList() function generates a list of those characters that are not contained in <cString>. This list can contain each character only once, so that its maximum length is 256. The list is alphabetically sorted.
Examples:? CharNoList( CharNoList( "Hello World !" ) ) // --> " !HWdelor"
Status:Ready
Compliance:CharNoList() is compatible with CT3's CharNoList().
Files:Library is hbct.
See also:CharList(),CharSList(),CharHist()
Back to index


CharNot

Lang:charop.txt
Component:hbct
Doc. source:hbct\doc\en\charop.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Process each character in a string with bitwise NOT operation
Syntax:CharNot( <[@]cString> ) --> cNotString
Arguments:<[@]cString> string to be processed
Returns:<cNotString> string with bitwise negated characters
Description:The CharNot() function constructs a new string from the string passed as parameter. To do this, it performs a bitwise NOT operation to the characters of the string and places a character in the resulting string whose ASCII value equals to the result of that operation. It can be easily seen that the resulting ASCII-value equals 255 minus input ASCII value. If the string is passed by reference, the resulting string is stored in <cString>, too. By setting the CSetRef()-switch to .T., the return value can be omitted.
Examples:? CharNot( hb_BChar( 85 ) + hb_BChar( 128 ) + hb_BChar( 170 ) + hb_BChar( 1 ) ) // --> hb_BChar( 170 ) + hb_BChar( 127 ) + hb_BChar( 85 ) + hb_BChar( 254 ) ? CharNot( CharNot( "This is a test!" ) ) // --> "This is a test!"
Status:Ready
Compliance:CharNot() is compatible with CT3's CharNot().
Files:Library is hbct.
See also:CharAdd() CharSub() CharAnd() CharOr() CharXor() CharShl() CharShr() CharRll() CharRlr() CSetRef()
Back to index


CharOdd

Lang:charevod.txt
Component:hbct
Doc. source:hbct\doc\en\charevod.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Returns the characters on the odd positions in a string
Syntax:CharOdd( <cString> ) --> cOddString
Arguments:<cString> processed string
Returns:<cOddString> a string containing all character from odd positions in <cString>
Description:The CharOdd() function looks for the characters on the odd positions in a given string, collects them and returns them as a string.
Examples:? CharOdd( "H E L L O ! " ) // -> "HELLO!"
Status:Ready
Compliance:CharOdd() is compatible with CT3's CharOdd().
Files:Library is hbct.
See also:CharEven() CharMix()
Back to index


CharOne

Lang:charone.txt
Component:hbct
Doc. source:hbct\doc\en\charone.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Reduce multiple occurences of a character to one
Syntax:CharOne( [<cCharactersToReduce>,] <cString> ) -> cReducedString
Arguments:[<cCharactersToReduce>] specifies the characters the multiple occurences of which should be reduced to one Default: All characters. <cString> specifies the processed string
Returns:<cReducedString> the string with the reduced occurences
Description:The CharOne() function reduces multiple occurences of characters in <cString> to a single one. It is important to note that the multiple occurences must occur directly one behind the other. This behaviour is is in contrast to the CharList() function.
Examples:? CharOne( "122333a123" ) // "123a123" ? CharOne( "A B CCCD" ) // "A B CD" ? CharOne( " ", "A B A B" ) // "A B A B" ? CharOne( "o", "122oooB12o" ) // "122oB12o"
Status:Ready
Compliance:CharOne() is compatible with CT3's CharOne().
Files:Library is hbct.
See also:CharRem() WordOne()
Back to index


CharOnly

Lang:charonly.txt
Component:hbct
Doc. source:hbct\doc\en\charonly.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Intersectional set of two strings based on characters
Syntax:CharOnly( <cThisCharactersOnly>, <cString> ) -> cReducedString
Arguments:<cThisCharactersOnly> specifies the characters that must not be deleted in <cString>. <cString> is the string that should be processed
Returns:<cReducedString> A string with all characters deleted but those specified in <cThisCharactersOnly>.
Description:The CharOnly() function calculates the intersectional set of two strings. To do this, it deletes all characters from <cString> that do not appear in <cThisCharacterOnly>.
Examples:? CharOnly( "0123456789", "0211 - 38 99 77" ) // "0211389977" ? CharOnly( "0123456789", "0211/ 389 977" ) // "0211389977"
Status:Ready
Compliance:CharOnly() is compatible with CT3's CharOnly().
Files:Library is hbct.
See also:CharRem() WordOnly() WordRem()
Back to index


CharOr

Lang:charop.txt
Component:hbct
Doc. source:hbct\doc\en\charop.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Combine corresponding ASCII value of two strings with bitwise OR
Syntax:CharOr( <[@]cString1>, <cString2> ) --> cOrString
Arguments:<[@]cString1> first string <cString2> second string
Returns:<cOrString> string with bitwise OR combined ASCII values
Description:The CharOr() function constructs a new string from the two strings passed as parameters. To do this, it combines the ASCII values of the corresponding characters of both strings with a bitwise OR-operation and places a character in the resulting string whose ASCII value equals to the result of that operation. If the first string is passed by reference, the resulting string is stored in <cString1>, too. By setting the CSetRef()-switch to .T., the return value can be omitted. If <cString2> is shorter than <cString1> and the last character of <cString2> has been processed, the function restarts with the first character of <cString2>.
Examples:// set the LSB ? CharOr( "012345678", hb_BChar( 1 ) ) // --> "113355779" ? CharOr( "012345678", hb_BChar( 1 ) + hb_BChar( 3 ) ) // --> "133357779"
Status:Ready
Compliance:CharOr() is compatible with CT3's CharOr().
Files:Library is hbct.
See also:CharAdd() CharSub() CharNot() CharAnd() CharXor() CharShl() CharShr() CharRll() CharRlr() CSetRef()
Back to index


CharRelA

Lang:relation.txt
Component:hbct
Doc. source:hbct\doc\en\relation.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Character relation of two strings
Syntax:CharRelA( <cStringToMatch1>, <cString1>, <cStringToMatch2>, <cString2> ) -> nPosition
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:CharRelA() is compatible with CT3's CharRelA().
Files:Library is hbct.
See also:CharRelRep()
Back to index


CharRelRep

Lang:relation.txt
Component:hbct
Doc. source:hbct\doc\en\relation.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Relation dependant character replacement
Syntax:CharRelRep( <cStringToMatch1>, <cString1>, <cStringToMatch2>, <[@]cString2>, <cReplacement> ) -> cString
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:CharRelRep() is compatible with CT3's CharRelRep().
Files:Library is hbct.
See also:CharRelA(),CSetRef()
Back to index


CharRem

Lang:charonly.txt
Component:hbct
Doc. source:hbct\doc\en\charonly.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Removes characters from a string
Syntax:CharRem( <cDeleteThisCharacters>, <cString> ) -> cReducedString
Arguments:<cDeleteThisCharacters> specifies the characters that should be deleted in <cString> <cString>) is the string that should be processed
Returns:<cReducedString> is a string where the characters specified in <cDeleteThisCharacters> are deleted
Description:The CharRem() function deletes the characters specified in <cDeleteThisCharacters> from <cString>.
Examples:? CharRem( " ", " 1 2 " ) // "12" ? CharRem( "3y", "xyz123" ) // "xz12"
Status:Ready
Compliance:CharRem() is compatible with CT3's CharRem().
Files:Library is hbct.
See also:CharOnly() WordOnly() WordRem()
Back to index


CharRepl

Lang:charrepl.txt
Component:hbct
Doc. source:hbct\doc\en\charrepl.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Replacement of characters
Syntax:CharRepl( <cSearchString>, <[@]cString>, <cReplaceString>, [<lMode>] ) -> cString
Arguments:<cSearchString> is a string of characters that should be replaced <[@]cString> is the processed string <cReplaceString> is a string of characters that replace the one of <cSearchString> [<lMode>] sets the replacement method (see description) Default: .F.
Returns:<cString> the processed string
Description:The CharRepl() function replaces certain characters in <cString> with others depending on the setting of <lMode>. If <lMode> is set to .F., the function takes the characters of <cSearchString> one after the other, searches for them in <cString> and, if successful, replaces them with the corresponding character of <cReplaceString>. Be aware that if the same characters occur in both <cSearchString> and <cReplaceString>, the character on a certain position in <cString> can be replaced multiple times. if <lMode> is set to .T., the function takes the characters in <cString> one after the other, searches for them in <cSearchString> and, if successful, replaces them with the corresponding character of <cReplaceString>. Note that no multiple replacements are possible in this mode. If <cReplaceString> is shorter than <cSearchString>, the last character of <cReplaceString> is used as corresponding character for the the "rest" of <cSearchString>. One can omit the return value by setting the CSetRef() switch to .T., but then one must pass <cString> by reference to get the result.
Examples:? CharRepl( "1234", "1x2y3z", "abcd" ) // "axbycz" ? CharRepl( "abcdefghij", "jhfdb", "1234567890" ) // "08642" ? CharRepl( "abcdefghij", "jhfdb", "12345" ) // "55542" ? CharRepl( "1234", "1234", "234A" ) // "AAAA" ? CharRepl( "1234", "1234", "234A", .T. ) // "234A"
Status:Ready
Compliance:CharRepl() is compatible with CT3's CharRepl().
Files:Library is hbct.
See also:WordRepl() PosRepl() RangeRepl() CSetRef()
Back to index


CharRll

Lang:charophb.txt
Component:hbct
Doc. source:hbct\doc\en\charophb.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Process each character in a string with bitwise ROLL LEFT operation
Syntax:CharRll( <[@]cString>, <nBitsToRLL> ) --> cRLLString
Arguments:<[@]cString> string to be processed <nBitsToRLL> number of bit positions to be rolled to the left
Returns:<cRLLString> string with bitwise rolled left characters
Description:The CharRll() function constructs a new string from the string passed as parameter. To do this, it performs a bitwise ROLL LEFT (RLL) operation to the characters of the string and places a character in the resulting string whose ASCII value equals to the result of that operation. Be aware that, in contrast to CharShl(), bits rolled out on the left are put in again on the right. If the string is passed by reference, the resulting string is stored in <cString>, too. By setting the CSetRef()-switch to .T., the return value can be omitted.
Examples:? CharRll( hb_BChar( 1 ) + hb_BChar( 2 ) + hb_BChar( 4 ) + hb_BChar( 8 ) + ; hb_BChar( 16 ) + hb_BChar( 32 ) + hb_BChar( 64 ) + hb_BChar( 128 ), 3 ) // --> hb_BChar( 8 ) + hb_BChar( 16 ) + hb_BChar( 32 ) + hb_BChar( 64 ) + ; // hb_BChar( 128 ) + hb_BChar( 1 ) + hb_BChar( 2 ) + hb_BChar( 4 )
Status:Ready
Compliance:CharRll() is a new function that is only available in Harbour's CT3 lib.
Files:Library is hbct.
See also:CharAdd() CharSub() CharAnd() CharOr() CharXor() CharNot() CharShl() CharShr() CharRlr() CSetRef()
Back to index


CharRlr

Lang:charophb.txt
Component:hbct
Doc. source:hbct\doc\en\charophb.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Process each character in a string with bitwise ROLL RIGHT operation
Syntax:CharRlr( <[@]cString>, <nBitsToRLR> ) --> cRLRString
Arguments:<[@]cString> string to be processed <nBitsToRLR> number of bit positions to be rolled to the right
Returns:<cRLRString> string with bitwise rolled right characters
Description:The CharRlr() function constructs a new string from the string passed as parameter. To do this, it performs a bitwise ROLL RIGHT (RLR) operation to the characters of the string and places a character in the resulting string whose ASCII value equals to the result of that operation. Be aware that, in contrast to CharShr(), bits rolled out on the right are put in again on the left. If the string is passed by reference, the resulting string is stored in <cString>, too. By setting the CSetRef()-switch to .T., the return value can be omitted.
Examples:? CharRlr( hb_BChar( 1 ) + hb_BChar( 2 ) + hb_BChar( 4 ) + hb_BChar( 8 ) + ; hb_BChar( 16 ) + hb_BChar( 32 ) + hb_BChar( 64 ) + hb_BChar( 128 ), 3 ) // --> hb_BChar( 32 ) + hb_BChar( 64 ) + hb_BChar( 128 ) + hb_BChar( 1 ) + ; // hb_BChar( 2 ) + hb_BChar( 4 ) + hb_BChar( 8 ) + hb_BChar( 16 )
Status:Ready
Compliance:CharRlr() is a new function that is only available in Harbour's CT3 lib.
Files:Library is hbct.
See also:CharAdd() CharSub() CharAnd() CharOr() CharXor() CharNot() CharShl() CharShr() CharRll() CSetRef()
Back to index


CharShl

Lang:charophb.txt
Component:hbct
Doc. source:hbct\doc\en\charophb.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Process each character in a string with bitwise SHIFT LEFT operation
Syntax:CharShl( <[@]cString>, <nBitsToSHL> ) --> cSHLString
Arguments:<[@]cString> string to be processed <nBitsToSHL> number of bit positions to be shifted to the left
Returns:<cSHLString> string with bitwise shifted left characters
Description:The CharShl() function constructs a new string from the string passed as parameter. To do this, it performs a bitwise SHIFT LEFT (SHL) operation to the characters of the string and places a character in the resulting string whose ASCII value equals to the result of that operation. Be aware that bits shifted out of the byte are lost. If you need a bit rotation, use the CharRll() function instead. If the string is passed by reference, the resulting string is stored in <cString>, too. By setting the CSetRef()-switch to .T., the return value can be omitted.
Examples:? CharShl( hb_BChar( 1 ) + hb_BChar( 2 ) + hb_BChar( 4 ) + hb_BChar( 8 ) + ; hb_BChar( 16 ) + hb_BChar( 32 ) + hb_BChar( 64 ) + hb_BChar( 128 ), 3 ) // --> hb_BChar( 8 ) + hb_BChar( 16 ) + hb_BChar( 32 ) + hb_BChar( 64 ) + ; // hb_BChar( 128 ) + hb_BChar( 0 ) + hb_BChar( 0 ) + hb_BChar( 0 )
Status:Ready
Compliance:CharShl() is a new function that is only available in Harbour's CT3 lib.
Files:Library is hbct.
See also:CharAdd() CharSub() CharAnd() CharOr() CharXor() CharNot() CharShr() CharRll() CharRlr() CSetRef()
Back to index


CharShr

Lang:charophb.txt
Component:hbct
Doc. source:hbct\doc\en\charophb.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Process each character in a string with bitwise SHIFT RIGHT operation
Syntax:CharShr( <[@]cString>, <nBitsToSHR> ) --> cSHRString
Arguments:<[@]cString> string to be processed <nBitsToSHR> number of bit positions to be shifted to the right
Returns:<cSHRString> string with bitwise shifted right characters
Description:The CharShr() function constructs a new string from the string passed as parameter. To do this, it performs a bitwise SHIFT RIGHT (SHR) operation to the characters of the string and places a character in the resulting string whose ASCII value equals to the result of that operation. Be aware that bits shifted out of the byte are lost. If you need a bit rotation, use the CharRlr() function instead. If the string is passed by reference, the resulting string is stored in <cString>, too. By setting the CSetRef()-switch to .T., the return value can be omitted.
Examples:? CharShr( hb_BChar( 1 ) + hb_BChar( 2 ) + hb_BChar( 4 ) + hb_BChar( 8 ) + ; hb_BChar( 16 ) + hb_BChar( 32 ) + hb_BChar( 64 ) + hb_BChar( 128 ), 3 ) // --> hb_BChar( 0 ) + hb_BChar( 0 ) + hb_BChar( 0 ) + hb_BChar( 1 ) + ; // hb_BChar( 2 ) + hb_BChar( 4 ) + hb_BChar( 8 ) + hb_BChar( 16 )
Status:Ready
Compliance:CharShr() is a new function that is only available in Harbour's CT3 lib.
Files:Library is hbct.
See also:CharAdd() CharSub() CharAnd() CharOr() CharXor() CharNot() CharShl() CharRll() CharRlr() CSetRef()
Back to index


CharSList

Lang:charlihb.txt
Component:hbct
Doc. source:hbct\doc\en\charlihb.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Generates a sorted list of all characters in a string
Syntax:CharSList( [<cString>] ) -> cSortedCharacterList
Arguments:[<cString>] is the string for whom the function generates a sorted list of all characters Default: "" (empty string)
Returns:<cSortedCharacterList> a sorted list of the characters in <cString>
Description:The CharList() function generates a sorted list of those characters that are contained in <cString>. This list can contain each character only once, so that its maximum length is 256. The function gives the same result as CharSort(CharList(<cString>))
Examples:? CharSList( "Hello World !" ) // --> " !HWdelor"
Status:Ready
Compliance:CharSList() is only available in Harbour's CT3 library.
Files:Library is hbct.
See also:CharNoList(),CharList(),CharHist()
Back to index


CharSort

Lang:charsort.txt
Component:hbct
Doc. source:hbct\doc\en\charsort.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Sort sequences within a string.
Syntax:CharSort( <[@]cString>, [<nElementLength>], [<nCompareLength>], [<nIgnoreCharacters>], [<nElemenOffset>], [<nSortLength>], [<lDescending>] ) -> cSortedString
Arguments:<[@]cString> is the string that should be processed [<nElementLength>] specifies the length of the elements that should be sorted Default: 1 [<nCompareLength>] specifies how many characters within one element should be used for comparison Default: <nElementLength> [<nIgnoreCharacters>] specifies the number of characters at the beginning of <cString> that should be ignored in the sort process Default: 0 [<nElementOffset>] specifies the offset of the comparison string within a element Default: 0 [<nSortLength>] specifies how many characters in <cString>, starting from the <nIgnoreCharacters> position, should be sorted Default: Len(cString)-nIgnoreCharacters [<lDescending>]) specifies whether the process should sort descending or not
Returns:<cSortedString> the string resulting from the sort process
Description:The CHARSORT function sorts the characters within a string <cString>. With the parameters <nIgnoreCharacters> and <nSortLength>, you can determine that only the substring from position <nIgnoreCharacters>+1 to position <nIgnoreCharacters>+<nSortLength> within <cString> should be sorted. The sorting algorithm is determined with the other parameters. <nElementLength> specifies the length of one element, i.e. there are <nSortLength>/<nElementLength> elements that are sorted. Note that surplus characters are not sorted but stay at their position. To do the sorting, the function uses the Quicksort algorithm implemented in the C-lib qsort() function. This algorithm needs to know how to compare and order two elements. This is done by comparing the ASCII values of a substring within each element. This substring is determined by the parameters <nElementOffset> and <nCompareLength> and the order by <lDescending>. By setting the CSetRef() switch to .T., one can omit the return value of the function, but one must then pass <cString> by reference.
Examples:? CharSort( "qwert" ) // "eqrtw" ? CharSort( "qwert", 2 ) // "erqwt" ? CharSort( "b1a4a3a2a1", 2, 1 ) // "a2a1a3a4b1" ? CharSort( "XXXqwert", 1, 1, 3 ) // "XXXeqrtw" ? CharSort( "b1a4a3a2a1", 2, 1, 0, 1 ) // "a1b1a2a3a4" ? CharSort( "384172852", 1, 1, 0, 0, 4 ) // "134872852" ? CharSort( "qwert", .T. ) // "wtrqe"
Status:Ready
Compliance:CharSort() is compatible with CT3's CharSort().
Files:Library is hbct.
See also:CSetRef()
Back to index


CharSub

Lang:charophb.txt
Component:hbct
Doc. source:hbct\doc\en\charophb.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Subtracts corresponding ASCII value of two strings
Syntax:CharSub( <[@]cString1>, <cString2>) --> cSubString
Arguments:<[@]cString1> first string <cString2> second string
Returns:<cSubString> string with subtracted ASCII values
Description:The CharSub() function constructs a new string from the two strings passed as parameters. To do this, it subtracts the ASCII values of the corresponding characters of both strings and places a character in the resulting string whose ASCII value equals to that difference (modulo 256). If the first string is passed by reference, the resulting string is stored in <cString1>, too. By setting the CSetRef()-switch to .T., the return value can be omitted. If <cString2> is shorter than <cString1> and the last character of <cString2> has been processed, the function restarts with the first character of <cString2>.
Examples:? CharSub( "012345678", hb_BChar( 1 ) ) // --> "/01234567" ? CharSub( "123456789", hb_BChar( 255 ) ) // --> "23456789:" ? CharSub( "9999", hb_BChar( 0 ) + hb_BChar( 1 ) + hb_BChar( 2 ) + hb_BChar( 3 ) ) // --> "9876"
Status:Ready
Compliance:CharSub() is a new function that is only available in Harbour's CT3 lib.
Files:Library is hbct.
See also:CharAdd() CharAnd() CharNot() CharOr() CharXor() CharShl() CharShr() CharRll() CharRlr() CSetRef()
Back to index


CharSwap

Lang:charswap.txt
Component:hbct
Doc. source:hbct\doc\en\charswap.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Swap neighbouring characters in a string
Syntax:CharSwap( <[@]cString> ) -> cSwappedString
Arguments:<[@]cString> is the string that should be processed
Returns:<cSwappedString> a string where neighbour characters are swapped
Description:The CharSwap() function loops through <cString> in steps of two characters and exchanges the characters from the odd and the even positions. By setting the CSetRef() switch to .T., one can omit the return value of this functin, but one must then pass <cString> by reference.
Examples:? CharSwap( "0123456789" ) // "1032547698" ? CharSwap( "ABCDEFGHIJK" ) // "BADCFEHGJIK"
Status:Ready
Compliance:CharSwap() is compatible with CT3's CharSwap().
Files:Library is hbct.
See also:WordSwap(),CSetRef()
Back to index


CharXor

Lang:charop.txt
Component:hbct
Doc. source:hbct\doc\en\charop.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Combine corresponding ASCII value of two strings with bitwise XOR
Syntax:CharXor( <[@]cString1>, <cString2> ) --> cXOrString
Arguments:<[@]cString1> first string <cString2> second string
Returns:<cXOrString> string with bitwise XOR combined ASCII values
Description:The CharXor() function constructs a new string from the two strings passed as parameters. To do this, it combines the ASCII values of the corresponding characters of both strings with a bitwise XOR-operation and places a character in the resulting string whose ASCII value equals to the result of that operation. If the first string is passed by reference, the resulting string is stored in <cString1>, too. By setting the CSetRef()-switch to .T., the return value can be omitted. If <cString2> is shorter than <cString1> and the last character of <cString2> has been processed, the function restarts with the first character of <cString2>.
Examples:// easy encryption ? CharXor( "This is top secret !", "My Password" ) // --> <encrypted sentence>
Status:Ready
Compliance:CharXor() is compatible with CT3's CharXor().
Files:Library is hbct.
See also:CharAdd() CharSub() CharNot() CharAnd() CharOr() CharShl() CharShr() CharRll() CharRlr() CSetRef()
Back to index


CountLeft

Lang:count.txt
Component:hbct
Doc. source:hbct\doc\en\count.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Count a certain character at the beginning of a string
Syntax:CountLeft( <cString>, [<cSearch|nSearch>] ) -> nCount
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:CountLeft() is compatible with CT3's CountLeft().
Files:Library is hbct.
See also:CountRight()
Back to index


CountRight

Lang:count.txt
Component:hbct
Doc. source:hbct\doc\en\count.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Count a certain character at the end of a string
Syntax:CountRight( <cString>, [<cSearch|nSearch>] ) -> nCount
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:CountRight() is compatible with CT3's CountRight().
Files:Library is hbct.
See also:CountLeft()
Back to index


CSetAtMupa

Lang:ctstr.txt
Component:hbct
Doc. source:hbct\doc\en\ctstr.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Determine "multi-pass" behaviour in some string functions
Syntax:CSetAtMupa( [<lNewSwitch>] ) -> lOldSwitch
Arguments:[<lNewSwitch>] .T. -> turn "multi-pass" on .F. -> turn "multi-pass" off
Returns:lOldSwitch old (if lNewSwitch is a logical value) or current state of the switch
Description:CSETATMUPA determines how the following CT3 string functions AtNum() AfterAtNum() BeforAtNum() AtRepl() NumAt() AtAdjust() WordToChar() WordRepl() perform their work. See the respective function documentation for a further description how the switch influences these functions.
Examples:
Status:Ready
Compliance:This function is fully CT3 compatible.
Files:Library is hbct.
See also:AtNum() AfterAtNum() BeforAtNum() AtRepl() NumAt() AtAdjust() WordToChar() WordRepl()
Back to index


CSetRef

Lang:ctstr.txt
Component:hbct
Doc. source:hbct\doc\en\ctstr.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Determine return value of reference sensitive CT3 string functions
Syntax:CSetRef( [<lNewSwitch>] ) -> lOldSwitch
Arguments:[<lNewSwitch>] .T. -> suppress return value .F. -> do not suppress return value
Returns:lOldSwitch old (if lNewSwitch is a logical value) or current state of the switch
Description:Within the CT3 functions, the following functions do not change the length of a string passed as parameter while transforming this string: AddAscii() Blank() CharAdd() CharAnd() CharMirr() CharNot() CharOr() CharRelRep() CharRepl() CharSort() CharSwap() CharXor() Crypt() JustLeft() JustRight() PosChar() PosRepl() RangeRepl() ReplAll() ReplLeft() ReplRight() TokenLower() TokenUpper() WordRepl() WordSwap() Thus, these functions allow to pass the string by reference [@] to the function so that it may not be necessary to return the transformed string. By calling CSETREF (.T.), the above mentioned functions return the value .F. instead of the transformed string if the string is passed by reference to the function. The switch is turned off (.F.) by default.
Examples:
Status:Ready
Compliance:This function is fully CT3 compatible.
Files:Library is hbct.
See also:AddAscii() Blank() CharAdd() CharAnd() CharMirr() CharNot() CharOr() CharRelRep() CharRepl() CharSort() CharSwap() CharXor() Crypt() JustLeft() JustRight() PosChar() PosRepl() RangeRepl() ReplAll() ReplLeft() ReplRight() TokenLower() TokenUpper() WordRepl() WordSwap()
Back to index


JustLeft

Lang:justify.txt
Component:hbct
Doc. source:hbct\doc\en\justify.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Move characters from the beginning to the end of a string
Syntax:JustLeft( <[@]cString>, [<cChar>|<nChar>] ) -> cJustifiedString
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:JustLeft() is compatible with CT3's JustLeft().
Files:Library is hbct.
See also:JustRight()
Back to index


NumAt

Lang:numat.txt
Component:hbct
Doc. source:hbct\doc\en\numat.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Number of occurrences of a sequence in a string
Syntax:NumAt( <cStringToMatch>, <cString>, [<nIgnore>] ) --> nCount
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:NumAt() is compatible with CT3's NumAt().
Files:Library is hbct.
See also:CSetAtMupa(),SetAtLike()
Back to index


NumToken

Lang:token1.txt
Component:hbct
Doc. source:hbct\doc\en\token1.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Retrieves the number of tokens in a string
Syntax:NumToken( <cString>, [<cTokenizer>], [<nSkipWidth>] ) -> nTokenCount
Arguments:
Returns:
Description:
Examples:
Status:Ready
Compliance:NumToken() is compatible with CT3's NumToken().
Files:Library is hbct.
See also:Token(),AtToken(),TokenLower(),TokenUpper(),TokenSep()
Back to index


PadLeft

Lang:ctpad.txt
Component:hbct
Doc. source:hbct\doc\en\ctpad.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Fills string to a certain length on the left
Syntax:PadLeft( <cString>, <nLength>, [<cChar|nChar>] ) -> cString
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:PadLeft() is compatible with CT3's PadLeft().
Files:Library is hbct.
See also:PadRight()
Back to index


PadRight

Lang:ctpad.txt
Component:hbct
Doc. source:hbct\doc\en\ctpad.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Fills string to a certain length on the right
Syntax:PadRight( <cString>, <nLength>, [<cChar|nChar>] ) -> cString
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:PadRight() is compatible with CT3's PadRight().
Files:Library is hbct.
See also:PadLeft()
Back to index


PosAlpha

Lang:pos1.txt
Component:hbct
Doc. source:hbct\doc\en\pos1.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Left-most position of a letter in a string
Syntax:PosAlpha( <cString>, [<lMode>], [<nIgnore>] ) -> nPosition
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:PosAlpha() is compatible with CT3's PosAlpha().
Files:Library is hbct.
See also:PosLower(),PosUpper(),PosRange()
Back to index


PosChar

Lang:pos2.txt
Component:hbct
Doc. source:hbct\doc\en\pos2.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Replace character at a certain position within a string
Syntax:PosChar( <[@]cString>, <cCharacter|nCharacter>, [<nPosition>] ) -> cString
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:PosChar() is compatible with CT3's PosChar().
Files:Library is hbct.
See also:PosDel(),PosIns(),PosRepl(),CSetRef()
Back to index


PosDel

Lang:pos2.txt
Component:hbct
Doc. source:hbct\doc\en\pos2.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Delete characters at a certain position within a string
Syntax:PosDel( <cString>, [<nStartPosition>], <nLength> ) -> cString
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:PosDel() is compatible with CT3's PosDel().
Files:Library is hbct.
See also:PosChar(),PosIns(),PosRepl()
Back to index


PosDiff

Lang:posdiff.txt
Component:hbct
Doc. source:hbct\doc\en\posdiff.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:The left-most position there two string differ
Syntax:PosDiff( <cString1>, <cString2>, [<nIgnore>] ) -> nPosition
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:PosDiff() is compatible with CT3's PosDiff().
Files:Library is hbct.
See also:PosEqual()
Back to index


PosEqual

Lang:posdiff.txt
Component:hbct
Doc. source:hbct\doc\en\posdiff.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:The left-most position there two string begin to be equal
Syntax:PosEqual( <cString1>, <cString2>, [<nCompare>], [<nIgnore>] ) -> nPosition
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:PosEqual() is compatible with CT3's PosEqual().
Files:Library is hbct.
See also:PosDiff()
Back to index


PosIns

Lang:pos2.txt
Component:hbct
Doc. source:hbct\doc\en\pos2.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Insert characters at a certain position within a string
Syntax:PosIns( <cString>, <cInsert>, [<nPosition>] ) -> cString
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:PosIns() is compatible with CT3's PosIns().
Files:Library is hbct.
See also:POSCHAR,PosDel(),PosRepl()
Back to index


PosLower

Lang:pos1.txt
Component:hbct
Doc. source:hbct\doc\en\pos1.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Left-most position of a lowercase letter in a string
Syntax:PosLower( <cString>, [<lMode>], [<nIgnore>] ) -> nPosition
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:PosLower() is compatible with CT3's PosLower().
Files:Library is hbct.
See also:PosAlpha(),PosUpper(),PosRange()
Back to index


PosRange

Lang:pos1.txt
Component:hbct
Doc. source:hbct\doc\en\pos1.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Left-most position of a character from a set in a string
Syntax:PosRange( <cChar1>, <cChar2>, <cString>, [<lMode>], [<nIgnore>] ) -> nPosition
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:PosRange() is compatible with CT3's PosRange().
Files:Library is hbct.
See also:PosAlpha(),PosLower(),PosUpper()
Back to index


PosRepl

Lang:pos2.txt
Component:hbct
Doc. source:hbct\doc\en\pos2.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Replace characters at a certain position within a string
Syntax:PosRepl( <[@]cString>, <cReplacement>, [<nStartPosition>] ) -> cString
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:PosRepl() is compatible with CT3's PosRepl().
Files:Library is hbct.
See also:PosChar(),PosDel(),PosIns(),CSetRef()
Back to index


PosUpper

Lang:pos1.txt
Component:hbct
Doc. source:hbct\doc\en\pos1.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Left-most position of an uppercase letter in a string
Syntax:PosUpper( <cString>, [<lMode>], [<nIgnore>] ) -> nPosition
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:PosUpper() is compatible with CT3's PosUpper().
Files:Library is hbct.
See also:PosAlpha(),PosLower(),PosRange()
Back to index


RangeRem

Lang:range.txt
Component:hbct
Doc. source:hbct\doc\en\range.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Remove characters within a certain ASCII range from a string
Syntax:RangeRem( <cChar1|nChar1>, <cChar2|nChar2>, <cString> ) -> cString
Arguments:
Returns:
Description:TODO: add documentation
Examples:? RangeRem( "0", "9", "year2002.dbf" ) // "year.dbf", remove all digits ? RangeRem( "9", "0", "year2002.dbf" ) // "22", testing removal from "9" to hb_BChar( 255 ) // and from Chr( 0 ) to "0" ? RangeRem( "0", "9", "yearcurr.dbf" ) // "yearcurr.dbf", test leaving string untouched
Status:Started
Compliance:RangeRem() is compatible with CT3's RangeRem().
Files:Library is hbct.
See also:RangeRepl()
Back to index


RANGEREPL

Lang:range.txt
Component:hbct
Doc. source:hbct\doc\en\range.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Replace characters within a certain ASCII range from a string
Syntax:RangeRepl( <cChar1|nChar1>, <cChar2|nChar2>, <[@]cString>, <cReplacementChar|nReplacementChar> ) -> cString
Arguments:
Returns:
Description:TODO: add documentation
Examples:? RangeRepl( "0", "9", "year2002.dbf", "?" ) // "year????.dbf", replace all digits ? RangeRepl( "9", "0", "year2002.dbf", "?" ) // "????2??2????", testing replacement from "9" to hb_BChar( 255 ) // and from Chr( 0 ) to "0" ? RangeRepl( "0", "9", "yearcurr.dbf", "?" ) // "yearcurr.dbf", test leaving string untouched
Status:Started
Compliance:RangeRepl() is compatible with CT3's RangeRepl().
Files:Library is hbct.
See also:RangeRem()
Back to index


RemAll

Lang:remove.txt
Component:hbct
Doc. source:hbct\doc\en\remove.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Remove certain characters at the left and right of a string
Syntax:RemAll( <cString>, [<cSearch|nSearch>] ) -> cString
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:RemAll() is compatible with CT3's RemAll().
Files:Library is hbct.
See also:RemLeft(),RemRight()
Back to index


RemLeft

Lang:remove.txt
Component:hbct
Doc. source:hbct\doc\en\remove.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Remove certain characters at the left of a string
Syntax:RemLeft( <cString>, [<cSearch|nSearch>] ) -> cString
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:RemLeft() is compatible with CT3's RemLeft().
Files:Library is hbct.
See also:RemAll(),RemRight()
Back to index


RemRight

Lang:remove.txt
Component:hbct
Doc. source:hbct\doc\en\remove.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Remove certain characters at the right of a string
Syntax:RemRight( <cString>, [<cSearch|nSearch>] ) -> cString
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:RemRight() is compatible with CT3's RemRight().
Files:Library is hbct.
See also:RemAll(),RemLeft()
Back to index


ReplAll

Lang:replace.txt
Component:hbct
Doc. source:hbct\doc\en\replace.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Replace certain characters at the left and right of a string
Syntax:ReplAll( <cString>, <cReplace|nReplace>, [<cSearch|nSearch>] ) -> cString
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:ReplAll() is compatible with CT3's ReplAll().
Files:Library is hbct.
See also:ReplLeft(),ReplRight()
Back to index


ReplLeft

Lang:replace.txt
Component:hbct
Doc. source:hbct\doc\en\replace.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Replace certain characters at the left of a string
Syntax:ReplLeft( <cString>, <cReplace|nReplace>, [<cSearch|nSearch>] ) -> cString
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:ReplLeft() is compatible with CT3's ReplLeft().
Files:Library is hbct.
See also:ReplAll(),ReplRight()
Back to index


ReplRight

Lang:replace.txt
Component:hbct
Doc. source:hbct\doc\en\replace.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Replace certain characters at the right of a string
Syntax:ReplRight( <cString>, <cReplace|nReplace>, [<cSearch|nSearch>] ) -> cString
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:ReplRight() is compatible with CT3's ReplRight().
Files:Library is hbct.
See also:ReplAll(),ReplLeft()
Back to index


RestToken

Lang:token2.txt
Component:hbct
Doc. source:hbct\doc\en\token2.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Restore global token environment
Syntax:RestToken( <cStaticTokenEnvironment> ) -> cOldStaticEnvironment
Arguments:<cStaticTokenEnvironment> a binary string encoding a TE
Returns:<cOldStaticEnvironment> a string encoding the old global TE
Description:The RestToken() function restores the global TE to the one encoded in <cStaticTokenEnvironment>. This can either be the return value of SaveToken() or the value stored in the 4th parameter in a TokenInit() call.
Examples:
Status:Ready
Compliance:RestToken() is compatible with CT3's RestToken(),
Files:Library is hbct.
See also:TokenInit(),TokenExit(),TokenNext(),TokenNum(),TokenAt(),SaveToken(),TokenEnd()
Back to index


SaveToken

Lang:token2.txt
Component:hbct
Doc. source:hbct\doc\en\token2.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Save the global token environment
Syntax:SaveToken() -> cStaticTokenEnvironment
Arguments:
Returns:<cStaticTokenEnvironment> a binary string encoding the global TE
Description:The SaveToken() function can be used to store the global TE for future use or when two or more incremental tokenizers must the nested. Note however that the latter can now be solved with locally stored token environments.
Examples:
Status:Ready
Compliance:SaveToken() is compatible with CT3's SaveToken(),
Files:Library is hbct.
See also:TokenInit(),TokenExit(),TokenNext(),TokenNum(),TokenAt(),RestToken(),TokenEnd()
Back to index


SetAtLike

Lang:ctstr.txt
Component:hbct
Doc. source:hbct\doc\en\ctstr.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Determine scan behaviour in some string functions
Syntax:SETATLIKE ([<nMode>] [, <[@]cWildcard>]) --> nOldMode
Arguments:[<nMode>] CT_SETATLIKE_EXACT -> characters are compared exactly CT_SETATLIKE_WILDCARD -> characters are compared using a wildcard character The default value is CT_SETATLIKE_EXACT. [<[@]cWildcard>] determines the character that is subsequently used as a wildcard character for substring scanning. The default value is "?". NEW: If this parameter is passed by reference [@], the current wildcard character is stored in <cWildcard>.
Returns:nOldMode old (if nMode is a numeric value) or current state of the switch
Description:In the following CT3 functions, strings are compared on a character base: AtAdjust() AtNum() AfterAtNum() BEFOREAtNum() AtRepl() NumAt() StrDiff() With the SETATLIKE function, one can determine when characters are considered to match within these functions. If CT_SETATLIKE_WILDCARD is set (e.g. "?"), then "?" matches every other character. <nMode> can be one of the following values that are defined in ct.ch Definition | Value ----------------------|------ CT_SETATLIKE_EXACT | 0 CT_SETATLIKE_WILDCARD | 1
Examples:
Status:Ready
Compliance:This function is fully CT3 compatible, but allows to pass the second parameter by reference so that the current wildcard character can be determined.
Files:Header is ct.ch, library is hbct.
See also:
Back to index


StrDiff

Lang:strdiff.txt
Component:hbct
Doc. source:hbct\doc\en\strdiff.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Evaluate the "Edit (Levensthein) Distance" of two strings
Syntax:StrDiff( <cString1>, <cString2>, [<nReplacementPenalty>], [<nDeletionPenalty>], [<nInsertionPenalty>] ) -> <nDistance>
Arguments:<cString1> string at the "starting point" of the transformation process, default is "" <cString2> string at the "end point" of the transformation process, default is "" <nReplacementPenalty> penalty points for a replacement of one character, default is 3 <nDeletionPenalty> penalty points for a deletion of one character, default is 6 <nInsertionPenalty> penalty points for an insertion of one character, default is 1
Returns:<nDistance> penalty point sum of all operations needed to transform <cString1> to <cString2>
Description:The StrDiff() functions calculates the so called "Edit" or "Levensthein" distance of two strings. This distance is a measure for the number of single character replace/insert/delete operations (so called "point mutations") required to transform <cString1> into <cString2> and its value will be the smallest sum of the penalty points of the required operations. Be aware that this function is both quite time - O(Len(cString1)*Len(cString2)) - and memory consuming - O((Len(cString1)+1)*(Len(cString2)+1)*sizeof(int)) - so keep the strings as short as possible. E.g., on common 32 bit systems (sizeof(int) == 4), calling StrDiff() with two strings of 1024 bytes in length will consume 4 MB of memory. To not impose unneeded restrictions, the function will only check if (Len(cString1)+1)*(Len(cString2)+1)*sizeof(int) <= UINT_MAX, although allocing UINT_MAX bytes will not work on most systems. If this simple check fails, -1 is returned. Also, be aware that there can be an overflow when the penalty points are summed up: Assuming that the number of transformation operations is in the order of Max(Len(cString1),Len(cString2)), the penalty point sum, that is internally stored in an "int" variable, is in the order of (Max(Len(cString1),Len(cString2))*Max(nReplacementPenalty,nDeletionPenalty,nInsertionPentaly). The StrDiff() does not do an overflow check due to time performance reasons. Future versions of StrDiff() could use a type different to "int" to store the penalty point sum to save memory or to avoid overflows. The function is aware of the settings done by SetAtLike(), that means that the wildchar character is considered equal to ALL characters.
Examples:? StrDiff( "ABC", "ADC" ) // 3, one character replaced ? StrDiff( "ABC", "AEC" ) // 3, dito ? StrDiff( "CBA", "ABC" ) // 6, two characters replaced ? StrDiff( "ABC", "AXBC" ) // 1, one character inserted ? StrDiff( "AXBC", "ABC" ) // 6, one character removed ? StrDiff( "AXBC", "ADC" ) // 9, one character removed and one replaced
Status:Ready
Compliance:StrDiff() is compatible with CT3's StrDiff().
Files:Library is hbct.
See also:SetAtLike()
Back to index


StrSwap

Lang:strswap.txt
Component:hbct
Doc. source:hbct\doc\en\strswap.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Swap the contents of two strings
Syntax:StrSwap( <[@]cString1>, <[@]cString2> ) -> cString
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:StrSwap() is compatible with CT3's StrSwap().
Files:Library is hbct.
See also:
Back to index


TabExpand

Lang:tab.txt
Component:hbct
Doc. source:hbct\doc\en\tab.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Replace tabulator control characters with fill characters
Syntax:TABEXPAND (<cString>, [<nTabWidth>], [<cFillChar|nFillChar>], [<cNewLineCharacters>], [<cTabChar|nTabChar>], [<lIgnore141>]) -> cExpandedString
Arguments:<cString> <nTabWidth> <cFillChar|nFillChar> <cNewLineCharacters> string indicating new line, default is the string returned by hb_eol() <cTabChar|nTabChar> character indicating a tab stop, default is Chr( 9 ) <lIgnore141> .T., if the soft-CR used by MemoEdit() should be ignored as a newline indicator, default is .F. (functions uses hb_BChar( 141 ))
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:TabExpand() is compatible with CT3's TabExpand(), but there are three new parameters for a better fine control of the function's behaviour.
Files:Library is hbct.
See also:TabPack()
Back to index


TabPack

Lang:tab.txt
Component:hbct
Doc. source:hbct\doc\en\tab.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Pack fill characters to appropriate tab characters
Syntax:TabPack( <cString>, [<nTabWidth>], [<cFillChar|nFillChar>], [<cNewLineCharacters>], [<cTabChar|nTabChar>], [<lIgnore141>] ) -> cPackedString
Arguments:<cString> <nTabWidth> <cFillChar|nFillChar> <cNewLineCharacters> string indicating new line, default is the string returned by hb_eol() <cTabChar|nTabChar> character indicating a tab stop, default is Chr( 9 ) <lIgnore141> .T., if the soft-CR used by MemoEdit() should be ignored as a newline indicator, default is .F. (functions uses hb_BChar( 141 ))
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:TabPack() is compatible with CT3's TabPack(), but there are three new parameters for a better fine control of the function's behaviour.
Files:Library is hbct.
See also:TabExpand()
Back to index


Token

Lang:token1.txt
Component:hbct
Doc. source:hbct\doc\en\token1.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Tokens of a string
Syntax:Token( <cString>, [<cTokenizer>], [<nTokenCount], [<nSkipWidth>], [<@cPreTokenSep>], [<@cPostTokenSep>] ) -> cToken
Arguments:<cString> is the processed string [<cTokenizer>] is a list of characters separating the tokens in <cString> Default: Chr( 0 ) + Chr( 9 ) + Chr( 10 ) + Chr( 13 ) + Chr( 26 ) + hb_BChar( 138 ) + hb_BChar( 141 ) + Chr( 32 ) + ",.;:!\?/\\<>()#&%+-*" [<nTokenCount>] specifies the count of the token that should be extracted Default: last token [<nSkipWidth>] specifies the maximum number of successive tokenizing characters that are combined as ONE token stop, e.g. specifying 1 can yield to empty token Default: 0, any number of successive tokenizing characters are combined as ONE token stop [<@cPreTokenSep>] If given by reference, the tokenizer before the actual token will be stored [<@cPostTokenSep>] If given by reference, the tokenizer after the actual token will be stored
Returns:<cToken> the token specified by the parameters given above
Description:The Token() function extracts the <nTokenCount>th token from the string <cString>. In the course of this, the tokens in the string are separated by the character(s) specified in <cTokenizer>. The function may also extract empty tokens, if you specify a skip width other than zero. Be aware of the new 5th and 6th parameter there the Token() function stores the tokenizing character before and after the extracted token. Therefore, additional calls to the TokenSep() function are not necessary.
Examples:? Token( "Hello, World!" ) --> "World" ? Token( "Hello, World!",, 2, 1 ) --> "" ? Token( "Hello, World!", ",", 2, 1 ) --> " World!" ? Token( "Hello, World!", " ", 2, 1 ) --> "World!"
Status:Ready
Compliance:Token() is compatible with CT3's TOKEN, but two additional parameters have been added there the Token() function can store the tokenizers before and after the current token.
Files:Library is hbct.
See also:NumToken(),AtToken(),TokenLower(),TokenUpper(),TokenSep()
Back to index


TokenAt

Lang:token2.txt
Component:hbct
Doc. source:hbct\doc\en\token2.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Get start and end positions of tokens in a token environment
Syntax:TokenAt( [<lSeparatorPositionBehindToken>], [<nToken>], [<@cTokenEnvironment>] ) -> nPosition
Arguments:<lSeparatorPositionBehindToken> .T., if TokenAt() should return the position of the separator character BEHIND the token. Default: .F., return start position of a token. <nToken> a token number <@cTokenEnvironment> a token environment
Returns:<nPosition>
Description:The TokenAt() function is used to retrieve the start and end position of the tokens in a token environment. Note however that the position of last character of a token is given by tokenat (.T.)-1 !! If the 2nd parameter, <nToken> is given, TokenAt() returns the positions of the <nToken>th token. Otherwise the token pointed to by the TE counter, i.e. the token that will be retrieved by TokenNext() _NEXT_ is used. If the parameter <@cTokenEnvironment> is supplied (must be by reference), the information from this token environment is used, otherwise the global TE is used.
Examples:TokenInit( cString ) // initialize a TE DO WHILE ! TokenEnd() ? "From", TokenAt(), "to", TokenAt( .T. ) - 1 ? TokenNext( cString ) // get all tokens successivly ENDDO ? TokenNext( cString, 3 ) // get the 3rd token, counter will remain the same TokenExit() // free the memory used for the global TE
Status:Ready
Compliance:TokenAt() is compatible with CT3's TokenAt(), but there are two additional parameters featuring local token environments and optional access to tokens.
Files:Library is hbct.
See also:TokenInit(),TokenExit(),TokenNext(),TokenNum(),SaveToken(),RestToken(),TokenEnd()
Back to index


TokenEnd

Lang:token2.txt
Component:hbct
Doc. source:hbct\doc\en\token2.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Check whether additional tokens are available with TokenNext()
Syntax:TokenEnd( [<@cTokenEnvironment>] ) -> lTokenEnd
Arguments:<@cTokenEnvironment> a token environment
Returns:<lTokenEnd> .T., if additional tokens are available
Description:The TokenEnd() function can be used to check whether the next call to TokenNext() would return a new token. This can not be decided with TokenNext() alone, since an empty token cannot be distinguished from a "no more" tokens. If the parameter <@cTokenEnvironment> is supplied (must be by reference), the information from this token environment is used, otherwise the global TE is used. With a combination of TokenEnd() and TokenNext(), all tokens from a string can be retrieved successivly (see example).
Examples:TokenInit( "a.b.c.d", ".", 1 ) // initialize global TE DO WHILE ! TokenEnd() ? TokenNext( "a.b.c.d" ) // get all tokens successivly ENDDO
Status:Ready
Compliance:TokenEnd() is compatible with CT3's TokenEnd(), but there are is an additional parameter featuring local token environments.
Files:Library is hbct.
See also:TokenInit(),TokenExit(),TokenNext(),TokenNum(),TokenAt(),SaveToken(),RestToken()
Back to index


TokenExit

Lang:token2.txt
Component:hbct
Doc. source:hbct\doc\en\token2.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Release global token environment
Syntax:TokenExit() -> lStaticEnvironmentReleased
Arguments:
Returns:<lStaticEnvironmentReleased> .T., if global token environment is successfully released
Description:The TokenExit() function releases the memory associated with the global token environment. One should use it for every TokenInit() using the global TE. Additionally, TokenExit() is implicitly called from ctexit() to free the memory at library shutdown.
Examples:TokenInit( cString ) // initialize a TE DO WHILE ! TokenEnd() ? TokenNext( cString ) // get all tokens successivly ENDDO ? TokenNext( cString, 3 ) // get the 3rd token, counter will remain the same TokenExit() // free the memory used for the global TE
Status:Ready
Compliance:TokenExit() is a new function in Harbour's CT3 library.
Files:Library is hbct.
See also:TokenInit(),TokenNext(),TokenNum(),TokenAt(),SaveToken(),RestToken(),TokenEnd()
Back to index


TokenInit

Lang:token2.txt
Component:hbct
Doc. source:hbct\doc\en\token2.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Initializes a token environment
Syntax:TokenInit( <[@]cString>], [<cTokenizer>], [<nSkipWidth>], [<@cTokenEnvironment>] ) -> lState
Arguments:<[@]cString> is the processed string <cTokenizer> is a list of characters separating the tokens in <cString> Default: Chr( 0 ) + Chr( 9 ) + Chr( 10 ) + Chr( 13 ) + Chr( 26 ) + hb_BChar( 138 ) + hb_BChar( 141 ) + Chr( 32 ) + ",.;:!\?/\\<>()#&%+-*" <nSkipWidth> specifies the maximum number of successive tokenizing characters that are combined as ONE token stop, e.g. specifying 1 can yield to empty token Default: 0, any number of successive tokenizing characters are combined as ONE token stop <@cTokenEnvironment> is a token environment stored in a binary encoded string
Returns:<lState> success of the initialization
Description:The TokenInit() function initializes a token environment. A token environment is the information about how a string is to be tokenized. This information is created in the process of tokenization of the string <cString> - equal to the one used in the Token() function with the help of the <cTokenizer> and <nSkipWidth> parameters. This token environment can be very useful when large strings have to be tokenized since the tokenization has to take place only once whereas the Token() function must always start the tokenizing process from scratch. Unlike CT3, this function provides two mechanisms of storing the resulting token environment. If a variable is passed by reference as 4th parameter, the token environment is stored in this variable, otherwise the global token environment is used. Do not modify the token environment string directly ! Additionally, a counter is stored in the token environment, so that the tokens can successivly be obtained. This counter is first set to 1. When the TokenInit() function is called without a string a tokenize, the counter of either the global environment or the environment given by reference in the 4th parameter is rewind to 1. Additionally, unlike CT3, TokenInit() does not need the string <cString> to be passed by reference, since one must provide the string in calls to TokenNext() again.
Examples:TokenInit( cString ) // tokenize the string <cString> with default // rules and store the token environment globally // and eventually delete an old global TE TokenInit( @cString ) // no difference in result, but eventually faster, // since the string must not be copied TokenInit() // rewind counter of global TE to 1 TokenInit( "1,2,3", "," , 1 ) // tokenize constant string, store in global TE TokenInit( cString, , 1, @cTE1 ) // tokenize cString and store TE in // cTE1 only without overriding global TE TokenInit( cString, , 1, cTE1 ) // tokenize cString and store TE in // GLOBAL TE since 4th parameter is // not given by reference !!! TokenInit( ,,, @cTE1 ) // set counter in TE stored in cTE1 to 1
Status:Ready
Compliance:TokenInit() is compatible with CT3's TokenInit(), but there is an additional parameter featuring local token environments.
Files:Library is hbct.
See also:Token(),TokenExit(),TokenNext(),TokenNum(),TokenAt(),SaveToken(),RestToken(),TokenEnd()
Back to index


TokenLower

Lang:token1.txt
Component:hbct
Doc. source:hbct\doc\en\token1.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Change the first letter of tokens to lower case
Syntax:TokenLower( <[@]cString>, [<cTokenizer>], [<nTokenCount>], [<nSkipWidth>] ) -> cString
Arguments:<[@]cString> is the processed string [<cTokenizer>] is a list of characters separating the tokens in <cString> Default: Chr( 0 ) + Chr( 9 ) + Chr( 10 ) + Chr( 13 ) + Chr( 26 ) + hb_BChar( 138 ) + hb_BChar( 141 ) + Chr( 32 ) + ",.;:!\?/\\<>()#&%+-*" [<nTokenCount>] specifies the number of tokens that should be processed Default: all tokens [<nSkipWidth>] specifies the maximum number of successive tokenizing characters that are combined as ONE token stop, e.g. specifying 1 can yield to empty token Default: 0, any number of successive tokenizing characters are combined as ONE token stop
Returns:<cString> the string with the lowercased tokens
Description:The TokenLower() function changes the first letter of tokens in <cString> to lower case. To do this, it uses the same tokenizing mechanism as the Token() function. If TokenLower() extracts a token that starts with a letter, this letter will be changed to lower case. You can omit the return value of this function by setting the CSetRef() switch to .T., but you must then pass <cString> by reference to get the result.
Examples:? TokenLower( "Hello, World, here I am!" ) // "hello, world, here i am!" ? TokenLower( "Hello, World, here I am!",, 3 ) // "hello, world, here I am!" ? TokenLower( "Hello, World, here I am!", ",", 3 ) // "hello, World, here I am!" ? TokenLower( "Hello, World, here I am!", " W" ) // "hello, World, here i am!"
Status:Ready
Compliance:TokenLower() is compatible with CT3's TokenLower(), but a new 4th parameter, <nSkipWidth> has been added for synchronization with the the other token functions.
Files:Library is hbct.
See also:Token(),NumToken(),AtToken(),TokenUpper(),TokenSep(),CSetRef()
Back to index


TokenNext

Lang:token2.txt
Component:hbct
Doc. source:hbct\doc\en\token2.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Successivly obtains tokens from a string
Syntax:TokenNext( <[@]cString>, [<nToken>], [<@cTokenEnvironment>] ) -> cToken
Arguments:<[@]cString> the processed string <nToken> a token number <@cTokenEnvironment> a token environment
Returns:<cToken> a token from <cString>
Description:With TokenNext(), the tokens determined with the TokenInit() functions can be retrieved. To do this, TokenNext() uses the information stored in either the global token environment or the local one supplied by <cTokenEnvironment>. Note that, is supplied, this 3rd parameter has always to be passed by reference. If the 2nd parameter, <nToken> is given, TokenNext() simply returns the <nToken>th token without manipulating the TE counter. Otherwise the token pointed to by the TE counter is returned and the counter is incremented by one. Like this, a simple loop with TokenEnd() can be used to retrieve all tokens of a string successivly. Note that <cString> does not have to be the same used in TokenInit(), so that one can do a "correlational tokenization", i.e. tokenize a string as if it was another! E.G. using TokenInit() with the string "AA,BBB" but calling TokenNext() with "CCCEE" would give first "CC" and then "EE" (because "CCCEE" is not long enough).
Examples:// default behavhiour TokenInit( cString ) // initialize a TE DO WHILE ! TokenEnd() ? TokenNext( cString ) // get all tokens successivly ENDDO ? TokenNext( cString, 3 ) // get the 3rd token, counter will remain the same TokenExit() // free the memory used for the global TE
Status:Ready
Compliance:TokenNext() is compatible with CT3's TokenNext(), but there are two additional parameters featuring local token environments and optional access to tokens.
Files:Library is hbct.
See also:TokenInit(),TokenExit(),TokenNum(),TokenAt(),SaveToken(),RestToken(),TokenEnd()
Back to index


TokenNum

Lang:token2.txt
Component:hbct
Doc. source:hbct\doc\en\token2.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Get the total number of tokens in a token environment
Syntax:TokenNum( [<@cTokenEnvironment>] ) -> nNumberofTokens
Arguments:<@cTokenEnvironment> a token environment
Returns:<nNumberofTokens> number of tokens in the token environment
Description:The TokenNum() function can be used to retrieve the total number of tokens in a token environment. If the parameter <@cTokenEnvironment> is supplied (must be by reference), the information from this token environment is used, otherwise the global TE is used.
Examples:TokenInit( "a.b.c.d", ".", 1 ) // initialize global TE ? TokenNum() // --> 4
Status:Ready
Compliance:TokenNum() is a new function in Harbour's CT3 library.
Files:Library is hbct.
See also:TokenInit(),TokenExit(),TokenNext(),TokenAt(),SaveToken(),RestToken(),TokenEnd()
Back to index


TokenSep

Lang:token1.txt
Component:hbct
Doc. source:hbct\doc\en\token1.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Retrieves the token separators of the last Token() call
Syntax:TokenSep( [<lMode>] ) -> cSeparator
Arguments:[<lMode>] if set to .T., the token separator BEHIND the token retrieved from the Token() call will be returned. Default: .F., returns the separator BEFORE the token
Returns:Depending on the setting of <lMode>, the separating character of the the token retrieved from the last Token() call will be returned. These separating characters can now also be retrieved with the Token() function.
Description:When one does extract tokens from a string with the Token() function, one might be interested in the separator characters that have been used to extract a specific token. To get this information you can either use the TokenSep() function after each Token() call, or use the new 5th and 6th parameter of the Token() function.
Examples:see Token() function
Status:Ready
Compliance:TokenSep() is compatible with CT3's TokenSep().
Files:Library is hbct.
See also:Token(),NumToken(),AtToken(),TokenLower(),TokenUpper()
Back to index


TokenUpper

Lang:token1.txt
Component:hbct
Doc. source:hbct\doc\en\token1.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Change the first letter of tokens to upper case
Syntax:TokenUpper( <[@]cString>, [<cTokenizer>], [<nTokenCount>], [<nSkipWidth>] ) -> cString
Arguments:<[@]cString> is the processed string [<cTokenizer>] is a list of characters separating the tokens in <cString> Default: Chr( 0 ) + Chr( 9 ) + Chr( 10 ) + Chr( 13 ) + Chr( 26 ) + hb_BChar( 138 ) + hb_BChar( 141 ) + Chr( 32 ) + ",.;:!\?/\\<>()#&%+-*" [<nTokenCount>] specifies the number of tokens that should be processed Default: all tokens [<nSkipWidth>] specifies the maximum number of successive tokenizing characters that are combined as ONE token stop, e.g. specifying 1 can yield to empty token Default: 0, any number of successive tokenizing characters are combined as ONE token stop
Returns:<cString> the string with the uppercased tokens
Description:The TokenUpper() function changes the first letter of tokens in <cString> to upper case. To do this, it uses the same tokenizing mechanism as the Token() function. If TokenUpper() extracts a token that starts with a letter, this letter will be changed to upper case. You can omit the return value of this function by setting the CSetRef() switch to .T., but you must then pass <cString> by reference to get the result.
Examples:? TokenUpper( "Hello, world, here I am!" ) // "Hello, World, Here I Am!" ? TokenUpper( "Hello, world, here I am!",, 3 ) // "Hello, World, Here I am!" ? TokenUpper( "Hello, world, here I am!", ",", 3 ) // "Hello, world, here I am!" ? TokenUpper( "Hello, world, here I am!", " w" ) // "Hello, wOrld, Here I Am!"
Status:Ready
Compliance:TokenUpper() is compatible with CT3's TokenUpper(), but a new 4th parameter, <nSkipWidth> has been added for synchronization with the the other token functions.
Files:Library is hbct.
See also:Token(),NumToken(),AtToken(),TokenLower(),TokenSep(),CSetRef()
Back to index


ValPos

Lang:ascpos.txt
Component:hbct
Doc. source:hbct\doc\en\ascpos.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Numerical value of a character at a certain position
Syntax:ValPos( <cString>, [<nPosition>] ) --> nDigitValue
Arguments:<cString> is the processed string [<nPosition>] is an optional position within <cString> Default: last position in <cString>
Returns:<nDigitValue> the numerical value of the character at the specified position
Description:The ValPos() function returns the numerical value of the character that can be found at the position <nPosition> in <cString>. If no digit can be found at this position or if <nPosition> is larger than the length of <cString>, 0 is returned.
Examples:? ValPos( "1234x56789" ) // --> 9 ? ValPos( "1234x56789", 1 ) // --> 1
Status:Ready
Compliance:ValPos() is compatible with CT3's ValPos().
Files:Library is hbct.
See also:AscPos()
Back to index


WordOne

Lang:charone.txt
Component:hbct
Doc. source:hbct\doc\en\charone.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Reduce multiple occurences of a double character to one
Syntax:WordOne( [<cDoubleCharactersToReduce>,] <cString> ) -> cReducedString
Arguments:[<cDoubleCharactersToReduce>] specifies the double characters the multiple occurences of which should be reduced to one Default: All characters. <cString> specifies the processed string
Returns:<cReducedString> the string with the reduced occurences
Description:The WordOne() function reduces multiple occurences of double characters in <cString> to a single one. It is important to note that the multiple occurences must occur directly one behind the other.
Examples:? WordOne( "12ABAB12" ) // "12AB12" ? WordOne( "1AAAA2" ) // "1AAAA2" ? WordOne( "12", "1212ABAB" ) // "12ABAB"
Status:Ready
Compliance:WordOne() is compatible with CT3's WordOne().
Files:Library is hbct.
See also:CharOne() CharRem()
Back to index


WordOnly

Lang:charonly.txt
Component:hbct
Doc. source:hbct\doc\en\charonly.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Intersectional set of two strings based on double characters
Syntax:WordOnly( <cThisDoubleCharactersOnly>, <cString> ) -> cReducedString
Arguments:<cThisDoubleCharactersOnly> specifies the double characters that must not be deleted in <cString>. <cString> is the string that should be processed
Returns:<cReducedString> A string with all double characters deleted but those specified in <cThisCharactersOnly>.
Description:The WordOnly() function calculates the intersectional set of two strings based on double characters. To do this, it deletes all double characters from <cString> that do not appear in <cThisDoubleCharacterOnly>.
Examples:? WordOnly( "AABBCCDD", "XXAAYYBBZZ" ) // "AABB" ? WordOnly( "AABBCCDD", "XAAYYYBBZZ" ) // "BB"
Status:Ready
Compliance:WordOnly() is compatible with CT3's WordOnly().
Files:Library is hbct.
See also:CharOnly() CharRem() WordRem()
Back to index


WordRem

Lang:charonly.txt
Component:hbct
Doc. source:hbct\doc\en\charonly.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Removes characters from a string
Syntax:WordRem( <cDeleteThisDoubleCharacters>, <cString> ) -> cReducedString
Arguments:<cDeleteThisDoubleCharacters> specifies the double characters that should be deleted in <cString> <cString>) is the string that should be processed
Returns:<cReducedString> is a string where the double characters specified in <cDeleteThisDoubleCharacters> are deleted
Description:The WordRem() function deletes the double characters specified in <cDeleteThisDoubleCharacters> from <cString>.
Examples:? WordRem( "abcd", "0ab1cd" ) // "0ab1" ? WordRem( "abcd", "ab0cd1" ) // "0cd1"
Status:Ready
Compliance:WordRem() is a new function available only in Harbour's CT3.
Files:Library is hbct.
See also:CharOnly() CharRem() WordRem()
Back to index


WordRepl

Lang:wordrepl.txt
Component:hbct
Doc. source:hbct\doc\en\wordrepl.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Replacement of double characters
Syntax:WordRepl( <cDoubleCharacterSearchString>, <[@]cString>, <cDoubleCharacterReplaceString>, [<lMode>] ) -> cString
Arguments:<cDoubleCharacterSearchString> is a string of double characters that should be replaced <[@]cString> is the processed string <cDoubleCharacterReplaceString> is a string of double characters that replace the one of <cSearchString> [<lMode>] sets the replacement method (see description) Default: .F.
Returns:cString the processed string
Description:The WordRepl() takes the double characters of <cDoubleCharacterSearchString> one after the other and searches for them in <cString>. For <lMode> set to .F., this search is successful, if the double character sequence in <cString> starts at an odd position or at any position, if <lMode> is set to .T. If this happens, the double character sequence will be replaced with the corresponding double character sequence of <cDoubleCharacterReplaceString>. If <cDoubleCharacterReplaceString> is shorter than <cDoubleCharacterSearchString> the last double sequence of <cDoubleCharacterReplaceString> is used for the "rest" of <cDoubleCharacterSearchString>. Note that the last double character sequence in "AABBC" is "BB" in this context !! After the replacement the function restarts the search in <cString> BEHIND the replacement if the CSetAtMupa() switch is turned off, or BEHIND the first character of the replacement if the switch is turned on. (see examples for this !) One can omit the return value of this function by setting the CSetRef() to .T., but one must then pass <cString> by reference to get a result.
Examples:? WordRepl( "CC", "AABBCCDDEE", "XX" ) // "AABBXXDDEE" ? WordRepl( "aa", "1aaaa", "ba" ) // "1abaa" ? WordRepl( "aa", "1aaaa", "ba", .T. ) // "1baba" CSetAtMupa( .T. ) ? WordRepl( "aa", "1aaaa", "ba" ) // "1abaa" ? WordRepl( "aa", "1aaaa", "ba", .T. ) // "1bbba"
Status:Ready
Compliance:WordRepl() is compatible with CT3's WordRepl().
Files:Library is hbct.
See also:CharRepl(),RangeRepl(),PosRepl(),CSetRef(),CSetAtMupa()
Back to index


WordSwap

Lang:charswap.txt
Component:hbct
Doc. source:hbct\doc\en\charswap.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Swap neighbouring double characters in a string
Syntax:WordSwap( <[@]cString> [, <lSwapCharacters>] ) -> cSwappedString
Arguments:<[@]cString> is the string that should be processed [<lSwapCharacters>] specifies whether an additional swap should be done within the double characters Default: .F., no additional swap
Returns:<cSwappedString> a string where neighbouring double characters are swapped
Description:The WordSwap() function loops through <cString> in steps of four characters and exchanges the double characters from the first and second position with the one from the third and forth position. Additionally the function can perform a swap of the both char of each double character. By setting the CSetRef() switch to .T., one can omit the return value of this functin, but one must then pass <cString> by reference.
Examples:? WordSwap( "1234567890" ) // "3412785690" ? WordSwap( "1234567890", .T. ) // "4321876590"
Status:Ready
Compliance:WordSwap() is compatible with CT3's WordSwap().
Files:Library is hbct.
See also:CharSwap(),CSetRef()
Back to index


WordToChar

Lang:wordtoch.txt
Component:hbct
Doc. source:hbct\doc\en\wordtoch.txt
Template:
Category:CT3 string functions
Subcategory:
Oneliner:Replace double with single characters
Syntax:WordToChar( <cDoubleCharacterSearchString>, <cString>, <cSingleCharacterReplaceString> ) -> cString
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:WordToChar() is compatible with CT3's WordToChar().
Files:Library is hbct.
See also:CSetAtMupa(),CharRepl(),WordRepl()
Back to index


KSetCaps

Lang:keyset.txt
Component:hbct
Doc. source:hbct\doc\en\keyset.txt
Template:
Category:CT3 switch and state functions
Subcategory:
Oneliner:
Syntax:KSetCaps( [<lNewSwitch>] ) -> lOldSwitch
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:
Files:Library is hbct.
See also:
Back to index


KSetIns

Lang:keyset.txt
Component:hbct
Doc. source:hbct\doc\en\keyset.txt
Template:
Category:CT3 switch and state functions
Subcategory:
Oneliner:
Syntax:KSetIns( [<lNewSwitch>] ) -> lOldSwitch
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:
Files:Library is hbct.
See also:
Back to index


KSetNum

Lang:keyset.txt
Component:hbct
Doc. source:hbct\doc\en\keyset.txt
Template:
Category:CT3 switch and state functions
Subcategory:
Oneliner:
Syntax:KSetNum( [<lNewSwitch>] ) -> lOldSwitch
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:
Files:Library is hbct.
See also:
Back to index


KSetScroll

Lang:keyset.txt
Component:hbct
Doc. source:hbct\doc\en\keyset.txt
Template:
Category:CT3 switch and state functions
Subcategory:
Oneliner:
Syntax:KSetScroll( [<lNewSwitch>] ) -> lOldSwitch
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:
Files:Library is hbct.
See also:
Back to index


CharWin

Lang:screen1.txt
Component:hbct
Doc. source:hbct\doc\en\screen1.txt
Template:
Category:CT3 video functions
Subcategory:
Oneliner:
Syntax:CharWin( <nTop>, <nLeft>, <nBottom>, <nRight>, [<cNewChar|nNewChar>], [<cOldChar|nOldChar>] ) --> <cEmptyString>
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() <cNewChar|nNewChar> - new character for the screen area, as a numeric value in the range of 0 to 255 or as a character string, default value is the CLEARB. <cOldChar|nOldChar> - character to exchange. Specify the parameter as a numeric in the range of 0 to 255 or as a character string. The default is to exchange all characters.
Returns:Returns an empty string.
Description:Exchanges particular characters in a screen area. TODO: add documentation
Examples:
Status:Started
Compliance:
Files:Library is hbct.
See also:
Back to index


ColorRepl

Lang:screen1.txt
Component:hbct
Doc. source:hbct\doc\en\screen1.txt
Template:
Category:CT3 video functions
Subcategory:
Oneliner:
Syntax:ColorRepl( [<cNewAttr|nNewAttr>], [<cOldAttr|nOldAttr>] ) --> cNull
Arguments:<cNewAttr|nNewAttr> Designates the new attribute. The default is CLEARA. <cOldAttr|InOldAttr> Designates the old attribute to exchange. The default is all existing attributes.
Returns:Returns an empty string.
Description:Exchanges particular screen attributes TODO: add documentation
Examples:
Status:Started
Compliance:
Files:Library is hbct.
See also:
Back to index


ColorToN

Lang:color.txt
Component:hbct
Doc. source:hbct\doc\en\color.txt
Template:
Category:CT3 video functions
Subcategory:
Oneliner:
Syntax:ColorToN( <cAttr> ) -> <nAttr>
Arguments:<cAttr> Designates the alphanumeric color attribute that is converted in NN/NN or CC/CC form.
Returns:ColorToN() returns a number that corresponds to the combined numeric color attribute.
Description:COLOR TO (N)umeric The function changes an alphanumeric color attribute from NN/NN or CC/CC into a combined numeric attribute. These combined attribute values are useful with the CA-Cl*pper Tools functions StrScreen(), ScreenMix(), ScreenAttr(), and the CA-Cl*pper commands SAVE/RESTORE SCREEN. TODO: add documentation
Examples:
Status:Started
Compliance:
Files:Library is hbct.
See also:
Back to index


ColorWin

Lang:screen1.txt
Component:hbct
Doc. source:hbct\doc\en\screen1.txt
Template:
Category:CT3 video functions
Subcategory:
Oneliner:
Syntax:ColorWin( [<nTopLine>], [<nLeftCol>], [<nBottomLine>], [<nRightCol>], [<cNewAttr|nNewAttr>], [<cOldAttr|nOldAttr>] ) --> cNull
Arguments:<nTopLine> Designates the topmost line to begin processing. The default is the cursor line. <nLeftCol> Designates the leftmost column to begin processing. The default is the cursor column. <nBottomLine> Designates the bottommost line that is processed. The default is the last screen line or window line. <nRightCol> Designates the rightmost column to clear. The default is the right screen border or window border. <cNewAttr|nNewAttr> Designates the new attribute to replace the old one. The default is the standard attribute CLEARA. <cOldAttr|nOldAttr> Designates the old character to exchange. The default is "exchange all attributes".
Returns:Returns an empty string.
Description:Exchanges particular attributes in a screen area TODO: add documentation
Examples:
Status:Started
Compliance:
Files:Library is hbct.
See also:
Back to index


Enhanced

Lang:color.txt
Component:hbct
Doc. source:hbct\doc\en\color.txt
Template:
Category:CT3 video functions
Subcategory:
Oneliner:Select the "ENHANCED" color value for output
Syntax:Enhanced() -> <cEmptyString>
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:Enhanced() is compatible with CT3's Enhanced()
Files:Library is hbct.
See also:Standard(),Unselected()
Back to index


InvertAttr

Lang:color.txt
Component:hbct
Doc. source:hbct\doc\en\color.txt
Template:
Category:CT3 video functions
Subcategory:
Oneliner:
Syntax:
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:InvertAttr() is compatible with CT3's InvertAttr().
Files:Library is hbct.
See also:
Back to index


InvertWin

Lang:screen1.txt
Component:hbct
Doc. source:hbct\doc\en\screen1.txt
Template:
Category:CT3 video functions
Subcategory:
Oneliner:
Syntax:
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:InvertWin() is compatible with CT3's InvertWin().
Files:Library is hbct.
See also:
Back to index


SayScreen

Lang:screen1.txt
Component:hbct
Doc. source:hbct\doc\en\screen1.txt
Template:
Category:CT3 video functions
Subcategory:
Oneliner:
Syntax:SayScreen( <cString>, [<nRow>], [<nCol>] ) -> <cEmptyString>
Arguments:<cString> - the string to output. Although undocumented, can be NIL. <nRow> - row number, defaults to cursor row. <nCol> - column number, defaults to cursor column.
Returns:Returns an empty string.
Description:Outputs a string at specified coordinates without changing character attributes.
Examples:
Status:Ready
Compliance:
Files:Library is hbct.
See also:ScreenMix()
Back to index


ScreenAttr

Lang:screen1.txt
Component:hbct
Doc. source:hbct\doc\en\screen1.txt
Template:
Category:CT3 video functions
Subcategory:
Oneliner:
Syntax:ScreenAttr( [<nRow>],[<nColumn>] ) -> <nAttr>
Arguments:<nRow> Designates the line from which to determine the attribute. The default is the cursor line. <nColumn> Designates the column from which to determine the attribute. The default is the cursor column.
Returns:ScreenAttr() returns the attribute at the designated position.
Description:ScreenAttr() returns the current screen attribute at <nRow> and <nColumn>. You can query targeted attributes this way and save them to use later, or process them later with InvertAttr(). TODO: add documentation
Examples:
Status:Started
Compliance:
Files:Library is hbct.
See also:
Back to index


ScreenMix

Lang:screen1.txt
Component:hbct
Doc. source:hbct\doc\en\screen1.txt
Template:
Category:CT3 video functions
Subcategory:
Oneliner:
Syntax:ScreenMix( <cCharString>, <cAttributeString>, [<nRow>], [<nCol>] ) -> <cEmptyString>
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:
Files:Library is hbct.
See also:
Back to index


Standard

Lang:color.txt
Component:hbct
Doc. source:hbct\doc\en\color.txt
Template:
Category:CT3 video functions
Subcategory:
Oneliner:Select the "STANDARD" color value for output
Syntax:Standard() -> <cEmptyString>
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:Standard() is compatible with CT3's Standard()
Files:Library is hbct.
See also:Enhanced(),Unselected()
Back to index


Unselected

Lang:color.txt
Component:hbct
Doc. source:hbct\doc\en\color.txt
Template:
Category:CT3 video functions
Subcategory:
Oneliner:Select the "UNSELECTED" color value for output
Syntax:Unselected() -> <cEmptyString>
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:Unselected() is compatible with CT3's Unselected()
Files:Library is hbct.
See also:Enhanced(),Standard()
Back to index


UnTextWin

Lang:screen1.txt
Component:hbct
Doc. source:hbct\doc\en\screen1.txt
Template:
Category:CT3 video functions
Subcategory:
Oneliner:
Syntax:UnTextWin( <nTopLine>, <nLeftColumn>, <nBottomLine>, <nRightColumn>, <cReplacementCharacter|nReplacementCharacter>, [<cInitialCharacter|nInitialCharacter>], [<cEndCharacter|nEndCharacter>] ) --> cNull
Arguments:<nTopLine> Designates the line for the upper-left corner of the area. <nLeftColumn> Designates the column for the upper-left corner of the area. <nBottomLine> Designates the line for the bottom-right corner of the area. <nRightColumn> Designates the line for the bottom-right column of the area. <cReplacementCharacter|nReplacementCharacter> Replaces each character within the window, with the exception of those within the range of <cInitialCharacter|nInitialCharacter> and <cEndCharacter|nEndCharacter>. <cInitialCharacter|nInitialCharacter> Designates the beginning of the bracketed area. The character can be number in the range of 0 to 255, or the character string type. The default value is 176. <cEndCharacter|nEndCharacter> Designates the end of the bracketed area. The character can be number in the range of 0 to 255 or the character string type. The default value is 223.
Returns:Returns a null string.
Description:Replaces an area of characters from a region of the screen TODO: add documentation
Examples:
Status:Started
Compliance:
Files:Library is hbct.
See also:
Back to index


ADays

Lang:dates2.txt
Component:hbmisc
Doc. source:hbmisc\doc\en\dates2.txt
Template:
Category:Date
Subcategory:
Oneliner:Returns an array with the days names.
Syntax:ADays() --> aDays
Arguments:None
Returns:<aDays> The array which holds the days names.
Description:This function returns an array with all the days names in the selected current language.
Examples:aDays := ADays() ? aDays[ 1 ] // -> Sunday ? aDays[ 1 ] // -> Domingo (if the selected language is Spanish)
Status:R
Compliance:This function is new in Harbour.
Files:Library is hbmisc
See also:ADays()
Back to index


AMonths

Lang:dates2.txt
Component:hbmisc
Doc. source:hbmisc\doc\en\dates2.txt
Template:
Category:Date
Subcategory:
Oneliner:Returns an array with the months names.
Syntax:AMonths() --> aMonths
Arguments:None
Returns:<aMonths> The array which holds the months names.
Description:This function returns an array with all the months names in the selected current language.
Examples:aMonths := AMonths() ? aMonths[ 1 ] // -> January ? aMonths[ 1 ] // -> Enero (if the selected language is Spanish)
Status:R
Compliance:This function is new in Harbour.
Files:Library is hbmisc
See also:ADays()
Back to index


BoM

Lang:dates2.txt
Component:hbmisc
Doc. source:hbmisc\doc\en\dates2.txt
Template:
Category:Date
Subcategory:
Oneliner:Gets the first day in a month.
Syntax:BoM( <dDate> ) --> dBOM
Arguments:<dDate> A valid date.
Returns:<dBOM> The first day in the month.
Description:This function returns the first day of a given month date.
Examples:Set( _SET_DATEFORMAT, "yyyy-mm-dd" ) ? BoM( hb_SToD( "20000125" ) ) // -> "2000-01-01" ? BoM( hb_SToD( "20000224" ) ) // -> "2000-02-01"
Status:R
Compliance:This function is new in Harbour.
Files:Library is hbmisc
See also:EoM(),WoM()
Back to index


BoY

Lang:dates2.txt
Component:hbmisc
Doc. source:hbmisc\doc\en\dates2.txt
Template:
Category:Date
Subcategory:
Oneliner:Gets the first date of the year.
Syntax:BoY( <dDate> ) --> dBOY
Arguments:<dDate> A valid date.
Returns:<dBOY> The first day in the year.
Description:This function returns the first date of a given year date.
Examples:Set( _SET_DATEFORMAT, "yyyy-mm-dd" ) ? BoY( hb_SToD( "20000125" ) ) // -> "2000-01-01" ? BoY( hb_SToD( "20010224" ) ) // -> "2001-01-01"
Status:R
Compliance:This function is new in Harbour.
Files:Library is hbmisc
See also:EoY()
Back to index


DaysInMonth

Lang:dates2.txt
Component:hbmisc
Doc. source:hbmisc\doc\en\dates2.txt
Template:
Category:Date
Subcategory:
Oneliner:Gets the days in a month.
Syntax:DaysInMonth( <dDate> ) --> nDays
Arguments:<dDate> A valid date.
Returns:<nDays> The number of days of the month.
Description:This function returns the number of days of the given date month.
Examples:? DaysInMonth( hb_SToD( "20000101" ) ) // -> 31 ? DaysInMonth( hb_SToD( "20000201" ) ) // -> 29
Status:R
Compliance:This function is new in Harbour.
Files:Library is hbmisc
See also:IsLeapYear()
Back to index


DoY

Lang:dates2.txt
Component:hbmisc
Doc. source:hbmisc\doc\en\dates2.txt
Template:
Category:Date
Subcategory:
Oneliner:Gets the day number of the year.
Syntax:DoY( <dDate> ) --> nDay
Arguments:<dDate> A valid date.
Returns:<nDay> The day number
Description:This function returns the day number of the year for a given date.
Examples:? DoY( hb_SToD( "20000131" ) ) // -> 31 ? DoY( hb_SToD( "20000220" ) ) // -> 51
Status:R
Compliance:This function is new in Harbour.
Files:Library is hbmisc
See also:WoY()
Back to index


EoM

Lang:dates2.txt
Component:hbmisc
Doc. source:hbmisc\doc\en\dates2.txt
Template:
Category:Date
Subcategory:
Oneliner:Gets the last day in a month.
Syntax:EoM( <dDate> ) --> dEOM
Arguments:<dDate> A valid date.
Returns:<dEOM> The last day in the month.
Description:This function returns the last day of a given month date.
Examples:Set( _SET_DATEFORMAT, "yyyy-mm-dd" ) ? EoM( hb_SToD( "20000101" ) ) // -> "2000-01-31" ? EoM( hb_SToD( "20000201" ) ) // -> "2000-02-29"
Status:R
Compliance:This function is new in Harbour.
Files:Library is hbmisc
See also:BoM(),WoM()
Back to index


EoY

Lang:dates2.txt
Component:hbmisc
Doc. source:hbmisc\doc\en\dates2.txt
Template:
Category:Date
Subcategory:
Oneliner:Gets the last date of the year.
Syntax:EoY( <dDate> ) --> dEOY
Arguments:<dDate> A valid date.
Returns:<dEOY> The last date of the year.
Description:This function returns the last date of a given year date.
Examples:Set( _SET_DATEFORMAT, "yyyy-mm-dd" ) ? EoY( hb_SToD( "20000101" ) ) // -> "2000-12-31" ? EoY( hb_SToD( "20010101" ) ) // -> "2001-12-31"
Status:R
Compliance:This function is new in Harbour.
Files:Library is hbmisc
See also:BoY()
Back to index


IsLeapYear

Lang:dates2.txt
Component:hbmisc
Doc. source:hbmisc\doc\en\dates2.txt
Template:
Category:Date
Subcategory:
Oneliner:Checks if the given date is a leap year.
Syntax:IsLeapYear( <dDate> ) --> lTrueOrFalse
Arguments:<dDate> A valid date.
Returns:<lTrueOrFalse> A logical that indicates if the date year is leap
Description:This function returns true if the given date is a leap year and false if isn't.
Examples:? IsLeapYear( hb_SToD( "20000101" ) ) // -> .T. ? IsLeapYear( hb_SToD( "20010101" ) ) // -> .F.
Status:R
Compliance:This function is new in Harbour.
Files:Library is hbmisc
See also:DaysInMonth()
Back to index


WoY

Lang:dates2.txt
Component:hbmisc
Doc. source:hbmisc\doc\en\dates2.txt
Template:
Category:Date
Subcategory:
Oneliner:Gets the week number of the year.
Syntax:WoY( <dDate>, <lIso> ) --> nWeek
Arguments:<dDate> A valid date.
Returns:<nWeek> The week number <lIso> Flag that indicates if <nWeek> is in ISO format.
Description:This function returns the week number of the year for a given date. It returns the week number in ISO format ( range 0 - 52, by default or passing TRUE as second parameter) or 1 - 52 if lIso is FALSE.
Examples:? WoY( hb_SToD( "20000131" ) ) // -> 3 ? WoY( hb_SToD( "20000131" ), .F. ) // -> 4
Status:R
Compliance:This function is new in Harbour.
Files:Library is hbmisc
See also:DoY()
Back to index


ft_AcctAdj

Lang:acctadj.txt
Component:hbnf
Doc. source:hbnf\doc\en\acctadj.txt
Template:
Category:Date/Time
Subcategory:
Oneliner:Adjust beginning or ending fiscal pd. dates to acctg. dates
Syntax:ft_AcctAdj( [ <dGivenDate> ], [ <lIsEnd> ] ) -> dDate
Arguments:<dGivenDate> is any valid date in any valid format. Defaults to Date() if not supplied. <lIsEnd> is a logical variable. .F. = adjust for beginning of period mode, .T. = adjust for end of period mode. Defaults to beginning of period mode.
Returns:An adjusted date dependent upon mode and work week start day.
Description:Called by other FT_ACCT.. functions. The algorithm is: Beginning of period mode: IF dGivenDate is in last 3 days of work week Return next week's start date ELSE Return this week's start date ENDIF End of period mode: IF dGivenDate is in last 4 days of work week Return this week's end date ELSE Return prior week's end date ENDIF
Examples:Beginning of period mode (lIsEnd == .F.) dDate := hb_SToD( "19910131" ) // In last 3 days of work week ? ft_AcctAdj( dDate ) // 1991-02-03 (next week's start) dDate := hb_SToD( "19910331" ) // Not in last 3 days of work week ? ft_AcctAdj( dDate ) // 1991-03-31 (this week's start) End of period mode (lIsEnd == .T.) dDate := hb_SToD( "19910131" ) // In last 4 days of work week ? ft_AcctAdj( dDate, .T. ) // 1991-02-02 (this week's end) dDate := hb_SToD( "19910331" ) // Not in last 4 days of work week ? ft_AcctAdj( dDate, .T. ) // 1991-03-30 (prior week's end)
Status:
Compliance:
Files:
See also:ft_DateCnfg() ft_DayToBoW()
Back to index


ft_AcctMonth

Lang:acctmnth.txt
Component:hbnf
Doc. source:hbnf\doc\en\acctmnth.txt
Template:
Category:Date/Time
Subcategory:
Oneliner:Return accounting month data
Syntax:ft_AcctMonth( [ <dGivenDate> ], [ <nMonthNum> ] ) -> aDateInfo
Arguments:<dGivenDate> is any valid date in any date format. Defaults to current system date if not supplied. <nMonthNum> is a number from 1 to 12 signifying a month. Defaults to current month if not supplied.
Returns:A three element array containing the following data: aDateInfo[ 1 ] - The year and month as a character string "YYYYMM" aDateInfo[ 2 ] - The beginning date of the accounting month aDateInfo[ 3 ] - The ending date of the accounting month
Description:ft_AcctMonth() creates an array containing data about the accounting month containing the given date. An accounting period has the following characteristics: If the first week of the period contains 4 or more 'work' days, it is included in the period; otherwise, the first week was included in the prior period. If the last week of the period contains 4 or more 'work' days it is included in the period; otherwise, the last week is included in the next period. This results in 13 week 'quarters' and 4 or 5 week 'months'. Every 5 or 6 years, a 'quarter' will contain 14 weeks and the year will contain 53 weeks.
Examples:// get info about accounting month containing 9/15/90 aDateInfo := ft_AcctMonth( hb_SToD( "19900915" ) ) ? aDateInfo[ 1 ] // 199009 (9th month) ? aDateInfo[ 2 ] // 1990-09-02 beginning of month 9 ? aDateInfo[ 3 ] // 1990-09-29 end of month 9 // get info about accounting month 5 in year containing 9/15/90 aDateInfo := ft_AcctMonth( hb_SToD( "19900915" ), 5 ) ? aDateInfo[ 1 ] // 199005 ? aDateInfo[ 2 ] // 1989-04-29 beginning of month 5 ? aDateInfo[ 3 ] // 1990-06-02 end of month 5
Status:
Compliance:
Files:
See also:ft_DateCnfg() ft_AcctWeek() ft_AcctQtr() ft_AcctYear()
Back to index


ft_AcctQtr

Lang:acctqtr.txt
Component:hbnf
Doc. source:hbnf\doc\en\acctqtr.txt
Template:
Category:Date/Time
Subcategory:
Oneliner:Return accounting quarter data
Syntax:ft_AcctQtr( [ <dGivenDate> ], [ <nQtrNum> ] ) -> aDateinfo
Arguments:<dGivenDate> is any valid date in any date format. Defaults to current system date if not supplied. <nQtrNum> is a number from 1 to 4 signifying a quarter. Defaults to current quarter if not supplied.
Returns:A three element array containing the following data: aDateInfo[ 1 ] - The year and qtr. as a character string "YYYYQQ" aDateInfo[ 2 ] - The beginning date of the accounting quarter aDateInfo[ 3 ] - The ending date of the accounting quarter
Description:ft_AcctQtr() creates an array containing data about the accounting quarter containing the given date. An accounting period has the following characteristics: If the first week of the period contains 4 or more 'work' days, it is included in the period; otherwise, the first week was included in the prior period. If the last week of the period contains 4 or more 'work' days it is included in the period; otherwise, the last week is included in the next period. This results in 13 week 'quarters' and 4 or 5 week 'months'. Every 5 or 6 years, a 'quarter' will contain 14 weeks and the year will contain 53 weeks.
Examples:// get info about accounting month containing 9/15/90 aDateInfo := ft_AcctQtr( hb_SToD( "19900915" ) ) ? aDateInfo[ 1 ] // 199003 (3rd quarter) ? aDateInfo[ 2 ] // 1990-07-01 beginning of quarter 3 ? aDateInfo[ 3 ] // 1990-09-29 end of quarter 3 // get info about accounting qtr. 2 in year containing 9/15/90 aDateInfo := ft_AcctQtr( hb_SToD( "19900915" ), 2 ) ? aDateInfo[ 1 ] // 199002 ? aDateInfo[ 2 ] // 1989-04-01 beginning of quarter 2 ? aDateInfo[ 3 ] // 1990-06-30 end of quarter 2
Status:
Compliance:
Files:
See also:ft_DateCnfg() ft_AcctWeek() ft_AcctMonth() ft_AcctYear()
Back to index


ft_AcctWeek

Lang:acctweek.txt
Component:hbnf
Doc. source:hbnf\doc\en\acctweek.txt
Template:
Category:Date/Time
Subcategory:
Oneliner:Return accounting week data
Syntax:ft_AcctWeek( [ <dGivenDate> ], [ <nWeekNum> ] ) -> aDateInfo
Arguments:<dGivenDate> is any valid date in any date format. Defaults to current system date if not supplied. <nWeekNum> is a number from 1 to 52 signifying a week. Defaults to current week if not supplied.
Returns:A three element array containing the following data: aDateInfo[ 1 ] - The year and week as a character string "YYYYWW" aDateInfo[ 2 ] - The beginning date of the accounting week aDateInfo[ 3 ] - The ending date of the accounting week
Description:ft_AcctWeek() returns an array containing data about the accounting week containing the given date. An accounting period has the following characteristics: If the first week of the period contains 4 or more 'work' days, it is included in the period; otherwise, the first week was included in the prior period. If the last week of the period contains 4 or more 'work' days it is included in the period; otherwise, the last week is included in the next period. This results in 13 week 'quarters' and 4 or 5 week 'months'. Every 5 or 6 years, a 'quarter' will contain 14 weeks and the year will contain 53 weeks.
Examples:// get info about accounting week containing 9/15/90 aDateInfo := ft_AcctWeek( hb_SToD( "19900915" ) ) ? aDateInfo[ 1 ] // 199037 (37th week) ? aDateInfo[ 2 ] // 1990-09-09 beginning of week 37 ? aDateInfo[ 3 ] // 1990-09-15 end of week 37 // get info about accounting week 25 in year containing 9/15/90 aDateInfo := ft_AcctWeek( hb_SToD( "19900915" ), 25 ) ? aDateInfo[ 1 ] // 199025 ? aDateInfo[ 2 ] // 1989-06-17 beginning of week 25 ? aDateInfo[ 3 ] // 1990-06-23 end of week 25
Status:
Compliance:
Files:
See also:ft_DateCnfg() ft_AcctMonth() ft_AcctQtr() ft_AcctYear()
Back to index


ft_AcctYear

Lang:acctyear.txt
Component:hbnf
Doc. source:hbnf\doc\en\acctyear.txt
Template:
Category:Date/Time
Subcategory:
Oneliner:Return accounting year data
Syntax:ft_AcctYear( [ <dGivenDate> ] ) -> aDateInfo
Arguments:<dGivenDate> is any valid date in any date format. Defaults to current system date if not supplied.
Returns:A three element array containing the following data: aDateInfo[ 1 ] - The year as a character string "YYYY" aDateInfo[ 2 ] - The beginning date of the accounting year aDateInfo[ 3 ] - The ending date of the accounting year
Description:ft_AcctYear() creates an array containing data about the accounting year containing the given date. An accounting period has the following characteristics: If the first week of the period contains 4 or more 'work' days, it is included in the period; otherwise, the first week was included in the prior period. If the last week of the period contains 4 or more 'work' days it is included in the period; otherwise, the last week is included in the next period. This results in 13 week 'quarters' and 4 or 5 week 'months'. Every 5 or 6 years, a 'quarter' will contain 14 weeks and the year will contain 53 weeks.
Examples:// get info about accounting year containing 9/15/90 aDateInfo := ft_AcctYear( hb_SToD( "19900915" ) ) ? aDateInfo[ 1 ] // 1990 ? aDateInfo[ 2 ] // 1989-12-31 beginning of year ? aDateInfo[ 3 ] // 1990-12-29 end of year
Status:
Compliance:
Files:
See also:ft_DateCnfg() ft_AcctWeek() ft_AcctMonth() ft_AcctQtr()
Back to index


ft_AddWkDy

Lang:wda.txt
Component:hbnf
Doc. source:hbnf\doc\en\wda.txt
Template:
Category:Date/Time
Subcategory:
Oneliner:Return true number of days to add given number of workdays
Syntax:ft_AddWkDy( <dStart>, <nWorkDays> ) -> nTrueDays
Arguments:<dStart> = date to start adding from <nWorkDays> = number of workdays to add
Returns:<nTrueDays> = Number of actual days to add to <dStart> in order to add the required <nWorkDays>
Description:Let's say you are given the problem: "All invoices are due 10 working days from the date they are printed. Please display the due date on the invoice." When is the due date? Assuming you are printing the invoices today, your answer is: dDueDate := Date() + ft_addWkDay( Date(), 10 ) A work day is defined as Monday through Friday. Unfortunately this routine does _not_ account for holidays. This documentation was written by Glenn Scott so if it's wrong, blame him.
Examples:// Postdate 5 working days from the first of January dPost := hb_SToD( "19910101" ) dPost += ft_AddWkDy( dPost, 5 ) // returns 7 true days ? dPost // 1991-01-08
Status:
Compliance:
Files:
See also:ft_Workdays()
Back to index


ft_Calendar

Lang:calendar.txt
Component:hbnf
Doc. source:hbnf\doc\en\calendar.txt
Template:
Category:Date/Time
Subcategory:
Oneliner:Display date/time calendar, find a date, return calendar data.
Syntax:ft_Calendar( [ <nRow> ], [ <nCol> ], [ <cColor> ], [ <lShadow> ] , [ <lShowHelp> ] ) -> aRetVal
Arguments:<nRow> is an optional screen row for calendar display, default row 1. <nCol> is an optional screen col for calendar display, default col 63. <cColor> is an optional color string for displayed messages, default is bright white text over green background. <lShadow> is an optional logical variable. If true (.T.), it uses ft_Shadow() to add a transparent shadow to the display, default (.F.). <lShowHelp> is an optional logical variable. If true, uses ft_XBox() to display a four line help message if the F1 key is pressed, default (.F.).
Returns:aRetVal is an 8 element array containing date, month, day, year, month (in character format), day of the week, julian day and current time.
Description:ft_Calendar() simply displays today's date, time and julian day in a two line display with an optional box shadow. Cursor keys may be used to page through the calendar by day, week, month or year increments. Returns an 8 element array of calendar data: Element Value [1] Date in current date format. [2] Numeric month number. [3] Numeric day number. [4] Numeric year number. [5] Month in character format. [6] Day of the week in character format. [7] Numeric Julian day. [8] Current time in time format. WARNING: ft_Calendar() uses ft_Shadow() and ft_XBox() from the Nanforum Toolkit!
Examples:LOCAL aRetVal := ft_Calendar( 10, 40, "W+/RB", .T., .T. ) ? aRetVal[ 1 ] // Result: 1991-04-20 ? aRetVal[ 2 ] // Result: 4 ? aRetVal[ 3 ] // Result: 20 ? aRetVal[ 4 ] // Result: 1991 ? aRetVal[ 5 ] // Result: April ? aRetVal[ 6 ] // Result: Saturday ? aRetVal[ 7 ] // Result: 110 ? aRetVal[ 8 ] // Result: 12:45:20
Status:
Compliance:
Files:
See also:ft_DayOfYr()
Back to index


ft_Civ2Mil

Lang:miltime.txt
Component:hbnf
Doc. source:hbnf\doc\en\miltime.txt
Template:
Category:Date/Time
Subcategory:
Oneliner:Convert usual civilian format time to military time.
Syntax:ft_Civ2Mil( <cCIVTIME> ) -> cMILTIME
Arguments:<cCIVTIME> character string of form hh:mm (am,pm,n or m), where 0<hh<12.
Returns:<cMILTIME> character string of form hhmm, where 0<=hh<24.
Description:Converts time from 12-hour civilian format to military.
Examples:ft_Civ2Mil( " 5:40 pm" ) // 1740 ft_Civ2Mil( " 5:40 am" ) // 0540 ft_Civ2Mil( "12:00 n" ) // 1200 ft_Civ2Mil( "12:00 m" ) // 0000 // Caution: leading blanks are irrelevant; p,a,n,m must be preceded by // one and only one space.
Status:
Compliance:
Files:
See also:ft_Mil2Civ() ft_Sys2Mil() ft_Mil2Min() ft_Min2Mil()
Back to index


ft_DateCnfg

Lang:datecnfg.txt
Component:hbnf
Doc. source:hbnf\doc\en\datecnfg.txt
Template:
Category:Date/Time
Subcategory:
Oneliner:Set beginning of year/week for FT_ date functions
Syntax:ft_DateCnfg( [ <cFYStart> ], [ <nDow> ] ) -> aDateInfo
Arguments:<cFYStart> is a character date string in the user's system date format, i.e., the same as the user would enter for CToD(). If this argument is NIL, the current value is unchanged. Note: The year portion of the date string must be present and be a valid year; however, it has no real meaning. <nDow> is a number from 1 to 7 (1 = Sunday) indicating the desired start of a work week. If this argument is NIL, the current value is unchanged.
Returns:A 2-element array containing the following information: aDateInfo[1] - an ANSI date string indicating the beginning date of the year. Only the month and day are meaningful. aDateInfo[2] - the number of the first day of the week (1 = Sunday)
Description:ft_DateCnfg() is called internally by many of the date functions in the library to determine the beginning of year date and beginning of week day. The default beginning of the year is January 1st and the default beginning of the week is Sunday (day 1). Either or both of these settings may be changed by calling ft_DateCnfg() with the proper arguments. They will retain their values for the duration of the program or until they are changed again by a subsequent call to ft_DateCnfg(). It is not necessary to call ft_DateCnfg() unless you need to change the defaults. ft_DateCnfg() affects the following library functions: ft_Week() ft_AcctWeek() ft_DayToBoW() ft_Month() ft_AcctMonth() ft_DayOfYr() ft_Qtr() ft_AcctQtr() ft_AcctAdj() ft_Year() ft_AcctYear()
Examples:// Configure library date functions to begin year on // July 1st. Set( _SET_DATEFORMAT, "yyyy-mm-dd" ) ft_DateCnfg( "1980-07-01" ) // year is insignificant // Examples of return values: // aArray[1] aArray[2] // System date format: American SET DATE TO AMERICAN aArray := ft_DateCnfg() // "1980.01.01" 1 (Sun.) aArray := ft_DateCnfg( "07/01/80" ) // "1980.07.01" 1 (Sun.) aArray := ft_DateCnfg( "07/01/80", 2 ) // "1980.07.01" 2 (Mon.) aArray := ft_DateCnfg( , 2 ) // "1980.01.01" 2 (Mon.) // System date format: British SET DATE TO BRITISH aArray := ft_DateCnfg( "01/07/80", 2 ) // "1980.07.01" 2 (Mon.)
Status:
Compliance:
Files:
See also:ft_AcctAdj()
Back to index


ft_DayOfYr

Lang:dayofyr.txt
Component:hbnf
Doc. source:hbnf\doc\en\dayofyr.txt
Template:
Category:Date/Time
Subcategory:
Oneliner:Return calendar, fiscal or accounting day data
Syntax:ft_DayOfYr( [ <dGivenDate> ], [ <nDayNum> ], [ <lIsAcct> ] ) -> aDateInfo
Arguments:<dGivenDate> is any valid date in any valid format. Defaults to current system date if not supplied. <nDayNum> is a number from 1 to 371, signifying a day of a year. Defaults to current day if not supplied. <lIsAcct> is a logical which specifies the type of year to base the return value on: .F. = calendar or fiscal year, .T. = accounting year.
Returns:A three element array containing the following data: If <nDayNum> is specified: aDateInfo[ 1 ] - The date of the specified day number aDateInfo[ 2 ] - The beginning date of the year aDateInfo[ 3 ] - The ending date of the year If <nDayNum> is not specified: aDateInfo[ 1 ] - The year and day as a character string "YYYYDDD" aDateInfo[ 2 ] - The beginning date of the year aDateInfo[ 3 ] - The ending date of the year
Description:ft_DayOfYr() returns an array containing data about a day in the calendar or fiscal year containing the given date. The beginning of year date defaults to January 1st but may be changed with ft_DateCnfg().
Examples:aDateInfo := ft_DayOfYr( hb_SToD( "19910331" ) ) ? aDateInfo[ 1 ] // 1991090 (90th day of year 1991) ? aDateInfo[ 2 ] // 1991-01-01 ? aDateInfo[ 3 ] // 1991-12-31 aDateInfo := ft_DayOfYr( , 90 ) // assume current date is 3/31/91 ? aDateInfo[ 1 ] // 1991-03-31 (90th day of year) ? aDateInfo[ 2 ] // 1991-01-01 ? aDateInfo[ 3 ] // 1991-12-31 aDateInfo := ft_DayOfYr( , 90, .T. ) ? aDateInfo[ 1 ] // 1991-03-29 (90th day of accounting year) ? aDateInfo[ 2 ] // 1990-12-30 (1st day of accounting year) ? aDateInfo[ 3 ] // 1991-12-28 (last day of accounting year)
Status:
Compliance:
Files:
See also:ft_DateCnfg()
Back to index


ft_DayToBoW

Lang:daytobow.txt
Component:hbnf
Doc. source:hbnf\doc\en\daytobow.txt
Template:
Category:Date/Time
Subcategory:
Oneliner:Calculate no. of days between date and beginning of week
Syntax:ft_DayToBoW( [ <dGivenDate> ] ) -> nDays
Arguments:<dGivenDate> is any valid date in any valid date format. Defaults to current date if not supplied.
Returns:A positive number of days to beginning of week, range 0 to 6.
Description:ft_DayToBoW() returns the number of days to the beginning of the week. Normally this will be one less than the value that would be returned by the Clipper function DoW(), unless the day for the beginning of the week has been changed with ft_DateCnfg().
Examples:dDate := hb_SToD( "19900915" ) ? DoW( dDate ) // 7 ? CDoW( dDate ) // Saturday ? ft_DayToBoW( dDate ) // 6 // change beginning of week to Friday (yeah!) ft_DateCnfg( , 6 ) ? DoW( dDate ) // 7 ? CDoW( dDate ) // Saturday ? ft_DayToBoW( dDate ) // 1
Status:
Compliance:
Files:
See also:ft_DateCnfg() ft_AcctWeek() ft_Week()
Back to index


ft_DoY

Lang:woy.txt
Component:hbnf
Doc. source:hbnf\doc\en\woy.txt
Template:
Category:Date/Time
Subcategory:
Oneliner:Find number of day within year
Syntax:ft_DoY( <dDate> ) -> <nResult>
Arguments:<dDate> is a date in the form "mm/dd/yy" or "mm/dd/yyyy"
Returns:Return numeric position of day within the year. Return NIL if parameter does not conform.
Description:Finds the day number, considering 01/01 as day 1 Handles dates with CENTURY ON|OFF, to allow for 21st century. Date validation must be external to this function.
Examples:// These code fragments find the day number, given a date. // literal character date dDate := hb_SToD( "19910101" ) nDayNum := ft_DoY( dDate ) // result: 1 // presume DOS date to be 1991-01-06 nDayNum := ft_DoY( Date() ) // result: 6 // date input dDate := hb_SToD() @ 4, 10 GET cDate // input 1991-07-04 READ nDayNum := ft_DoY( dDate ) // result: 185 // last day of year nDayNum := ft_DoY( hb_SToD( "19911231" ) ) // result: 365
Status:
Compliance:
Files:
See also:
Back to index


ft_Easter

Lang:easter.txt
Component:hbnf
Doc. source:hbnf\doc\en\easter.txt
Template:
Category:Date/Time
Subcategory:
Oneliner:Return the date of Easter
Syntax:ft_Easter( <xYear> ) -> dEdate
Arguments:xYear can be a character, date or numeric describing the year for which you wish to receive the date of Easter.
Returns:The actual date that Easter occurs.
Description:Returns the date of Easter for any year after 1582 up to Clipper's limit which the manual states is 9999, but the Guide agrees with the actual imposed limit of 2999. This function can be useful in calender type programs that indicate when holidays occur.
Examples:dEdate := ft_Easter( 1990 ) // returns 1990-04-15
Status:
Compliance:
Files:
See also:
Back to index


ft_ElapMin

Lang:elapmil.txt
Component:hbnf
Doc. source:hbnf\doc\en\elapmil.txt
Template:
Category:Date/Time
Subcategory:
Oneliner:Return difference, in minutes, between two mil format times.
Syntax:ft_ElapMin( <cTIME1>, <cTIME2> ) -> nMINUTES
Arguments:<cTIME1, cTIME2> character strings of military form "hhmm", where 0<=hh<24.
Returns:<nMINUTES>
Description:Finds the arithmetic difference between time two times (time 2 - time 1). If time 2 is smaller than time 1, a NEGATIVE value is returned.
Examples:ft_ElapMin( "1718", "2040" ) -> 322 ft_ElapMin( "2040", "1718" ) -> -322
Status:
Compliance:
Files:
See also:ft_ElTime() ft_Mil2Min() ft_Min2Mil()
Back to index


ft_Elapsed

Lang:elapsed.txt
Component:hbnf
Doc. source:hbnf\doc\en\elapsed.txt
Template:
Category:Date/Time
Subcategory:
Oneliner:Return elapsed time between two days and/or times
Syntax:ft_Elapsed([ <dStart> ], [ <dEnd> ], ; <cTimeStart>, <cTimeEnd>) -> aTimedata
Arguments:<dStart> is any valid date in any date format. Defaults to Date(). <dEnd> is any valid date in any date format. Defaults to Date(). <cTimeStart> is a valid Time string of the format 'hh:mm:ss' where hh is hours in 24-hour format. <cTimeEnd> is a valid Time string of the format 'hh:mm:ss' where hh is hours in 24-hour format.
Returns:A two-dimensional array containing elapsed time data.
Description:ft_Elapsed() calculates the elapsed time between two Date/Time events. It returns an array which contains the following data: aRetVal[ 1, 1 ] Integer Days aRetVal[ 1, 2 ] Total Days (nn.nnnn) aRetVal[ 2, 1 ] Integer Hours aRetVal[ 2, 2 ] Total Hours (nn.nnnn) aRetVal[ 3, 1 ] Integer Minutes aRetVal[ 3, 2 ] Total Minutes (nn.nnnn) aRetVal[ 4, 1 ] Integer Seconds aRetVal[ 4, 2 ] Total Seconds (nn)
Examples:ft_Elapsed( hb_SToD( "19901128" ), hb_SToD( "19901130" ), "08:00:00", "12:10:30" ) // will return: ? aRetVal[ 1, 1 ] // -> 2 ( Days ) aRetVal[ 1, 2 ] -> 2.1740 Days ? aRetVal[ 2, 1 ] // -> 4 ( Hours ) aRetVal[ 2, 2 ] -> 52.1750 Hours ? aRetVal[ 3, 1 ] // -> 10 ( Minutes ) aRetVal[ 3, 2 ] -> 3130.5000 Minutes ? aRetVal[ 4, 1 ] // -> 30 ( Seconds ) aRetVal[ 4, 2 ] -> 187830 Seconds
Status:
Compliance:
Files:
See also:
Back to index


ft_ElTime

Lang:eltime.txt
Component:hbnf
Doc. source:hbnf\doc\en\eltime.txt
Template:
Category:Date/Time
Subcategory:
Oneliner:Compute difference between times in hours, minutes, seconds.
Syntax:ft_ElTime( <cTime1>, <cTime2> ) -> cDiff
Arguments:<cTime1, cTime2> character strings representing times in hh:mm:ss format.
Returns:<cDiff> character string representing time difference in hh:mm:ss format.
Description:Return the absolute difference between two times in hh:mm:ss format in character hours, minutes and seconds (hh:mm:ss).
Examples:ft_ElTime( "22:40:12", "23:55:17" ) // 01:15:05 ft_ElTime( "23:55:17", "22:40:12" ) // 01:15:05
Status:
Compliance:
Files:
See also:ft_ElapMin() ft_Mil2Min() ft_Min2Mil()
Back to index


ft_FDay

Lang:firstday.txt
Component:hbnf
Doc. source:hbnf\doc\en\firstday.txt
Template:
Category:Date/Time
Subcategory:
Oneliner:Return first day of the month
Syntax:ft_FDay( [ <dDateToChk> ] ) -> dFirstDay
Arguments:<dDateToChk> is a date within a month for which you want to find the first date of that month. If not passed or is an incorrect type, defaults to current system date.
Returns:A Clipper date value representing the first date of the month.
Description:This function will return the first day of the month of the date passed, or the first day of the current month if no argument is supplied.
Examples:dDate := hb_SToD( "19900915" ) ? ft_FDay( dDate ) // 1990-09-01 ? ft_FDay() // 1991-03-01 (current month)
Status:
Compliance:
Files:
See also:ft_LDay()
Back to index


ft_LDay

Lang:lastday.txt
Component:hbnf
Doc. source:hbnf\doc\en\lastday.txt
Template:
Category:Date/Time
Subcategory:
Oneliner:Return last day of the month
Syntax:ft_LDay( [ <dDateToChk> ] ) -> dLastDay
Arguments:<dDateToChk> is a date within a month for which you want to find the last date of that month. If not passed or is an incorrect type, defaults to current system date.
Returns:A Clipper date value representing the last date of the month.
Description:This function will return the last day of the month of the date passed, or the last day of the current month if no argument is supplied.
Examples:dDate := hb_SToD( "19900915" ) ? ft_LDay( dDate ) // 1990-09-30 ? ft_LDay() // 1991-03-31 (current month)
Status:
Compliance:
Files:
See also:ft_FDay()
Back to index


ft_MAdd

Lang:madd.txt
Component:hbnf
Doc. source:hbnf\doc\en\madd.txt
Template:
Category:Date/Time
Subcategory:
Oneliner:Add or subtract months to/from a date
Syntax:ft_MAdd( [ <dGivenDate> ], [ <nAddMonths> ], [ <lMakeEOM> ] ) -> dDate
Arguments:<dGivenDate> is any valid date in any date format. Defaults to current system date if not supplied. <nAddMonths> is the number of months to be added or subtracted. Defaults to 0 if not supplied. <lMakeEOM> is a logical variable indicating whether or not to force the returned date to the last date of the month. It only affects the returned date if <dGivenDate> is an end-of-month date.
Returns:A date.
Description:ft_MAdd() adds or subtracts months to/from a given date. If MakeEOM is passed and dGivenDate is the last day of a month, it will return the EOM of calculated month. Otherwise it will return the same day as the day of the passed date.
Examples:dDate := hb_SToD( "19900915" ) ? ft_MAdd( dDate, 1 ) // 1990-10-15 ? ft_MAdd( dDate, -2 ) // 1990-07-15 // force EOM dDate := hb_SToD( "19910430" ) ? ft_MAdd( dDate, 1 ) // 1991-05-30 ? ft_MAdd( dDate, 1, .T. ) // 1991-05-31 <- forced EOM ? ft_MAdd( dDate, 2 ) // 1991-06-30 ? ft_MAdd( dDate, 2, .T. ) // 1991-06-30 <- June only has 30 days ? ft_MAdd( dDate, 3 ) // 1991-07-30 ? ft_MAdd( dDate, 3, .T. ) // 1991-07-31 <- forced EOM
Status:
Compliance:
Files:
See also:ft_DayOfYr() ft_DayToBoW()
Back to index


ft_Mil2Civ

Lang:miltime.txt
Component:hbnf
Doc. source:hbnf\doc\en\miltime.txt
Template:
Category:Date/Time
Subcategory:
Oneliner:Convert time in military format to civilian format.
Syntax:ft_Mil2Civ( <cCIVTIME> ) -> dMILTIME
Arguments:<cMILTIME> character string of form hhmm, where 0<=hh<24.
Returns:<cCIVTIME> character string of form hh:mm (am,pm,n or m), where 0<hh<12.
Description:Converts time from military to civilian format
Examples:ft_Mil2Civ( "1640" ) // 4:40 pm ft_Mil2Civ( "0440" ) // 4:40 am ft_Mil2Civ( "1200" ) // 12:00 n ft_Mil2Civ( "0000" ) // 12:00 m ft_Mil2Civ( "2400" ) // 12:00 m Caution: leading blanks are irrelevant.
Status:
Compliance:
Files:
See also:ft_Civ2Mil() ft_Sys2Mil() ft_Mil2Min() ft_Min2Mil()
Back to index


ft_Mil2Min

Lang:miltime.txt
Component:hbnf
Doc. source:hbnf\doc\en\miltime.txt
Template:
Category:Date/Time
Subcategory:
Oneliner:Convert time in military format to number of minute of day.
Syntax:ft_Mil2Min( <cMILTIME> ) -> nMINUTE
Arguments:<cMILTIME> character string of form hhmm, where 0<=hh<24.
Returns:<nMINOFDAY> numeric value representing minute of day.
Description:Converts time in military format to number of minute of the day.
Examples:ft_Mil2Min( "1729" ) // 1049
Status:
Compliance:
Files:
See also:ft_Min2Mil() ft_Civ2Mil() ft_Mil2Civ() ft_Sys2Mil()
Back to index


ft_Min2Dhm

Lang:min2dhm.txt
Component:hbnf
Doc. source:hbnf\doc\en\min2dhm.txt
Template:
Category:Date/Time
Subcategory:
Oneliner:Convert numeric minutes to days, hours and minutes.
Syntax:ft_Min2Dhm( <nMinutes> ) -> aDHM_
Arguments:<nMinutes> the number of minutes.
Returns:<aDHM_> where: aDHM_[ 1 ] = cDAYS, aDHM_[ 2 ] = cHours, aDHM_[ 3 ] = cMinutes
Description:Converts numeric minutes into a character array containing days, hours & minutes.
Examples:aDHM_ := MIN2DHM( 16789 ) // aDHM_[ 1 ] = 11, aDHM_[ 2 ] = 15, aDHM_[ 3 ] = 49
Status:
Compliance:
Files:
See also:
Back to index


ft_Min2Mil

Lang:miltime.txt
Component:hbnf
Doc. source:hbnf\doc\en\miltime.txt
Template:
Category:Date/Time
Subcategory:
Oneliner:Convert minute of day to military format time.
Syntax:ft_Min2Mil( <nMINUTE> ) -> cMILTIME
Arguments:<nMINUTE> numeric integer representing minute of day.
Returns:<cMILTIME> character string of form hhmm, where 0<=hh<24.
Description:Converts minute of the day to military format time.
Examples:ft_Min2Mil( 279 ) // 0439
Status:
Compliance:
Files:
See also:ft_Mil2Min() ft_Mil2Civ() ft_Civ2Mil() ft_Sys2Mil()
Back to index


ft_Month

Lang:month.txt
Component:hbnf
Doc. source:hbnf\doc\en\month.txt
Template:
Category:Date/Time
Subcategory:
Oneliner:Return Calendar or Fiscal Month Data
Syntax:ft_Month( [ <dGivenDate> ], [nMonthNum] ) -> aDateInfo
Arguments:<dGivenDate> is any valid date in any date format. Defaults to current system date if not supplied. <nMonthNum> is a number from 1 to 12 signifying a month. Defaults to current month if not supplied.
Returns:A three element array containing the following data: aDateInfo[ 1 ] - The year and month as a character string "YYYYMM" aDateInfo[ 2 ] - The beginning date of the month aDateInfo[ 3 ] - The ending date of the month
Description:ft_Month() returns an array containing data about the month containing the given date. Normally the return data will be based on a year beginning on January 1st with weeks beginning on Sunday. The beginning of year date and/or beginning of week day can be changed by using ft_DateCnfg(), which will affect all subsequent calls to ft_Month() until another call to ft_DateCnfg(). The beginning of year date and beginning of week day may be reset to January 1 and Sunday by calling ft_DateCnfg() with no parameters.
Examples:// get info about month containing 9/15/90 aDateInfo := ft_Month( hb_SToD( "19900915" ) ) ? aDateInfo[ 1 ] // 199009 (9th month) ? aDateInfo[ 2 ] // 1990-09-01 beginning of month 9 ? aDateInfo[ 3 ] // 1990-09-30 end of week month 9 // get info about month 5 in year containing 9/15/90 aDateInfo := ft_Month( hb_SToD( "19900915" ), 5 ) ? aDateInfo[ 1 ] // 199005 ? aDateInfo[ 2 ] // 1990-05-01 beginning of month 5 ? aDateInfo[ 3 ] // 1990-05-31 end of month 5 // get info about month 5 in current year (1991) aDateInfo := ft_Month( , 5 ) ? aDateInfo[ 1 ] // 199105 ? aDateInfo[ 2 ] // 1991-05-01 beginning of month 5 ? aDateInfo[ 3 ] // 1991-05-31 end of month 5
Status:
Compliance:
Files:
See also:ft_DateCnfg() ft_Week() ft_Qtr() ft_Year()
Back to index


ft_Qtr

Lang:qtr.txt
Component:hbnf
Doc. source:hbnf\doc\en\qtr.txt
Template:
Category:Date/Time
Subcategory:
Oneliner:Return Calendar or Fiscal Quarter Data.
Syntax:ft_Qtr( [ <dGivenDate> ], [ <nQtrNum> ] ) -> aDateInfo
Arguments:<dGivenDate> is any valid date in any date format. Defaults to current system date if not supplied. <nQtrNum> is a number from 1 to 4 signifying a quarter. Defaults to current quarter if not supplied.
Returns:A three element array containing the following data: aDateInfo[ 1 ] - The year and quarter as a character string "YYYYQQ" aDateInfo[ 2 ] - The beginning date of the quarter aDateInfo[ 3 ] - The ending date of the quarter
Description:ft_Qtr() returns an array containing data about the quarter containing the given date. Normally the return data will be based on a year beginning on January 1st with weeks beginning on Sunday. The beginning of year date and/or beginning of week day can be changed by using ft_DateCnfg(), which will affect all subsequent calls to ft_Qtr() until another call to ft_DateCnfg(). The beginning of year date and beginning of week day may be reset to January 1 and Sunday by calling ft_DateCnfg() with no parameters.
Examples:// get info about quarter containing 9/15/90 aDateInfo := ft_Qtr( hb_SToD( "19900915" ) ) ? aDateInfo[ 1 ] // 199003 (3rd quarter) ? aDateInfo[ 2 ] // 1990-07-01 beginning of quarter 3 ? aDateInfo[ 3 ] // 1990-09-30 end of week quarter 3 // get info about quarter 2 in year containing 9/15/90 aDateInfo := ft_Qtr( hb_SToD( "19900915" ), 2 ) ? aDateInfo[ 1 ] // 199002 ? aDateInfo[ 2 ] // 1990-04-01 beginning of quarter 2 ? aDateInfo[ 3 ] // 1990-06-30 end of quarter 2 // get info about quarter 2 in current year (1991) aDateInfo := ft_Qtr( , 2 ) ? aDateInfo[ 1 ] // 199102 ? aDateInfo[ 2 ] // 1991-04-01 beginning of quarter 2 ? aDateInfo[ 3 ] // 1991-06-30 end of quarter 2
Status:
Compliance:
Files:
See also:ft_DateCnfg() ft_Week() ft_Month() ft_Year()
Back to index


ft_Sys2Mil

Lang:miltime.txt
Component:hbnf
Doc. source:hbnf\doc\en\miltime.txt
Template:
Category:Date/Time
Subcategory:
Oneliner:Convert system time to military time format.
Syntax:ft_Sys2Mil() -> cMILTIME
Arguments:none
Returns:<cMILTIME> character string of form hhmm, where 0<=hh<24.
Description:Return current system time as character string in military format.
Examples:ft_Sys2Mil() // 1623
Status:
Compliance:
Files:
See also:ft_Mil2Civ() ft_Civ2Mil()
Back to index


ft_Week

Lang:week.txt
Component:hbnf
Doc. source:hbnf\doc\en\week.txt
Template:
Category:Date/Time
Subcategory:
Oneliner:Return calendar or fiscal week data
Syntax:ft_Week( [ <dGivenDate> ], [ <nWeekNum> ] ) -> aDateinfo
Arguments:<dGivenDate> is any valid date in any date format. Defaults to current system date if not supplied. <nWeekNum> is a number from 1 to 53 signifying a week. Defaults to current week if not supplied.
Returns:A three element array containing the following data: aDateInfo[ 1 ] - The year and week as a character string "YYYYWW" aDateInfo[ 2 ] - The beginning date of the week aDateInfo[ 3 ] - The ending date of the week
Description:ft_Week() returns an array containing data about the week containing the given date. Normally the return data will be based on a year beginning on January 1st with weeks beginning on Sunday. The beginning of year date and/or beginning of week day can be changed by using ft_DateCnfg(), which will affect all subsequent calls to ft_Week() until another call to ft_DateCnfg(). The beginning of year date and beginning of week day may be reset to January 1 and Sunday by calling ft_DateCnfg() with no parameters.
Examples:// get info about week containing 9/15/90 aDateInfo := ft_Week( hb_SToD( "19900915" ) ) ? aDateInfo[ 1 ] // 199037 (37th week) ? aDateInfo[ 2 ] // 1990-09-09 beginning of week 37 ? aDateInfo[ 3 ] // 1990-09-15 end of week 37 // get info about week 25 in year containing 9/15/90 aDateInfo := ft_Week( hb_SToD( "19900915" ), 25 ) ? aDateInfo[ 1 ] // 199025 ? aDateInfo[ 2 ] // 1990-06-17 beginning of week 25 ? aDateInfo[ 3 ] // 1990-06-23 end of week 25 // get info about week 25 in current Year( 1991 ) aDateInfo := ft_Week( , 25 ) ? aDateInfo[ 1 ] // 199025 ? aDateInfo[ 2 ] // 1991-06-16 beginning of week 25 ? aDateInfo[ 3 ] // 1991-06-22 end of week 25
Status:
Compliance:
Files:
See also:ft_DateCnfg() ft_Month() ft_Qtr() ft_Year() ft_DayToBoW()
Back to index


ft_Workdays

Lang:workdays.txt
Component:hbnf
Doc. source:hbnf\doc\en\workdays.txt
Template:
Category:Date/Time
Subcategory:
Oneliner:Return number of work days between two dates
Syntax:ft_Workdays( [ <dStart> ], [ <dStop> ] ) -> nDays
Arguments:<dStart> is the beginning value for the date range. <dStop> is the ending value for the date range.
Returns:The number of work days (Monday through Friday) between two dates.
Description:ft_Workdays() returns a number indicating the number of work days between two dates. Work days are considered Monday through Friday. (The five day work week none of us Clipper programmers have.)
Examples:? ft_Workdays( hb_SToD( "19910516" ), hb_SToD( "19910520" ) ) // 3 (Th - Mo) ? ft_Workdays( hb_SToD( "19910518" ), hb_SToD( "19910519" ) ) // 0 (Sa - Su) ? ft_Workdays( hb_SToD( "19910517" ), hb_SToD( "19910517" ) ) // 1 (Fr - Fr)
Status:
Compliance:
Files:
See also:
Back to index


ft_WoY

Lang:woy.txt
Component:hbnf
Doc. source:hbnf\doc\en\woy.txt
Template:
Category:Date/Time
Subcategory:
Oneliner:Find number of week within year
Syntax:ft_WoY( <dDate> ) -> <nResult>
Arguments:<dDate> is a date in the form "mm/dd/yy" or "mm/dd/yyyy"
Returns:Return numeric position of week within the year or NIL if parameter does not conform.
Description:Considers a full week as starting on Sunday, ending on Saturday. First week of year (week 1) may start on any day, and thus contain any number of days. Final week of year (week 53) may contain any number of days. Handles dates with CENTURY ON|OFF, to allow for 21st century. Date validation must be external to this function.
Examples:// These code fragments find the week number, given a date. // literal character date dDate := hb_SToD( "19910101" ) nWkNum := ft_WoY( dDate ) // result: 1 // presume DOS date to be 1991-01-06 nWkNum := ft_WoY( Date() ) // result: 2 // date input dDate := hb_SToD() @ 4, 10 GET cDate // input 1991-07-04 READ nWkNum := ft_WoY( dDate ) // result: 27 // last day of year nWkNum := ft_WoY( hb_SToD( "19911231" ) ) // result: 53
Status:
Compliance:
Files:
See also:
Back to index


ft_Year

Lang:year.txt
Component:hbnf
Doc. source:hbnf\doc\en\year.txt
Template:
Category:Date/Time
Subcategory:
Oneliner:Return calendar or fiscal year data
Syntax:ft_Year( [ <dGivenDate> ] ) -> aDateInfo
Arguments:<dGivenDate> is any valid date in any date format. Defaults to current system date if not supplied.
Returns:A three element array containing the following data: aDateInfo[ 1 ] - The year as a character string "YYYY" aDateInfo[ 2 ] - The beginning date of the year aDateInfo[ 3 ] - The ending date of the year
Description:ft_Year() returns an array containing data about the year containing the given date. Normally the return data will be based on a year beginning on January 1st. The beginning of year date can be changed by using ft_DateCnfg(), which will affect all subsequent calls to ft_Year() until another call to ft_DateCnfg(). The beginning of year date may be reset to January 1 by calling ft_DateCnfg() with no parameters.
Examples:// Get info about year containing 9/15/90, assuming default // beginning of year is January 1st. aDateInfo := ft_Year( hb_SToD( "19900915" ) ) ? aDateInfo[ 1 ] // 1990 ? aDateInfo[ 2 ] // 1990-01-01 beginning of year ? aDateInfo[ 3 ] // 1990-12-31 end of year // get info about current year (1991). aDateInfo := ft_Year() ? aDateInfo[ 1 ] // 1991 ? aDateInfo[ 2 ] // 1991-01-01 beginning of year ? aDateInfo[ 3 ] // 1991-12-31 end of year
Status:
Compliance:
Files:
See also:ft_DateCnfg() ft_Week() ft_Month() ft_Qtr()
Back to index


1st document to read

Lang:1stread.txt
Component:harbour
Doc. source:.\doc\en\1stread.txt
Template:Document
Category:Document
Subcategory:
Oneliner:A starters guide to Harbour
Syntax:
Arguments:
Returns:
Description:Welcome to Harbour ================== Clipper is a trademark of Computer Associates and will often be referred to as CA-Cl*pper within Harbour documents. Regardless of this variant, Clipper is recognized as Computer Associates' trademark. Harbour is a free software compiler for the xBase superset language often referred to as Clipper (the language that is implemented by the compiler Clipper). The goal of the Harbour project is to produce a cross platform CA-Cl*pper compatible compiler. The Harbour web site is at <URL:http://harbour-project.org/>. If you have any problems with this copy of Harbour please visit our web site and ensure that you are using the latest release. If you have any questions about Harbour please be sure to read the FAQ <URL:http://harbour-project.org/faq/>. Also, please be sure to read the documentation that comes with Harbour, you should find it in the same directory in which you found this file. If you are reading this file as part of a source distribution of harbour you probably want to start by reading dirstruc.txt because this is your map to the harbour source directories. Harbour is a superset of Clipper and is backwards compatible with nearly 100% of all Clipper 5.2x or 5.3 code. Most Clipper S'87 code will also compile and run fine, but may require some modifications to run well.
Examples:
Status:
Compliance:
Files:
See also:
Back to index


Harbour Extensions

Lang:harbext.txt
Component:harbour
Doc. source:.\doc\en\harbext.txt
Template:Document
Category:Document
Subcategory:
Oneliner:Harbour Extensions
Syntax:
Arguments:
Returns:
Description:<b>Language extensions:</b> </par> -------------------- * Class generation and management. CA-Cl*pper only allowed creation of objects from a few standard 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. * @<FunctionName>() </par> Returns the pointer (address) to a function. The returned value is not useful to application-level programming, but is used at a low level to implement object oriented coding. (Internally, a class method is a static function and there is no symbol for it, so it is accessed via its address). * Class HBGetList Object oriented support for GetLists management. * ProcName() support for class Method names. Class Methods can be retrieved from the call stack. * Memory() has new return values. See hbmemory.ch * Transform() --> new function in format string @0 Make a zero padded string out of the number. * SToD() --> dDate New function that converts a yyyymmdd string to a Date value. * Optional Compile Time STRONG TYPE declaration (and compile time TYPE MISMATCH warnings) Example: LOCAL/STATIC Var AS ... * The Harbour debugger provides new interesting classes: - Class TDbWindow could be the foundation for a generic multiplatform - Class TForm - Class TDbMenu implement both pulldown and popup menus. <b>RTL enhanced functionality:</b> </par> --------------------------- - hb_DiskSpace( <nDrive>, <nType> ) The second parameter is a Harbour (optional) parameter and indicates the type of diskinfo being requested. See en/diskspac.txt for info.
Examples:
Status:
Compliance:
Files:
See also:
Back to index


The Garbage Collector

Lang:garbage.txt
Component:harbour
Doc. source:.\doc\en\garbage.txt
Template:Document
Category:Document
Subcategory:
Oneliner:Readme for Harbour Garbage Collect Feature
Syntax:
Arguments:
Returns:
Description:The garbage collector uses the following logic: - first collect all memory allocations that can cause garbage; - next scan all variables if these memory blocks are still referenced. Notice that only arrays, objects and codeblocks are collected because these are the only datatypes that can cause self-references ( a[ 1 ] := a ) or circular references ( a[ 1 ] := b; b[ 1 ] := c; c[ 1 ] := a ) that cannot be properly deallocated by simple reference counting. Since all variables in harbour are stored inside some available tables (the eval stack, memvars table and array of static variables) then checking if the reference is still alive is quite easy and doesn't require any special treatment during memory allocation. Additionaly the garbage collector is scanning some internal data used by harbour objects implementation that also stores some values that can contain memory references. These data are used to initialize class instance variables and are stored in class shared variables. In special cases when the value of a harbour variable is stored internally in some static area (at C or assembler level), the garbage collector will be not able to scan such values since it doesn't know their location. This could cause some memory blocks to be released prematurely. To prevent the premature deallocation of such memory blocks the static data have to store a pointer to the value created with hb_itemNew() function. Example: static HB_ITEM s_item; /* this item can be released by the GC */ static PHB_ITEM pItem; /* this item will be maintained correctly */ pItem = hb_itemNew( hb_param( 1, IT_BLOCK ) ); However, scanning of all variables can be a time consuming operation. It requires that all allocated arrays have to be traversed through all their elements to find more arrays. Also all codeblocks are scanned for detached local variables they are referencing. For this reason, looking for unreferenced memory blocks is performed during the idle states. The idle state is a state when there is no real application code executed. For example, the user code is stopped for 0.1 of a second during Inkey(0.1) - Harbour is checking the keyboard only during this time. It leaves however quite enough time for many other background tasks. One such background task can be looking for unreferenced memory blocks. Allocating memory </par> ----------------- The garbage collector collects memory blocks allocated with hb_gcAlloc() function calls. Memory allocated by hb_gcAlloc() should be released with hb_gcFree() function. The garbage collecting </par> ---------------------- During scanning of unreferenced memory the GC is using a mark & sweep algorithm. This is done in three steps: 1) mark all memory blocks allocated by the GC with unused flag; 2) sweep (scan) all known places and clear unused flag for memory blocks that are referenced there; 3) finalize collecting by deallocation of all memory blocks that are still marked as unused and that are not locked. To speed things up, the mark step is simplified by swapping the meaning of the unused flag. After deallocation of unused blocks all still alive memory blocks are marked with the same 'used' flag so we can reverse the meaning of this flag to 'unused' state in the next collecting. All new or unlocked memory blocks are automatically marked as 'unused' using the current flag, which assures that all memory blocks are marked with the same flag before the sweep step will start. See hb_gcCollectAll() and hb_gcItemRef() Calling the garbage collector from harbour code </par> ----------------------------------------------- The garbage collector can be called directly from the harbour code. This is usefull in situations where there is no idle states available or the application is working in the loop with no user interaction and there is many memory allocations. See hb_gcAll() for explanation of how to call this function from your harbour code.
Examples:
Status:
Compliance:
Files:
See also:hb_gcAlloc(),hb_gcFree(),hb_gcCollectAll(),hb_gcItemRef(),hb_gcAll(),hb_idleState()
Back to index


The idle states

Lang:idle.txt
Component:harbour
Doc. source:.\doc\en\idle.txt
Template:Document
Category:Document
Subcategory:
Oneliner:Read me file for Idle States
Syntax:
Arguments:
Returns:
Description:The idle state is the state of the harbour virtual machine when it waits for the user input from the keyboard or the mouse. The idle state is entered during Inkey() calls currently. All applications that don't use Inkey() function call can signal the idle states with the call of hb_idleState() function (or hb_idleState() on C level). During idle states the virtual machine calls the garbage collector and it can call user defined actions (background tasks). It also releases the CPU time slices for some poor platforms that are not smart enough to detect it automatically. For defining the background tasks see the hb_idleAdd() and hb_idleDel() functions. For direct call for background actions see hb_idleState() function. For signaling the idle state from C code see the hb_idleState() API function.
Examples:
Status:
Compliance:
Files:
See also:hb_idleAdd(),hb_idleDel()
Back to index


Compiler Options

Lang:compiler.txt
Component:harbour
Doc. source:.\doc\en\compiler.txt
Template:Document
Category:Document
Subcategory:Compiler
Oneliner:Compiler Options
Syntax:
Arguments:
Returns:
Description:<b>Invoking the Harbour compiler: </b> </par> ============================== </par> harbour <file[.prg]> [options] </par> or </par> harbour [options] <file[.prg]> </par> or </par> harbour [options] <file[.prg]> [options] </par> The command line options have to be separated by at least one space. The option can start with either '/' character or '-' character. <b>The Harbour command line options: </b> </par> ================================= </par> /a automatic memvar declaration </par> ================= </par> This causes all variables declared by PARAMETER, PRIVATE or PUBLIC statements to be automatically declared as MEMVAR variables. /b debug info </par> ================= </par> The compiler generates all information required for debugging /build display detailed version info </par> ================= </par> /credits display credits </par> ================= </par> /d<id>[=<val>] #define <id> </par> ================= </par> /es[<level>] set exit severity </par> ================= </par> /es or /es0 - all warnings are ignored and exit code returned by the compiler is equal to 0 if there are no errors in compiled source file. /es1 - any warnings generate a non-zero exit code, but output is still created. /es2 - all warnings are treated as errors and no output file is created. The exit code is set to a non-zero value. /fn[:[l|u]|-] set filename casing (l=lower u=upper) </par> ================= </par> /fd[:[l|u]|-] set directory casing (l=lower u=upper) </par> ================= </par> /fp[:<char>] set path separator </par> ================= </par> /fs[-] turn filename space trimming on or off (default) </par> ================= </par> /g<type> output type generated is <type> </par> ================= </par> /gc[<type>] output type: C source (.c) (default) <type>: 0=compact (default) 1=normal 2=verbose 3=generate real C code /gh output type: Harbour Portable Object (.hrb) /gd[.<destext>] generate dependencies list into (.d) file /ge[<mode>] error output <mode>: 0=Clipper (default) 1=IDE friendly /i<path> #include file search path </par> ================= </par> /i[-|+] disable/enable support for INCLUDE envvar </par> ================= </par> /j[<file>] generate i18n gettext file (.pot) </par> ================= </par> /k<mode> compilation mode (type -k? for more data) </par> ================= </par> /kc clear all flags (strict Clipper mode) /kh Harbour mode (default) /ko allow operator optimizations /ki enable support for HB_INLINE (default) /kr runtime settings enabled /ks allow indexed assignment on all types /kx extended Xbase++ mode (default) /ku strings in user encoding /kd accept macros with declared symbols /km turn off macrotext substitution /kj turn off jump optimization in pcode /k? this info /l suppress line number information </par> ================= </par> The compiler does not generate the source code line numbers in the output file. The ProcLine() function will return 0 for modules compiled using this option. /m compile module only </par> ================= </par> /n[<type>] no implicit starting procedure </par> ================= </par> <type>: 0=no implicit starting procedure 1=no starting procedure at all 2=add starting procedure if necessary The compiler does not create a procedure with the same name as the compiled file. This means that any declarations placed before the first PROCEDURE or FUNCTION statement have file- wide scope and can be accessed/used in all functions/procedures defined in the compiled source file. All executable statements placed at the beginning of the file and before the first PROCEDURE/FUNCTION statement are ignored. /o<path> object file drive and/or path </par> ================= </par> /p generate pre-processed output (.ppo) file </par> ================= </par> The compiler only creates the file that contains the result of pre-processing the source file. /p+ generate pre-processor trace (.ppt) file </par> ================= </par> /q quiet </par> ================= </par> The compiler does not print any messages during compiling (except the copyright info). /q0 quiet and don't display program header /q2 disable all output messages /r[<lib>] request linker to search <lib> (or none) </par> ================= </par> Currently not supported in Harbour. /r=<max> sets maximum number of preprocessor iterations </par> ================= </par> This set the maximum number of preprocessor iterations during processing the source code. If this switch is not used then the preprocessor stops after 1024 iterations. This value is used to stop processing of infinite loops, for example: #command ( => (,7 /s[m] syntax check only [minimal for dependencies list] </par> ================= </par> The compiler checks the syntax only. No output file is generated. /t<path> path for temp file creation </par> ================= </par> Currently not used in Harbour (the Harbour compiler does not create any temporary files). /u[<file>] use command def set in <file> (or none) </par> ================= </par> /u+<file> add command def set from <file> </par> ================= </par> /undef:<id> #undef <id> </par> ================= </par> /v variables are assumed M-> </par> ================= </par> All undeclared or unaliased variables are assumed MEMVAR variables (private or public variables). If this switch is not used then the scope of such variables is checked at runtime. /w[<level>] set warning level number (0..3, default 1) </par> ================= </par> /w0 - no warnings /w or /w1 - CA-Cl*pper compatible warnings /w2 - some useful warnings missed in CA-Cl*pper /w3 - warnings generated for Harbour language extensions and also enables strong type checking but only warns against declared types, or types which may be calculated at compile time /x[<prefix>] set symbol init function name prefix (for .c only) </par> ================= </par> Sets the prefix added to the generated symbol init function name (in C output currently). This function is generated automatically for every PRG module compiled. This additional prefix can be used to suppress problems with duplicated symbols during linking an application with some third party libraries. /z suppress shortcutting (.and. & .or.) </par> ================= </par> Compilation in batch mode. </par> ========================== </par> @<file> compile list of modules in <file> </par> ================= </par> Not supported yet. <b>Known incompatibilities between Harbour and CA-Cl*pper compilers </b> </par> ============================================================= </par> NOTE: </par> If you want a 100% compatible runtime libraries then you have to define HB_CLP_STRICT, using 'HB_USER_CFLAGS=-DHB_CLP_STRICT', then rebuild. <b>Passing an undeclared variable by the reference </b> </par> =============================================== </par> The CA-Cl*pper compiler uses the special opcode PUSHP to pass a reference to an undeclared variable ( '@' operator ). The type of passed variable is checked at runtime (field or memvar). However, field variables cannot be passed by reference. This means that CA-Cl*pper checks the memvar variable only and doesn't look for a field. This is the reason why the Harbour compiler uses the usual PUSHMEMVARREF opcode in such cases. Notice that the runtime behavior is the same in CA-Cl*pper and in Harbour - only the generated opcodes are different. Handling of object messages </par> =========================== </par> The HB_CLP_STRICT setting determines the way chained send messages are handled. For example, the following code: a:b( COUNT() ):c += 1 will be handled as: a:b( COUNT() ):c := a:b( COUNT() ):c + 1 in strict CA-Cl*pper compatibility mode and temp := a:b( COUNT() ), temp:c += 1 in non-strict mode. In practice, CA-Cl*pper will call the COUNT() function two times: the first time before addition and the second one after addition. In Harbour, COUNT() will be called only once, before addition. The Harbour (non-strict) method is: </par> 1) faster </par> 2) it guarantees that the same instance variable of the same object will be changed (See also: src/compiler/expropt.c) <b>Initialization of static variables </b></par> ================================== </par> There is a difference in the initialization of static variables that are initialized with a codeblock that refers to a local variable. For example: <fixed> PROCEDURE Main() LOCAL MyLocalVar STATIC s_MyStaticVar := {|| MyLocalVar } MyLocalVar := 0 ? Eval( s_MyStaticVar ) RETURN </fixed> The above code compiles fine in CA-Cl*pper, but it generates a runtime error Error/BASE 1132 Bound error: array access Called form (b)STATICS$(0) In Harbour this code generates a compile time error: Error E0009 Illegal variable (b) initializer: 'MyLocalVar' Both CA-Cl*pper and Harbour are handling all local variables used in a codeblock in a special way: they are detached from the local stack of function/procedure where they are declared. This allows access to these variables after the exit from a function/procedure. However, all static variables are initialized in a separate procedure ('STATICS$' in CA-Cl*pper and '(_INITSTATICS)' in Harbour) before the main procedure and before all INIT procedures. The local variables don't exist on the eval stack when static variables are initialized, so they cannot be detached.
Examples:
Status:
Compliance:
Files:
See also:
Back to index


Macro compiler

Lang:macro.txt
Component:harbour
Doc. source:.\doc\en\macro.txt
Template:Document
Category:Document
Subcategory:Compiler
Oneliner:Macro compiler
Syntax:
Arguments:
Returns:
Description:<b>Invoking the macro compiler: </b> </par> ============================== </par> &variable </par> or </par> &( expression ) </par> or </par> &variable.text </par>
Examples:
Status:
Compliance:
Files:
See also:
Back to index


CD

Lang:ht_file.txt
Component:hbmisc
Doc. source:hbmisc\doc\en\ht_file.txt
Template:
Category:Dos Tools
Subcategory:
Oneliner:Change the Current Directory
Syntax:CD( <cDir> ) --> lSuccess
Arguments:<cDir> DIR TO BE CHANGED
Returns:<lSucess> .T. IF SUCCESSFUL; otherwise .F.
Description:CHANGE THE CURRENT DIRECTORY
Examples:IF CD( "OLA" ) RETURN .T. ELSE RETURN .F. ENDIF
Status:
Compliance:
Files:Header is fileio.ch
See also:MD(),RD()
Back to index


MD

Lang:ht_file.txt
Component:hbmisc
Doc. source:hbmisc\doc\en\ht_file.txt
Template:
Category:Dos Tools
Subcategory:
Oneliner:Creates a Directory
Syntax:MD( <cDir> ) -> <lSucess>
Arguments:<cDir> DIRECTORY TO BE CREATED
Returns:<lSucess> .T. IF SUCCESSFUL; otherwise .F.
Description:CREATE A DIRECTORY
Examples:IF MD( "OLA" ) RETURN .T. ELSE RETURN .F. ENDIF
Status:
Compliance:
Files:Header is fileio.ch
See also:CD(),MD()
Back to index


RD

Lang:ht_file.txt
Component:hbmisc
Doc. source:hbmisc\doc\en\ht_file.txt
Template:
Category:Dos Tools
Subcategory:
Oneliner:Remove a Directory
Syntax:RD( <cDir> ) --> <lSucess>
Arguments:<cDir> DIR TO BE DELETED
Returns:<lSucess> .T. IF SUCCESSFUL; otherwise .F.
Description:REMOVE A DIRECTORY
Examples:IF RD( "OLA" ) RETURN .T. ELSE RETURN .F. ENDIF
Status:
Compliance:
Files:Header is fileio.ch
See also:CD(),MD()
Back to index


ft_ChDir

Lang:chdir.txt
Component:hbnf
Doc. source:hbnf\doc\en\chdir.txt
Template:
Category:DOS/BIOS
Subcategory:
Oneliner:Change the current directory
Syntax:ft_ChDir( <cDirName> ) -> nResult
Arguments:<cDirName> is the name of the desired directory.
Returns:0 if successful 3 if path not found 99 if invalid parameters passed
Description:Use this function if you prefer to change the active directory instead of relying on the SET PATH command. The source code is written to adhere to Turbo Assembler's IDEAL mode. To use another assembler, you will need to rearrange the PROC and SEGMENT directives, and also the ENDP and ENDS directives (a very minor task).
Examples:ft_ChDir( "C:\harbour" ) ft_ChDir( hb_ps() ) ft_ChDir( ".." + hb_ps() + "hbnf" )
Status:
Compliance:
Files:
See also:
Back to index


ft_Default

Lang:default.txt
Component:hbnf
Doc. source:hbnf\doc\en\default.txt
Template:
Category:DOS/BIOS
Subcategory:
Oneliner:Retrieve and optionally change the current default drive
Syntax:ft_Default( [ <cDrive> ] ) -> cDrive
Arguments:<cDrive> is optional, and if specified is the new default drive.
Returns:The current default drive. If a change of default drive is requested, the return value is the drive AFTER the change is made. This allows you to make sure you specified a valid drive (i.e. if you attempt to change the default drive, and the function returns a different drive letter than the one you specified, then the drive does not exist).
Description:Useful any time you need to know or change the default drive.
Examples:cDrive := ft_Default() // Get the current drive ft_Default( "C" ) // Switch to drive C IF !( ft_Default( "E" ) == "E" ) QOut( "Drive E does not exist!" ) ENDIF
Status:
Compliance:
Files:
See also:
Back to index


FT_DOSVER

Lang:dosver.txt
Component:hbnf
Doc. source:hbnf\doc\en\dosver.txt
Template:
Category:DOS/BIOS
Subcategory:
Oneliner:Return the current DOS major and minor version as a string
Syntax:ft_DosVer() -> <cVersion>
Arguments:None
Returns:A character string with the major version number first, a period ("."), then the minor version number (e.g., "3.30")
Description:ft_DosVer() invokes DOS interrupt 21h, service 30 in order to return the current DOS version. It does this by setting up an array corresponding to machine registers and then calling the toolkit function ft_int86(). It returns a character string corresponding to the DOS version, as follows: The major version, a period ("."), then the minor version.
Examples:PROCEDURE Main() ? "Dos version: " + ft_DosVer() RETURN
Status:
Compliance:
Files:
See also:
Back to index


ft_DskFree

Lang:diskfunc.txt
Component:hbnf
Doc. source:hbnf\doc\en\diskfunc.txt
Template:
Category:DOS/BIOS
Subcategory:
Oneliner:Return the amount of available disk space
Syntax:ft_DskFree( [ <cDrive> ] ) -> nSpaceAvail
Arguments:<cDrive> is the fixed disk to query. If no parameter is passed the operation will be performed on the default drive. Do not include the ":".
Returns:Integer representing the available disk space in bytes.
Description:Function to return the available space on the passed drive letter or the default drive if no drive is passed. Uses ft_int86() through the internal function _ftDiskInfo().
Examples:? ft_DskFree() // Returns free space on default drive.
Status:
Compliance:
Files:
See also:
Back to index


ft_DskSize

Lang:diskfunc.txt
Component:hbnf
Doc. source:hbnf\doc\en\diskfunc.txt
Template:
Category:DOS/BIOS
Subcategory:
Oneliner:Return the maximum capacity of a fixed disk
Syntax:ft_DskSize( [ <cDrive> ] ) -> nMaxCapacity
Arguments:<cDrive> is the fixed disk to query. If no drive is sent, the operation will be performed on the default drive. Send without the ":".
Returns:An integer representing the maximum disk capacity in bytes.
Description:Function utilizing ft_int86() to return Maximum Disk Size. Uses ft_int86() through the internal function _ftDiskInfo().
Examples:? ft_DskSize() // Maximum capacity for default drive ? ft_DskSize( "D" ) // Maximum capacity for Drive D:
Status:
Compliance:
Files:
See also:
Back to index


ft_FlopTst

Lang:floptst.txt
Component:hbnf
Doc. source:hbnf\doc\en\floptst.txt
Template:
Category:DOS/BIOS
Subcategory:
Oneliner:Test diskette drive status
Syntax:ft_FlopTst( <nDrive> ) -> nStatus
Arguments:<nDrive> is the diskette drive number, 0 = A:, 1 = B:
Returns:-1 - Wrong Parameters 0 - Drive Loaded and ready to read or write 1 - Drive Door Open or Diskette inserted upside down 2 - Diskette is unformatted 3 - Write protected 4 - Undetermined
Description:ft_FlopTst() is designed as a full replacement for ISDRIVE(). Where ISDRIVE() returns just .T. or .F. depending if the diskette drive is ready or not, ft_FlopTst() returns a numeric code designating the diskette drive's status. ft_FlopTst() is particularly useful in backup and restore programs that need to test the floppy drive before writing/reading from a floppy disk. No testing has been performed on systems with more than 2 floppy drives. If the third drive is "C" and the fourth "D" then there should be no problems. This function does not currently check subst'd drives. So if you have SUBST E: A:\ then ft_FlopTst( Asc( "E" ) - Asc( "A" ) ) == 4 Any suggestions to fix this limitation are appreciated.
Examples:iStatus := ft_FlopTst( 0 ) DO CASE CASE iStatus == 1 ? "The door to drive A is open." CASE iStatus == 2 ? "The diskette in drive A is not formatted." CASE iStatus == 3 ? "The diskette in drive A is write-protected." CASE iStatus == 4 ? "Something is wrong with drive A, but I don't know what." ENDCASE
Status:
Compliance:
Files:
See also:
Back to index


ft_IAmIdle

Lang:iamidle.txt
Component:hbnf
Doc. source:hbnf\doc\en\iamidle.txt
Template:
Category:DOS/BIOS
Subcategory:
Oneliner:Inform the operating system that the application is idle.
Syntax:ft_IAmIdle() -> lSuccess
Arguments:None
Returns:.T. if supported, .F. otherwise.
Description:Some multitasking operating environments (e.g. Windows or OS/2) can function more efficiently when applications release the CPU during idle states. This function allows you "announce" to the operating system that your application is idle. Note that if you use this function in conjunction with FT_OnIdle(), you can cause Clipper to automatically release the CPU whenever Clipper itself detects an idle state.
Examples:DO WHILE Inkey() != K_ESC ft_IAmIdle() // Wait for ESC and announce idleness ENDDO // Here's another way to do it: FT_OnIdle( {|| ft_IAmIdle() } ) Inkey( 0 ) // Automatically reports idleness until key is pressed!
Status:
Compliance:
Files:
See also:FT_OnIdle()
Back to index


ft_inp

Lang:inp.txt
Component:hbnf
Doc. source:hbnf\doc\en\inp.txt
Template:
Category:DOS/BIOS
Subcategory:
Oneliner:Retrieve a byte from a specified I/O port
Syntax:ft_inp( <nPort> ) -> nValue
Arguments:<nPort> is the port from which to retrieve the byte. If it is invalid in any way, the function will return zero.
Returns:The byte retrieved.
Description:It may sometimes be useful to read a byte from a port without having to resort to C or assembler. This function allows you to do so. The source code is written to adhere to Turbo Assembler's IDEAL mode. To use another assembler, you will need to rearrange the PROC and SEGMENT directives, and also the ENDP and ENDS directives (a very minor task).
Examples:byte := ft_inp( 100 ) // read a byte from port 100 (064h)
Status:
Compliance:
Files:
See also:ft_outp()
Back to index


ft_int86

Lang:cint86.txt
Component:hbnf
Doc. source:hbnf\doc\en\cint86.txt
Template:
Category:DOS/BIOS
Subcategory:
Oneliner:Execute a software interrupt
Syntax:ft_int86( <nInterruptNumber>, <aRegisterValues> ) -> lResult
Arguments:<nInterruptNumber> is the interrupt to execute. <aRegisterValues> is an array that contains values to be loaded into the various CPU registers. The correspondence between registers and array elements is as follows: aElement[1] == AX register aElement[2] == BX register aElement[3] == CX register aElement[4] == DX register aElement[5] == SI register aElement[6] == DI register aElement[7] == BP register aElement[8] == DS register aElement[9] == ES register aElement[10] == Flags register
Returns:.T. if all parameters valid and the function was able to execute the desired interrupt. .F. if invalid parameters passed. If you call this function in protected mode, .F. may also be returned if an allocation of low DOS memory fails. n addition, the array elements will contain whatever values were in he CPU registers immediately after the interrupt was executed. If ither of the string parameters were altered by the interrupt, these hanges will be reflected as well.
Description:It is occasionally useful to be able to call interrupts directly from Clipper, without having to write a separate routine in C or ASM. This function allows you that capability. Given Clipper's high-level orientation, this function is necessarily somewhat messy to use. First, declare an array of ten elements to hold the eight values for the CPU registers and two string parameters. Then initialize the array elements with the values that you want the CPU registers to contain when the interrupt is executed. You need not initialize all the elements. For example, if the interrupt requires you to specify values for AX, DX, and DS, you would only need to initialize elements 1, 4, and 8. Once you have done the required register setup, call ft_int86(), passing the interrupt number and the register array as parameters. The function will load the CPU with your specified values, execute the interrupt, and then store the contents of the CPU registers back into your array. This will allow you to evaluate the results of the interrupt. Some interrupt services require you to pass the address of a string in a pair of registers. This function is capable of handling these sorts of situations, but it will take a little work on your part. If you need to pass a string that uses the DS register, store the string in element 8; if you need to pass a string that uses the ES register, store the string in element 9. ft_int86() will detect that you've supplied a string instead of a numeric value and will behave accordingly. That takes care of obtaining the segment portion of the pointer. To specify which register is to contain the offset, use the values REG_DS and REG_ES which are defined in the ftint86.ch file. When one of these values is found in an array element, it alerts ft_int86() to use the offset portion of a pointer instead of a numeric value. REG_DS tells ft_int86() to use the offset of the string in element 8, while REG_ES tells ft_int86() to use the offset of the string in element 9. All the CPU registers are sixteen bits in size. Some, however, are also split into two 8-bit registers. This function is only capable of receiving and returning registers that are 16 bits in size. To split a 16-bit register into two 8-bit values, you can use the pseudo-functions HighByte() and LowByte(), contained in the .ch file. To alter an 8-bit number so it will appear in the high-order byte of a register when passed to the ft_int86() function, use the MakeHI() pseudo-function contained in the .ch file. When run in real mode, this function is a shell for __ftint86(), which is written in assembler and does the actual work of executing the interrupt. __ftint86() is callable from C, so feel free to incorporate it into any C routines for which it might be useful. The source for __ftint86() can be found in the file AINT86.ASM. When run in protected mode, this function is a shell for cpmiInt86(), which is written in assembler and makes a DPMI call to drop into real mode and execute the interrupt. cpmiInt86() is also callable from C, so feel free to incorporate it into any C routines for which it might be useful. cpmiInt86() is part of the CPMI API. See the CPMI documentation for more information.
Examples:// This example shows how to call the DOS "create file" service. Take // special note of how to set up string parameters. #include "ftint86.ch" LOCAL aRegs[ 10 ] // Declare the register array aRegs[ AX ] := makehi( 60 ) // DOS service, create file aRegs[ CX ] := 0 // Specify file attribute // Pay attention here, this is crucial. Note how to set up the string // so it appears in DS:DX. aRegs[ DS ] := "C:\misc\myfile.xxx" aRegs[ DX ] := REG_DS ft_int86( 33, aRegs ) // Make the call to the DOS interrupt // This example shows how to call the DOS "get current directory" // service. This one also uses a string parameter, but note that it // uses a different offset register. #include "ftint86.ch" LOCAL aRegs[ 10 ] aRegs[ AX ] := makehi( 71 ) aRegs[ DX ] := 0 // Choose default drive // This service requires a 64-byte buffer whose address is in DS:SI. DOS // will fill the buffer with the current directory. aRegs[ DS ] := Space( 64 ) aRegs[ SI ] := REG_DS ft_int86( 33, aRegs ) ? aRegs[ DS ] // Display the directory name // For the sake of completeness, here's an example that doesn't use a // string. This one changes the video mode. #include "ftint86.ch" LOCAL aRegs[ 10 ] aRegs[ AX ] := 16 // Choose hi-res graphics ft_int86( 16, aRegs )
Status:
Compliance:
Files:
See also:
Back to index


ft_IsPrint

Lang:isprint.txt
Component:hbnf
Doc. source:hbnf\doc\en\isprint.txt
Template:
Category:DOS/BIOS
Subcategory:
Oneliner:Check printer status
Syntax:ft_IsPrint( [ <cDevice> ] ) -> lResult
Arguments:<cDevice> is optional and is the device to test (LPT2, COM1, etc.). If omitted, the function will default to the PRN device.
Returns:.T. if device is ready for output. .F. if one of the following conditions occurs: 1) The device is not ready. 2) The device does not exist. 3) DOS couldn't open the device for some reason (such as no file handles available).
Description:The Clipper IsPrinter() function is somewhat limited because it only works with LPT1. Furthermore, it talks directly to the hardware, so if you have redirected LPT1 via the DOS MODE command, the IsPrinter() function will return erroneous results. This function offers a better alternative. Instead of talking to the hardware, it issues a DOS call that checks to see if the device is ready or not. That gives DOS an opportunity to deal with any redirections, and since you pass the device name as a parameter, you can test any device, not just LPT1 (note that the function defaults to PRN if you fail to pass a valid parameter). The function also temporarily traps the DOS critical error handler so you don't get any nasty error messages if the device isn't ready. It restores the old critical error handler before exiting. Note that although this function is mainly designed for testing printers, you can also check to see if a drive is ready. Since DOS thinks the NUL device exists on every drive, you can pass a drive letter followed by NUL as a parameter. If DOS is able to open the NUL device, then the drive is ready, otherwise the door is open or something else is wrong. The source code is written to adhere to Turbo Assembler's IDEAL mode. To use another assembler, you will need to rearrange the PROC and SEGMENT directives, and also the ENDP and ENDS directives (a very minor task).
Examples:IF ! ft_IsPrint() ? "PRN is not ready!" ENDIF IF ! ft_IsPrint( "COM2" ) ? "Check the device on COM2. Something is wrong." ENDIF IF ! ft_IsPrint( "A:\nul" ) ? "Oops, better check drive A!" ENDIF
Status:
Compliance:
Files:
See also:
Back to index


ft_IsShare

Lang:isshare.txt
Component:hbnf
Doc. source:hbnf\doc\en\isshare.txt
Template:
Category:DOS/BIOS
Subcategory:
Oneliner:Determine if DOS "Share" is installed
Syntax:ft_IsShare() -> nRetCode
Arguments:None
Returns:nRetcode will be set as follows on exit: 0 if SHARE not loaded but ok to load 1 if SHARE not loaded and not ok to load 255 if SHARE loaded
Description:Uses DOS interrupt 2Fh (MultiPlex interrupt), service 10h to determine if DOS SHARE.COM is loaded.
Examples:IF ft_IsShare() != 255 ? "SHARE must be loaded!" ENDIF
Status:
Compliance:
Files:
See also:ft_int86()
Back to index


ft_MkDir

Lang:mkdir.txt
Component:hbnf
Doc. source:hbnf\doc\en\mkdir.txt
Template:
Category:DOS/BIOS
Subcategory:
Oneliner:Create a subdirectory
Syntax:ft_MkDir( <cDirName> ) -> nResult
Arguments:<cDirName> is the name of the directory to create.
Returns:0 if successful 3 if Path Not Found 5 if Access Denied or directory already exists 99 if invalid parameters passed
Description:Use this function to create the subdirectories needed by your application. It might be especially useful in an installation program. The source code is written to adhere to Turbo Assembler's IDEAL mode. To use another assembler, you will need to rearrange the PROC and SEGMENT directives, and also the ENDP and ENDS directives (a very minor task).
Examples:ft_MkDir( "C:\clipper" ) ft_MkDir( "\example" ) ft_MkDir( "..\source" )
Status:
Compliance:
Files:
See also:
Back to index


ft_outp

Lang:outp.txt
Component:hbnf
Doc. source:hbnf\doc\en\outp.txt
Template:
Category:DOS/BIOS
Subcategory:
Oneliner:Write a byte to a specified I/O port
Syntax:ft_outp( <nPort>, <nValue> ) -> lResult
Arguments:<nPort> is the port from which to retrieve the byte. <nValue> is the value between 0 and 255 to write to the port.
Returns:.T. if all parameters were valid and the byte was written to the port. .F. if invalid parameters were passed.
Description:It may sometimes be useful to write a byte to a port without having to resort to C or assembler. This function allows you to do so. The source code is written to adhere to Turbo Assembler's IDEAL mode. To use another assembler, you will need to rearrange the PROC and SEGMENT directives, and also the ENDP and ENDS directives (a very minor task).
Examples:lOk := ft_outp( 0x64, 0 ) // send a hb_BChar( 0 ) to port 100 (0x64)
Status:
Compliance:
Files:
See also:ft_inp()
Back to index


ft_Peek

Lang:peek.txt
Component:hbnf
Doc. source:hbnf\doc\en\peek.txt
Template:
Category:DOS/BIOS
Subcategory:
Oneliner:Retrieve a byte from a specified memory location.
Syntax:ft_Peek( <nSegment>, <nOffset> ) -> nValue
Arguments:<nSegment> is the segment of the desired memory address. <nOffset> is the offset of the desired memory address.
Returns:<nValue> will be a value from 0 to 255 if all parameters were valid and the function was able to retrieve the desired byte. <nValue> will be -1 if invalid parameters were passed.
Description:Use this function if you have a need to examine a specific memory location. The function will return the byte at the specified address as a numeric value. If you need this value as a character, use the hb_BChar() function to convert it.
Examples:LOCAL nVMode := ft_Peek( 0, 0x449 ) // Get the current video mode (MS-DOS)
Status:
Compliance:
Files:
See also:
Back to index


ft_Poke

Lang:poke.txt
Component:hbnf
Doc. source:hbnf\doc\en\poke.txt
Template:
Category:DOS/BIOS
Subcategory:
Oneliner:Write a byte to a specified memory location
Syntax:ft_Poke( <nSegment>, <nOffset>, <nValue> ) -> lResult
Arguments:<nSegment> is the segment of the desired memory address. <nOffset> is the offset of the desired memory address. <nValue> is the value to write to the desired memory address.
Returns:<lResult> will be .T. if all parameters were valid and the function was able to write the desired byte. <lResult> will be .F. if invalid parameters were passed.
Description:Use this function if you have a need to change the value at a specific memory location. The function will write the specified byte to the specified address. The value must be passed as a numeric; if the byte you wish to use is stored as a character, use the hb_BCode() function to convert it.
Examples:ft_Poke( 0, 0x417, 0x40 ) // Turn CapsLock on (MS-DOS)
Status:
Compliance:
Files:
See also:
Back to index


ft_Reboot

Lang:reboot.txt
Component:hbnf
Doc. source:hbnf\doc\en\reboot.txt
Template:
Category:DOS/BIOS
Subcategory:
Oneliner:Force a warm or cold boot
Syntax:ft_Reboot( <nBootType> ) -> NIL
Arguments:<nBootType> is used to indicate the type of reboot. A value of zero will cause a cold boot, while any other value will cause a warm boot.
Returns:NIL
Description:This function is valuable if you need to reboot the PC for some reason; e.g. an installation routine that modifies CONFIG.SYS or AUTOEXEC.BAT. The source code is written to adhere to Turbo Assembler's IDEAL mode. To use another assembler, you will need to rearrange the PROC and SEGMENT directives, and also the ENDP and ENDS directives (a very minor task).
Examples:#define COLD 0 #define WARM 1 // Issue a warm boot ft_Reboot( WARM )
Status:
Compliance:
Files:
See also:
Back to index


ft_RmDir

Lang:rmdir.txt
Component:hbnf
Doc. source:hbnf\doc\en\rmdir.txt
Template:
Category:DOS/BIOS
Subcategory:
Oneliner:Delete a subdirectory
Syntax:ft_RmDir( <cDirName> ) -> nResult
Arguments:<cDirName> is the name of the directory to delete.
Returns:0 if successful 3 if Path Not Found 5 if Access Denied (directory not empty) 16 if attempt to delete current directory. 99 if invalid parameters passed
Description:This function is useful if you need to remove a subdirectory for some reason. The source code is written to adhere to Turbo Assembler's IDEAL mode. To use another assembler, you will need to rearrange the PROC and SEGMENT directives, and also the ENDP and ENDS directives (a very minor task).
Examples:ft_RmDir( "C:\clipper" ) ft_RmDir( "\example" ) ft_RmDir( "..\source" )
Status:
Compliance:
Files:
See also:
Back to index


ft_SetDate

Lang:setdate.txt
Component:hbnf
Doc. source:hbnf\doc\en\setdate.txt
Template:
Category:DOS/BIOS
Subcategory:
Oneliner:Set the DOS system date
Syntax:ft_SetDate( <dDate> ) -> <lResult>
Arguments:<dDate> is a Clipper date variable that you want to set the current DOS system date to. It is up to you to send in a valid date. The year must be within the range 1980 through 2099. If DOS thinks the date is not valid, it won't change the date.
Returns:<lResult> is simply the result of ft_int86(), passed back to your program.
Description:ft_SetDate() uses NANFOR.LIB's ft_int86() function to invoke the DOS Set Date service (Interrupt 33, service 43).
Examples:// The following program takes a date from the command line and sets // the DOS system date: PROCEDURE Main( cDate ) cDate := iif( cDate == NIL, DToS( Date() ), cDate ) ? "Setting date to: " + cDate + "... " ft_SetDate( hb_SToD( cDate ) ) ? "Today is now: " + DToC( Date() ) RETURN
Status:
Compliance:
Files:
See also:
Back to index


ft_SetTime

Lang:settime.txt
Component:hbnf
Doc. source:hbnf\doc\en\settime.txt
Template:
Category:DOS/BIOS
Subcategory:
Oneliner:Set the DOS system time
Syntax:ft_SetTime( <cTime> ) -> <lResult>
Arguments:<cTime> is a string in the form <hh:mm:ss> that you want to set the current DOS system time to. Use 24-hour time. It is up to you to send in a valid time. If DOS doesn't think it is valid, it won't reset the time anyway.
Returns:<lResult> is simply the result of ft_int86(), passed back to your program.
Description:ft_SetTime() uses NANFOR.LIB's ft_int86() function to invoke the DOS Set Time service (Interrupt 33, service 45).
Examples:// The following program takes a time string from the command line and sets // the DOS system time: PROCEDURE Main( cTime ) cTime := iif( cTime == NIL, Time(), cTime ) ? "Setting time to: " + cTime + "... " ft_SetTime( cTime ) ? "Time is now: " + Time() RETURN
Status:
Compliance:
Files:
See also:
Back to index


ft_SysMem

Lang:sysmem.txt
Component:hbnf
Doc. source:hbnf\doc\en\sysmem.txt
Template:
Category:DOS/BIOS
Subcategory:
Oneliner:Determine the amount of conventional memory installed
Syntax:ft_SysMem() -> nMemSize
Arguments:None
Returns:A numeric corresponding to the number of K memory.
Description:ft_SysMem() simply reports the amount of conventional memory (up to 640K) installed. ft_SysMem() uses DOS interrupt 12h to get this information. For information, refer to Peter Norton's _Programmer's Guide to the IBM PC_ (Brady).
Examples:? "Conventional memory installed: " + Str( ft_SysMem() ) + "K"
Status:
Compliance:
Files:
See also:
Back to index


ft_TempFil

Lang:tempfile.txt
Component:hbnf
Doc. source:hbnf\doc\en\tempfile.txt
Template:
Category:DOS/BIOS
Subcategory:
Oneliner:Create a file with a unique name
Syntax:ft_TempFil( [ <cPath> ] [, <lHide> ] ) -> cFileSpec
Arguments:<cPath> is the directory where you want to create the temporary file. If you omit this argument, the root of the current drive is assumed ("\"). If <lHide> is .T., then the file will be created with the hidden attribute set. The default is .F.
Returns:<cFileSpec> should be your path, including the name of the newly created unique file. Use this with FOpen(), etc. If a DOS error occurred when trying to create the file, a null string will be returned.
Description:This function uses DOS Interrupt 21, service 5Ah (Create temporary file) to create a unique filename in a directory you specify. There will be no extension. After the file is created, you may then FOpen() it and do any i/o you need (see the test driver in the source code). This function requires ft_int86().
Examples:// Create a unique file in the root of the current drive: myFile := ft_TempFil() // Create a unique file in the current directory and hide it: myFile := ft_TempFil( "." + hb_ps(), .T. ) // Create a unique file on another drive, but do not hide it: myFile := ft_TempFil( "E:\nanfor\src\" )
Status:
Compliance:
Files:
See also:
Back to index


ft_GetE

Lang:getenvrn.txt
Component:hbnf
Doc. source:hbnf\doc\en\getenvrn.txt
Template:
Category:Environment
Subcategory:
Oneliner:Return the entire current environment
Syntax:ft_GetE( [ @<xReceiveVar> ] ) -> nNumStrings
Arguments:<xReceiveVar> is the variable to receive the environment data. <xReceiveVar> can be a character type variable, in which case the function will place all environment strings in the variable separated by carriage return/line feeds (Chr( 13 ) + Chr( 10 )). <xReceiveVar> can be an array type, in which case the function will place each string in an array element. The array MUST be declared with the proper number of elements prior to passing it to the function. This can be done by calling ft_GetE() without parameters first to get the number of strings in the environment. Note that the argument MUST be passed by reference. Since arrays are by nature passed by reference, the "@" symbol is optional when passing an array. If no argument is passed, ft_GetE() merely returns the number of strings in the environment.
Returns:ft_GetE() returns the total number of strings found in the current program's environment.
Description:This function stores ALL of the current program's environment variables in either a block of text lines or in an array. It is useful for looking at the entire environment at once, or recording a snapshot of it to a file for later inspection, such as when a program error occurs. If the value of ONE SPECIFIC variable is desired, use Clipper's built-in GetE() function.
Examples:// Get the environment in text form and browse it: cEnvBlock := "" nNumStrings := ft_GetE( @cEnvBlock ) @ 0, 0 TO MaxRow() - 1, MaxCol() @ MaxRow(), 0 SAY 'Browse strings, press ESC to exit...' MemoWrit( cEnvBlock, 1, 1, MaxRow() - 2, MaxCol() - 1, .F. ) // Get the environment in text form and write it to a file: cEnvBlock := "" ft_GetE( @cEnvBlock ) MemoWrit( "environ.txt", cEnvBlock ) // Get the environment in Array form: aEnvArray := Array( ft_GetE() ) ft_GetE( aEnvArray ) ? aEnvArray[ 1 ] // "COMSPEC=C:\command.com" ? aEnvArray[ 2 ] // "PATH=C:\;C:\util;C:\harbour" ... etc ...
Status:
Compliance:
Files:
See also:
Back to index


ft_Linked

Lang:linked.txt
Component:hbnf
Doc. source:hbnf\doc\en\linked.txt
Template:
Category:Environment
Subcategory:
Oneliner:Determine if a function was linked in
Syntax:ft_Linked( <cString> ) -> lResult
Arguments:<cString> is a character string containing one or more function calls
Returns:.T. if all functions within the string are currently linked into the application, .F. if one or more aren't. See below for a definition of "function."
Description:This function would be used in data driven application to determine whether or not a macro compiled function was linked in. Several functions can be passed, and nested, in <cString>. Caveat: Some function calls are converted by the preprocessor into other function calls. You cannot have these types of functions in a macro compiled string as they never exist at runtime. ft_Linked() will correctly tell you that they are invalid. For instance: there is no function called SORT() in any of the Nantucket Libraries, but it is a valid CLIPPER command because the preprocessor will convert it to other function calls.
Examples:cString := "FT_GoodFunc( BadFunc( 3, 2 ) )" IF ft_Linked( cString ) Eval( &( "{||" + cString + "}" ) ) ELSE Alert( "Error: " + cString + " was not linked in. Called by ft_Linked()" ) ENDIF
Status:
Compliance:
Files:
See also:
Back to index


ft_Origin

Lang:origin.txt
Component:hbnf
Doc. source:hbnf\doc\en\origin.txt
Template:
Category:Environment
Subcategory:
Oneliner:Report the drive, path and filename of the current program
Syntax:ft_Origin() -> cString
Arguments:None
Returns:A string containing the full drive/directory/filename of the currently executing file.
Description:Often users will install multiple copies of application software, especially on networks and in situations where the user is trying to get around a copy protection scheme. This function enables you to learn the name and source location of the currently executing file, so that you may take whatever action you need to.
Examples:cMyFile := ft_Origin() IF !( cMyFile == "C:\appdir\myfile.exe" ) ? "Incorrect startup file. Please remove/rename and start again" QUIT ENDIF
Status:
Compliance:
Files:
See also:
Back to index


ft_RestSets

Lang:restsets.txt
Component:hbnf
Doc. source:hbnf\doc\en\restsets.txt
Template:
Category:Environment
Subcategory:
Oneliner:Restore status of all SET command settings
Syntax:ft_RestSets( [ <aOldSets> ] ) -> NIL
Arguments:aOldSets is an array of SET settings created by ft_SaveSets()
Returns:NIL
Description:This function "restores" the SET Settings, i.e., it sets them to the values in the array aOldSets. The following SETs are not currently supported: FILTER, FORMAT, FUNCTION, INDEX, KEYS, MODE, ORDER, PROCEDURE, RELATION, TYPEAHEAD
Examples:ft_RestSets( aOldSets )
Status:
Compliance:
Files:
See also:ft_SaveSets() ft_SetCentury()
Back to index


ft_SaveSets

Lang:savesets.txt
Component:hbnf
Doc. source:hbnf\doc\en\savesets.txt
Template:
Category:Environment
Subcategory:
Oneliner:Save the status of all the SET command settings
Syntax:ft_SaveSets() -> aOldSets
Arguments:None
Returns:An array containing the values of the supported SETs.
Description:This function saves the SET Settings, i.e., it copies them into an array, aOldSets. The following SETs are not currently supported: FILTER, FORMAT, FUNCTION, INDEX, KEYS, MODE, ORDER, PROCEDURE, RELATION, TYPEAHEAD
Examples:aOldSets := ft_SaveSets()
Status:
Compliance:
Files:
See also:ft_RestSets() ft_SetCentury()
Back to index


ft_SetCentury

Lang:cntryset.txt
Component:hbnf
Doc. source:hbnf\doc\en\cntryset.txt
Template:
Category:Environment
Subcategory:
Oneliner:Check/Set the CENTURY Setting
Syntax:ft_SetCentury( [ <lNewSetState> ] ) -> <lOldState>
Arguments:lNewSetState - Boolean to Set CENTURY .F. - Toggle CENTURY off .T. - Toggle CENTURY on If not specified, leave CENTURY as is
Returns:The state of the CENTURY setting upon entry to the routine
Description:This function returns the state (ON/OFF, TRUE/FALSE) of the CENTURY and optionally sets it ON or OFF.
Examples:lOldState := ft_SetCentury() // Get current CENTURY Setting lOldState := ft_SetCentury( .T. ) // Get the current CENTURY Setting // and turn it on (set it to TRUE) lOldState := ft_SetCentury( .F. ) // Get the current CENTURY Setting // and turn it off (set it to FALSE)
Status:
Compliance:
Files:
See also:
Back to index


ft_Idle

Lang:idle.txt
Component:hbnf
Doc. source:hbnf\doc\en\idle.txt
Template:
Category:Event
Subcategory:
Oneliner:Generate an idle event to allow incremental garbage collection.
Syntax:ft_Idle()
Arguments:None
Returns:NIL
Description:During memory-intensive operations that do not generate much in the way of idle states, the Clipper runtime may not get a chance to perform garbage collection of discarded memory. This can eventually lead to any of a variety of memory-related internal errors. This function attempts to alleviate the problem by providing a mechanism by which an idle event can be artifically generated at will. The idle event will cause the CA-Cl*pper runtime to perform an incremental memory scavenge. This function makes use of an undocumented interal routine. If this this fact makes you uncomfortable then don't use this function, you miserable jello-spined lump of human debris.
Examples:DO WHILE Whatever // Some batch process Something() // Create 'n' discard a bunch of stuff ft_Idle() // Take out the garbage ENDDO
Status:
Compliance:
Files:
See also:FT_OnIdle()
Back to index


ft_OnTick

Lang:ontick.txt
Component:hbnf
Doc. source:hbnf\doc\en\ontick.txt
Template:
Category:Event
Subcategory:
Oneliner:Evaluate a designated code block at a designated interval.
Syntax:ft_OnTick( bCode, nInterval )
Arguments:<bCode> is the code block to evaluate. <nInterval> is the number of clock ticks to wait between evaluations of the code block.
Returns:NIL
Description:This function effectively allows you to run tasks in the background by transparently and periodically calling a designated routine. To halt the execution of the background function, call ft_OnTick() with no arguments. This function makes heavy use of several undocumented internal routines. If this fact makes you uncomfortable then don't use this function, you quivering sack of cowardly slime.
Examples:// Set up a self-updating on-screen clock ft_OnTick( "CLOCK", 9 ) PROCEDURE Clock() LOCAL nRow := Row() LOCAL nCol := Col() @ 0, 0 SAY Time() SetPos( nRow, nCol ) RETURN
Status:
Compliance:
Files:
See also:
Back to index


ft_DFClose

Lang:dfile.txt
Component:hbnf
Doc. source:hbnf\doc\en\dfile.txt
Template:
Category:File I/O
Subcategory:
Oneliner:Close file displayed by ft_DispFile()
Syntax:ft_DFClose() -> NIL
Arguments:None
Returns:NIL
Description:Closes the file opened by ft_DFSetup()
Examples:#include "inkey.ch" @ 4, 9 TO 11, 71 ft_DFSetup( "test.txt", 5, 10, 10, 70, 1, 7, 15, ; { "A", "a", "B", "b", K_F3 }, .T., 5, 132, 4096 ) cKey := ft_DispFile() ft_DFClose() @ 20, 0 SAY "Key that terminated ft_DispFile() was: " + "[" + cKey + "]"
Status:
Compliance:
Files:
See also:ft_DFSetup() ft_DispFile()
Back to index


ft_DFSetup

Lang:dfile.txt
Component:hbnf
Doc. source:hbnf\doc\en\dfile.txt
Template:
Category:File I/O
Subcategory:
Oneliner:Set up parameters for ft_DispFile()
Syntax:ft_DFSetup( <cInFile>, <nTop>, <nLeft>, <nBottom>, <nRight>, ; <nStart>, <nCNormal>, <nCHighlight>, <cExitKeys>, ; <lBrowse>, <nColSkip>, <nRMargin>, <nBuffSize> ) -> nResult
Arguments:<cInFile> - text file to display (full path and filename) <nTop> - upper row of window <nLeft> - left col of window <nBottom> - lower row of window <nRight> - right col of window <nStart> - line to place highlight at startup <nCNormal> - normal text color (numeric attribute) <nCHighlight> - text highlight color (numeric attribute) <cExitKeys> - terminating key list (each byte of string is a key code) <lBrowse> - act-like-a-browse-routine flag <nColSkip> - col increment for left/right arrows <nRMargin> - right margin - anything to right is truncated <nBuffSize> - size of the paging buffer
Returns:0 if successful, FError() code if not
Description:Note: make sure you allocate a buffer large enough to hold enough data for the number of lines that you have in the window. Use the following formula as a guideline: buffer size = (# of line) + 1 * RMargin This is the smallest you should make the buffer. For normal use, 4096 bytes is recommended
Examples:#include "inkey.ch" @ 4, 9 TO 11, 71 ft_DFSetup( "test.txt", 5, 10, 10, 70, 1, 7, 15, ; { "A", "a", "B", "b", K_F3 }, .T., 5, 132, 4096 ) cKey := ft_DispFile() ft_DFClose() @ 20, 0 SAY "Key that terminated ft_DispFile() was: " + "[" + cKey + "]"
Status:
Compliance:
Files:
See also:ft_DispFile() ft_DFClose()
Back to index


ft_DispFile

Lang:dispc.txt
Component:hbnf
Doc. source:hbnf\doc\en\dispc.txt
Template:
Category:File I/O
Subcategory:
Oneliner:Browse a text file
Syntax:ft_DispFile() -> cExitkey
Arguments:None
Returns:The ASCII keystroke that terminated ft_DispFile()
Description:This routine displays a text file within a defined window using as little memory as possible. The text file to display has to be present or an error value of 0 is returned (as a character.) Assumptions: The routine assumes that all lines are terminated with a CR/LF sequence (0x0d and 0x0a). Note: Make sure you allocate a buffer large enough to hold enough data for the number of lines that you have in the window. Use the following formula as a guideline - buffer size = (# of line) + 1 * RMargin this is the smallest you should make the buffer and for normal use I recommend 4096 bytes. Cursor Keys: Up, Down - moves the highlight line Left, Right - moves the window over nColSkip col's Home - moves the window to the far left End - moves the window to the nRMargin column PgUp, PgDn - moves the highlight one page Ctrl-PgUp - moves the highlight to the file top Ctrl-PgDn - moves the highlight to the file bottom Ctrl-Right - moves the window 16 col's to the right Ctrl-Left - moves the window 16 col's to the left Esc, Return - terminates the function All other keys are ignored unless they are specified within cExitKeys parameter. This list will tell the routine what keys terminate the function. Special keys must be passed by a unique value and that value can be found by looking in the keys.h file.
Examples:#include "inkey.ch" @ 4, 9 TO 11, 71 ft_DFSetup( "test.txt", 5, 10, 10, 70, 1, 7, 15, ; { "A", "a", "B", "b", K_F3 }, .T., 5, 132, 4096 ) cKey := ft_DispFile() ft_DFClose() @ 20, 0 SAY "Key that terminated ft_DispFile() was: " + "[" + cKey + "]"
Status:
Compliance:
Files:
See also:ft_DFSetup() ft_DFClose()
Back to index


ft_FAppend

Lang:fttext.txt
Component:hbnf
Doc. source:hbnf\doc\en\fttext.txt
Template:
Category:File I/O
Subcategory:
Oneliner:Appends a line to the currently selected text file
Syntax:ft_FAppend( [ < nLines > ] ) -> NIL
Arguments:<nLines> is the number of lines that should be appended to the end of the currently selected text file. If <nLines> is omitted, one record is appended.
Returns:lSuccess. If FALSE, check ^bft_FError()^n for the error code.
Description:This function appends a line of text to the file in the currently selected text file workarea. Text lines are delimited with a CRLF/LF. The record pointer is moved to the last appended record. Multiple lines may be appended with one call to ft_FAppend(). A text file "record" is a line of text terminated by a CRLF/LF. Each line appended with this function will be empty. NOTE: Occasionally a text file may contain a non-CRLF/LF terminated line, at the end of the file ("stragglers"). This function assumes these stragglers to be the last line of the file, and begins appending the new lines after this line. In other words, if the last line in the text file is not terminated with a CRLF/LF prior to calling ft_FAppend(), the function will terminate that last line before appending any new lines.
Examples:// add a blank line of text to a file ft_FUse( "test.txt" ) ? ft_FRecNo() // displays 5 ft_FAppend() ? ft_FRecNo() // displays 6
Status:
Compliance:
Files:
See also:ft_FRecNo() ft_FDelete() ft_FInsert() ft_FLastRe()
Back to index


ft_FBof

Lang:fttext.txt
Component:hbnf
Doc. source:hbnf\doc\en\fttext.txt
Template:
Category:File I/O
Subcategory:
Oneliner:Determine if attempt to skip past beginning of text file
Syntax:ft_FBof() -> lResult
Arguments:None
Returns:.T. if an attempt was made to skip past the first record of the currently selected text file, otherwise .F.
Description:This function is similar to the Clipper Bof() function. A text file "record" is a line of text terminated by a CRLF/LF.
Examples:ft_FUse( "test.txt" ) ft_FGoTop() ? ft_FBof() // .F. ft_FSkip( -1 ) ? ft_FBof() // .T.
Status:
Compliance:
Files:
See also:ft_FSkip() ft_FEof() ft_FGoTop()
Back to index


ft_FDelete

Lang:fttext.txt
Component:hbnf
Doc. source:hbnf\doc\en\fttext.txt
Template:
Category:File I/O
Subcategory:
Oneliner:Deletes a line from the currently selected text file
Syntax:ft_FDelete( [ <nLines> ] ) -> lSuccess
Arguments:^b<nLines>^n is the number of lines to be eliminated, beginning with the current record position. If ^b<nLines>^n is omitted, the current record is deleted only.
Returns:TRUE if successful, otherwise check ^bft_FError()^n for error code.
Description:This function deletes one or several lines of text from the file in the currently selected text file workarea. Text lines are delimited with a CRLF/LF. The record pointer is not moved, unless the deleted lines occur at the end of the file, in which case ^bft_FRecNo()^n will equal ^bft_FLastRe()^n and ^bft_FEof()^n will be set to TRUE.
Examples:// delete the next 4 lines from a file ft_FUse( "test.txt" ) ft_FDelete( 4 )
Status:
Compliance:
Files:
See also:ft_FAppend() ft_FRecNo() ft_FInsert()
Back to index


ft_FEof

Lang:fttext.txt
Component:hbnf
Doc. source:hbnf\doc\en\fttext.txt
Template:
Category:File I/O
Subcategory:
Oneliner:Determine if end of text file has been encountered
Syntax:ft_FEof() -> lResult
Arguments:None
Returns:.T. if an attempt was made to skip past the last record of the currently selected text file, otherwise .F.
Description:This function is similar to the CLIPPER Eof() function. A text file "record" is a line of text terminated by a CRLF/LF.
Examples:ft_FUse( "test.txt" ) ? ft_FEof() // .F. ft_FSkip() ? ft_FEof() // .T.
Status:
Compliance:
Files:
See also:ft_FUse() ft_FSkip()
Back to index


ft_FError

Lang:fttext.txt
Component:hbnf
Doc. source:hbnf\doc\en\fttext.txt
Template:
Category:File I/O
Subcategory:
Oneliner:Return the error code for a text file operation
Syntax:ft_FError() -> nErrorNo
Arguments:None
Returns:The DOS error code if one occurred. See a reference on DOS error codes for an explanation of what the code means.
Description:This function returns the DOS error code associated with a file operation on the currently selected text file. Errors could stem from any open, create, read or write operation, among others.
Examples:IF ft_FUse( "test.txt" ) < 0 // open text file err := ft_FError() ? "Error opening file 'test.txt', error code (" + ; hb_ntos( err ) + ")" ENDIF
Status:
Compliance:
Files:
See also:
Back to index


ft_FGoBot

Lang:fttext.txt
Component:hbnf
Doc. source:hbnf\doc\en\fttext.txt
Template:
Category:File I/O
Subcategory:
Oneliner:Go to the last record in a text file
Syntax:ft_FGoBot() -> NIL
Arguments:None
Returns:NIL
Description:This function moves the record pointer to the last record of the file in the currently selected text file workarea. If a read error occurs ^bft_FError()^n will contain the error code. A text file "record" is a line of text terminated by a CRLF/LF.
Examples:// read last line ft_FUse( "test.txt" ) ft_FGoBot() ? ft_FReadLn()
Status:
Compliance:
Files:
See also:ft_FSelect() ft_FUse() ft_FGoTop() ft_FRecNo() ft_FReadLn()
Back to index


ft_FGoto

Lang:fttext.txt
Component:hbnf
Doc. source:hbnf\doc\en\fttext.txt
Template:
Category:File I/O
Subcategory:
Oneliner:Move record pointer to specific record in a text file
Syntax:ft_FGoto( nLine ) -> NIL
Arguments:<nLine> is the record number to go to.
Returns:NIL
Description:This function moves the record pointer to a specific record in the file in the currently selected text file workarea. If the record number requested is greater than the number of records in the file, the record pointer will be positioned at the last record. Internally, the function operates differently depending on how you invoke it. Passing a value for ^b<nLine>^n results in what is effectively a skip operation, which is fairly quick. However if you pass 0 for ^b<nLine>^n, e.g. ft_FGoto( 0 ), the function internally goes to the top of the file, then skips down the required number of records. Hence if your file is relatively large and the current record is a high number, you may see some delay as ft_FGoto( 0 ) skips through the file. A text file "record" is a line of text terminated by a CRLF/LF.
Examples:// read 5th line of text from file ft_FUse( "test.txt" ) ft_FGoto( 5 ) cText := ft_FReadLn()
Status:
Compliance:
Files:
See also:ft_FRecNo() ft_FGoTop() ft_FReadLn()
Back to index


ft_FGoTop

Lang:fttext.txt
Component:hbnf
Doc. source:hbnf\doc\en\fttext.txt
Template:
Category:File I/O
Subcategory:
Oneliner:Go to the first record in a text file
Syntax:ft_FGoTop() -> NIL
Arguments:None
Returns:NIL
Description:This function moves the record pointer to the first record in the currently selected text file workarea. A text file "record" is a line of text terminated by a CRLF/LF.
Examples:ft_FUse( "test.txt" ) // open text file DO WHILE ! ft_FEof() ? ft_FReadLn() // read thru file ft_FSkip() ENDDO ft_FGoTop() // go back to top ? ft_FRecNo() // 1
Status:
Compliance:
Files:
See also:ft_FSelect() ft_FUse() ft_FRecNo() ft_FGoBot()
Back to index


ft_FInsert

Lang:fttext.txt
Component:hbnf
Doc. source:hbnf\doc\en\fttext.txt
Template:
Category:File I/O
Subcategory:
Oneliner:Inserts a line in the currently selected text file
Syntax:ft_FInsert( [ <nLines> ] ) -> lSuccess
Arguments:^b<nLines>^n is the number of lines that should be inserted at the current record position. If ^b<nLines>^n is omitted, one record is inserted.
Returns:^blSuccess^n is TRUE if the insert succeeded, FALSE if not. If false check the return value of ^bft_FError()^n for the reason.
Description:This function inserts a line of text in the file in the currently selected text file workarea. Text lines are delimited with a CRLF/LF. The record pointer is not moved. A text file "record" is a line of text terminated by a CRLF/LF. Each line inserted with this function will be empty.
Examples:// add a couple of blank lines of text to a file ft_FUse( "test.txt" ) ft_FGoto( 10 ) ft_FInsert( 5 )
Status:
Compliance:
Files:
See also:ft_FAppend() ft_FRecNo() ft_FDelete() ft_FLastRe()
Back to index


ft_FLastRe

Lang:fttext.txt
Component:hbnf
Doc. source:hbnf\doc\en\fttext.txt
Template:
Category:File I/O
Subcategory:
Oneliner:Get the no. of records in the currently selected text file
Syntax:ft_FLastRe() -> nLastRecordNum
Arguments:None
Returns:An integer containing the number of records in the text file in the currently selected text file workarea, or zero if no file is currently open in the workarea.
Description:This function returns the number of the last record in a text file. A text file "record" is a line of text terminated by a CRLF/LF.
Examples:ft_FUse( "test.txt" ) ? ft_FLastRe()
Status:
Compliance:
Files:
See also:ft_FUse() ft_FRecNo()
Back to index


ft_FReadLn

Lang:fttext.txt
Component:hbnf
Doc. source:hbnf\doc\en\fttext.txt
Template:
Category:File I/O
Subcategory:
Oneliner:Read a line from the currently selected text file
Syntax:ft_FReadLn() -> cLine
Arguments:None
Returns:A string containing the current record in a text file.
Description:This function returns a line of text read from the file in the currently selected text file workarea. Text lines are delimited with a CRLF/LF. The record pointer is not moved. Currently the maximum record size is 4096 characters. You may increase the maximum record size by changing the value of ^b#define ^bBUFFSIZE^n in the C source and recompiling, however you should consider the performance implications if you do (all read and writes use this buffer size, including ft_FSkip()'s and ft_FGoto()'s). If a read error occurs ^ft_FError()^n will contain the error code. A text file "record" is a line of text terminated by a CRLF/LF.
Examples:// display each record of a text file ft_FUse( "test.txt" ) DO WHILE ! ft_FEof() ? ft_FReadLn() ft_FSkip() ENDDO
Status:
Compliance:
Files:
See also:ft_FUse() ft_FWriteLn() ft_FRecNo() ft_FGoTop()
Back to index


ft_FRecNo

Lang:fttext.txt
Component:hbnf
Doc. source:hbnf\doc\en\fttext.txt
Template:
Category:File I/O
Subcategory:
Oneliner:Return the current record number of a text file
Syntax:ft_FRecNo() -> nRecNo
Arguments:None
Returns:The current record number of a text file or 0 if no file is open.
Description:This function returns the current record number of the file open in the currently selected text file workarea. A text file "record" is a line of text terminated by a CRLF/LF.
Examples:ft_FUse( "test.txt" ) // open text file DO WHILE ! ft_FEof() ? ft_FReadLn() // read thru file ft_FSkip() ENDDO ft_FGoTop() // go back to top ? ft_FRecNo() // 1
Status:
Compliance:
Files:
See also:ft_FSelect() ft_FUse() ft_FGoTop() ft_FGoBot()
Back to index


ft_FSelect

Lang:fttext.txt
Component:hbnf
Doc. source:hbnf\doc\en\fttext.txt
Template:
Category:File I/O
Subcategory:
Oneliner:Select a text file workarea
Syntax:ft_FSelect( [ <nNewArea> ] ) -> nPreviousArea
Arguments:^b<nNewArea>^n is the text file workarea to select.
Returns:The current selected text file area.
Description:This function selects a text file "workarea" from 1 to 10. A file may or may not be open in the selected area. Passing 0 for ^b<nNewArea>^n selects the next available workarea, similar to Clipper's SELECT 0 command. If no more workareas are available the current workarea is not changed. Each file is opened in its own "workarea", similar to the concept used by dbf files. As provided, a maximum of 10 files (in 10 workareas) can be opened (assuming there are sufficient file handles available). That number may be increased by modifying the #define TEXT_WORKAREAS in the C source code and recompiling. All the FT_F*() file functions operate on the file in the currently selected text file workarea. Text file workareas are separate from and independent of Clipper's database workareas.
Examples:ft_FSelect( 1 ) nFile1 := ft_FUse( "temp.c" ) ? ft_FLastRe() // no. of lines in temp.c ft_FSelect( 2 ) nFile2 := ft_FUse( "temp.h" ) ? ft_FLastRe() // no. of lines in temp.h
Status:
Compliance:
Files:
See also:ft_FUse()
Back to index


ft_FSkip

Lang:fttext.txt
Component:hbnf
Doc. source:hbnf\doc\en\fttext.txt
Template:
Category:File I/O
Subcategory:
Oneliner:Move the record pointer to a new position in a text file
Syntax:ft_FSkip( [ <nLines> ] ) -> nLinesSkipped
Arguments:<nLines> is the number of lines to skip. Defaults to 1 if not specified.
Returns:The number of lines actually skipped. If the file's EOF or BOF was encountered before ^b<nLines>^n could be skipped, the return value will be less than ^b<nLines>^n.
Description:This function moves the text file record pointer, similar to the CLIPPER SKIP command. Use the return value to determine how many records were actually skipped, for example to write a custom skipper function for TBrowse'g text files. If a read error occurs ^ft_FError()^n will contain the error code. A text file "record" is a line of text terminated by a CRLF/LF.
Examples:// display each record of a text file ft_FUse( "test.txt" ) DO WHILE ! ft_FEof() ? ft_FReadLn() ft_FSkip() ENDDO
Status:
Compliance:
Files:
See also:ft_FRecNo() ft_FGoTop()
Back to index


ft_FUse

Lang:fttext.txt
Component:hbnf
Doc. source:hbnf\doc\en\fttext.txt
Template:
Category:File I/O
Subcategory:
Oneliner:Open or close a text file for use by the FT_F* functions
Syntax:ft_FUse( [ <cFile> ] [, <nMode> ] ) -> nHandle | 0
Arguments:^b<cFile>^n is the text file you want to open. If not specified, the file currently open, if any, will be closed. ^b<nMode>^n is the open mode for the file. Please refer to the discussion of open modes under FOpen() in the Clipper manual and fileio.ch for a list of allowable open modes. If not specified, the file will be opened with a mode of FO_READ + FO_SHARED (64).
Returns:If ^b<cFile>^n is passed and the file is opened successfully, an integer containing the text file's workarea. If the file cannot be opened, -1 will be returned. In this case, check the return value of ^bft_FError()^n for the cause of the error. If ft_FUse() is called without any arguments, it will close the text file in the current "text area" and return 0. If a read error occurs ^ft_FError()^n will contain the error code.
Description:The FT_F*() file functions are for reading text files, that is, files where each line (record) is delimited by a CRLF/LF. Each file is opened in its own "workarea", similar to the concept use by dbf files. As provided, a maximum of 10 files (in 10 workareas) can be opened (assuming there are sufficient file handles available). That number may be increased by modifying the #define TEXT_WORKAREAS in the C source code and recompiling.
Examples:#include "fileio.ch" // open a text file for reading ft_FUse( "test.txt" ) // open a text file for reading and writing ft_FUse( "test.txt", FO_READWRITE + FO_SHARED ) // close file ft_FUse()
Status:
Compliance:
Files:
See also:ft_FUse() ft_FSelect()
Back to index


ft_FWriteLn

Lang:fttext.txt
Component:hbnf
Doc. source:hbnf\doc\en\fttext.txt
Template:
Category:File I/O
Subcategory:
Oneliner:Write a line to the currently selected text file
Syntax:ft_FWriteLn( < cData >, [ < lInsert > ] ) -> lSuccess
Arguments:<cData> is a string of data to write to the file at the current record position. <lInsert> is a logical indicating whether the contents of the current record are to be preserved, that is, if lInsert evaluates to .T., the a new record is inserted at the current position. The current record then is pushed down to ft_FRecNo()+1. If lInsert is .F. or omitted, the current record is replaced by cData.
Returns:TRUE if successful, otherwise check ^ft_FError()^n for error code.
Description:This function writes a line of text to the file in the currently selected text file workarea. Text lines are delimited with a CRLF/LF. The record pointer is not moved. The contents of the current record are updated to reflect the new new line written, unless the Insert option is selected. Writing a null string has the effect of clearing the current line if in overstrike mode, else inserting a new line (same as ft_FInsert()). A text file "record" is a line of text terminated by a CRLF/LF.
Examples:// write a line of text to a file ft_FUse( "config.sys" ) DO WHILE !( Left( Upper( ft_FReadLn() ), Len( "FILES=" ) ) == "FILES=" ) .AND. ! ft_FEof() ft_FSkip() ENDDO ft_FWriteLn( "FILES=30", ft_FEof() )
Status:
Compliance:
Files:
See also:ft_FReadLn() ft_FRecNo() ft_FInsert() ft_FDelete()
Back to index


ft_Pegs

Lang:pegs.txt
Component:hbnf
Doc. source:hbnf\doc\en\pegs.txt
Template:
Category:Game
Subcategory:
Oneliner:PEGS GAME (all work and no play...)
Syntax:ft_Pegs() -> NIL
Arguments:None
Returns:NIL
Description:This function can be used to alleviate boredom. The object is to remove all pegs except one. This is done by jumping over adjacent pegs.
Examples:ft_Pegs()
Status:
Compliance:
Files:
See also:
Back to index


gt_ClrFlag

Lang:hbgt.txt
Component:hbgt
Doc. source:hbgt\doc\en\hbgt.txt
Template:
Category:General
Subcategory:
Oneliner:Set a number of flags to FALSE in a bit flag string.
Syntax:gt_ClrFlag(<cFlagString>,[<nStart>],[<nEnd>]) --> cFlagString
Arguments:<cFlagString> is a bit flag string created with gt_NewFlag() <nStart> is the starting flag. This is an optional numeric value. If not supplied it defaults to 1. <nEnd> is the ending flag. This is an optional numeric value. If not supplied it defaults to <nStart>.
Returns:The bit map string with the new flag settings.
Description:gt_ClrFlag() is used to turn flags within the flag string off.
Examples:cFlags := gt_NewFlag( 20 ) // Create a bit flag string for 20 // logical values. // Now, turn them all on. cFlags := gt_SetFlag( cFlags, 1, 20 ) // Now set flags 10 to 15 to false. cFlags := gt_ClrFlag( cFlags, 10, 15 ) // And set flag 18 to false. cFlags := gt_ClrFlag( cFlags, 18 ) // And set flag 1 to false. cFlags := gt_ClrFlag( cFlags )
Status:
Compliance:
Files:
See also:gt_NewFlag() gt_SetFlag() gt_IsFlag()
Back to index


gt_IsFlag

Lang:hbgt.txt
Component:hbgt
Doc. source:hbgt\doc\en\hbgt.txt
Template:
Category:General
Subcategory:
Oneliner:Test the setting of a flag in a bit flag string.
Syntax:gt_IsFlag(<cFlagString>,[<nFlag>]) --> lSetting
Arguments:<cFlagString> is a bit flag string created with gt_NewFlag() <nFlag> is the flag to be tested.
Returns:A boolean value, TRUE if the flag is on, FALSE if it's off.
Description:gt_IsFlag() is used to test the state of a flag with a bit flag string.
Examples:// Print the setting of the flags in a flag string called ``cDave'' FOR nFlag := 1 to ( Len( cDave ) * 8 ) ? "Flag number ", nFlag, " == ", gt_IsFlag( cDave, nFlag ) NEXT
Status:
Compliance:
Files:
See also:gt_NewFlag() gt_SetFlag() gt_ClrFlag()
Back to index


gt_NewFlag

Lang:hbgt.txt
Component:hbgt
Doc. source:hbgt\doc\en\hbgt.txt
Template:
Category:General
Subcategory:
Oneliner:Create a new bit flag string.
Syntax:gt_NewFlag(<nFlagCount>) --> cFlagString
Arguments:<nFlagCount> is the number of flags you wish to store.
Returns:A string to hold the bit flags. All flags are set to FALSE.
Description:gt_NewFlag() is used to construct a bit flag string. The bit flag functions can be used for storing a large number of logical values in a small space. To create a bit flag string you need to pass gt_NewFlag() a value that is equal to or greater than the number of flags required (you may want to allow for future expansion). Each character in the string returned from gt_NewFlag() will hold 8 logical values.
Examples:cFlags := gt_NewFlag( 20 ) // Create a bit flag string for 20 logical values.
Status:
Compliance:
Files:
See also:gt_SetFlag() gt_ClrFlag() gt_IsFlag()
Back to index


gt_SetFlag

Lang:hbgt.txt
Component:hbgt
Doc. source:hbgt\doc\en\hbgt.txt
Template:
Category:General
Subcategory:
Oneliner:Set a number of flags to TRUE in a bit flag string.
Syntax:gt_SetFlag(<cFlagString>,[<nStart>],[<nEnd>]) --> cFlagString
Arguments:<cFlagString> is a bit flag string created with gt_NewFlag() <nStart> is the starting flag. This is an optional numeric value. If not supplied it defaults to 1. <nEnd> is the ending flag. This is an optional numeric value. If not supplied it defaults to <nStart>.
Returns:The bit map string with the new flag settings.
Description:gt_SetFlag() is used to turn flags within the flag string on.
Examples:cFlags := gt_NewFlag( 20 ) // Create a bit flag string for 20 // logical values. // Now set flags 10 to 15 to true. cFlags := gt_SetFlag( cFlags, 10, 15 ) // And set flag 18 to true. cFlags := gt_SetFlag( cFlags, 18 ) // And set flag 1 to true. cFlags := gt_SetFlag( cFlags )
Status:
Compliance:
Files:
See also:gt_NewFlag() gt_ClrFlag() gt_IsFlag()
Back to index


TFileRead

Lang:ht_class.txt
Component:hbmisc
Doc. source:hbmisc\doc\en\ht_class.txt
Template:
Category:Harbour Tools
Subcategory:
Oneliner:Read a file one line at a time
Syntax:oFile := TFileRead():New( <cFileName> [, <nReadSize> ] )
Arguments:<cFileName> is the required name of the file to be read. </par> <nReadSize> is the optional size to use when reading from the file. The default value is 4096 and the allowed range is 1 through 65535. Any value outside of this range causes the default value to be used. </par>
Returns:An instance of the File Reader class </par>
Description:TFileRead() is used to access a file one line at a time. You must specify the name of the file when an instance of the class is created. </par> The class data should be considered private to the class. </par> The class methods are as follows: </par> New() Creates a new instance of the TFileRead class. </par> Open([<nFlags>]) Opens the file for reading. The optional nFlags parameter can use any of the FOpen() flags from fileio.ch. The default is FO_READ + FO_SHARED. Calling this method when the file is already open causes the next ReadLine() to start over from the beginning of the file. </par> Close() Closes the file. </par> ReadLine() Returns one line from the file, stripping the newline characters. The following sequences are treated as one newline: 1) CR CR LF; 2) CR LF; 3) LF; and 4) CR. Note: LF CR is 2 newlines. </par> Name() Returns the name of the file. </par> IsOpen() Returns .T. if the file is open. </par> MoreToRead() Returns .T. if there are more lines to be read (think of it as an inverse EOF function). Error() Returns .T. if an error has occurred. </par> ErrorNo() Returns the current error code. </par> ErrorMsg([<cPre>]) Returns a formatted error message. </par>
Examples:PROCEDURE Main( cFile ) LOCAL oFile := TFileRead():New( cFile ) oFile:Open() IF oFile:Error() OutStd( oFile:ErrorMsg( "FileRead: " ) ) OutStd( hb_eol() ) ELSE DO WHILE oFile:MoreToRead() OutStd( oFile:ReadLine() ) OutStd( hb_eol() ) ENDDO oFile:Close() ENDIF RETURN
Status:R
Compliance:This is a new Harbour Tools class
Files:Library is hbmisc
See also:TClass()
Back to index


THtml

Lang:ht_doc.txt
Component:hbmisc
Doc. source:hbmisc\doc\en\ht_doc.txt
Template:
Category:Harbour Tools
Subcategory:
Oneliner:Html Class
Syntax:oHtml:=THtml():New(<cFile>) --> oHtm
Arguments:<cFile> Name of the Html file to create </par>
Returns:<oHtm> An instance of the THtml Class </par>
Description:THtml() is a class that creates an .html file of the same name you pass to the constructor. </par> The class methods are as follows: </par> New(<cFile>) Create a new instance of the THtml class </par> Close() Close the created file </par> WriteTitle(<cTitle>) Write the file title </par> WritePar(<cPar>) Writes a paragraph </par> WriteParBold(<cPar>) Same as WritePar(), but the text is bold </par> WriteLink(<cLink>,<cName>) Write a link to another topic </par> WriteText(<cText>) Write any text </par>
Examples:PROCEDURE Main() LOCAL oHtm oHtm := THtml():New( "www\harbour.html" ) oHtm:WriteTitle( "Harbour Reference Guide" ) oHtm:WritePar( "HARBOUR" ) oHtm:WriteLink( "OverView" ) oHtm:WriteLink( "License" ) oHtm:WriteLink( "http://www.gnu.org/copyleft/gpl" ) oHtm:WritePar( "See the Links Above" ) oHtm:Close() RETURN
Status:R
Compliance:This is a new Harbour Tools class </par>
Files:
See also:TCLASS()
Back to index


TNortonGuide

Lang:ht_doc.txt
Component:hbmisc
Doc. source:hbmisc\doc\en\ht_doc.txt
Template:
Category:Harbour Tools
Subcategory:
Oneliner:Norton Guide Class
Syntax:oNg:=TNortonGuide():New(<cFile>) --> oNg
Arguments:<cFile> Name of the Ng Source file to create </par>
Returns:<oNg> An instance of the TNortonGuide Class </par>
Description:TNortonGuide() is a class that creates the Norton Guide Source Code of the same name you pass to the constructor. </par> The class methods are as follows: </par> New(<cFile>) Create an instance of the TNortonGuide class </par> Close() Close the created file </par> WriteTitle(<cTopic>,<cTitle>) Write the file title </par> WritePar(<cPar>) Write a paragraph </par> WriteParBold(<cPar>) Same as WritePar(), but the text is bold </par> WriteLink(<cLink>) Write a link to another topic </par>
Examples:PROCEDURE Main() LOCAL oNg oNg := TNortonGuide():New( "ngi\harbour.ngi" ) oNg:WriteTitle( "Harbour Reference Guide" ) oNg:WritePar( "HARBOUR" ) oNg:WriteLink( "OverView" ) oNg:WriteLink( "License" ) oNg:WritePar( "See the Links Above" ) oNg:Close() RETURN
Status:R
Compliance:This is a new Harbour Tools class </par>
Files:
See also:TTroff(),TRtf(),THtml(),TOs2()
Back to index


TOs2

Lang:ht_doc.txt
Component:hbmisc
Doc. source:hbmisc\doc\en\ht_doc.txt
Template:
Category:Harbour Tools
Subcategory:
Oneliner:OS/2 Documentation Class
Syntax:oNg:=TOs2():New(<cFile>) --> oOs2
Arguments:<cFile> Name of the IPF Source file to create </par>
Returns:<oOs2> An instance of the TOs2 Class </par>
Description:TOs2() is a class that creates the OS/2 IPF Source of the same name you pass to the constructor. </par> The class methods are as follows: </par> New(<cFile>) Create a new instance of the TOs2 class </par> Close() Close the created file </par> WriteTitle(<cTopic>,<cTitle>) Write the file title </par> WritePar(<cPar>) Write a paragraph </par> WriteParBold(<cPar>) Same as WritePar(), but the text is bold </par> WriteLink(<cLink>) Write a link to another topic </par> ScanLink(<clink>) Scan the aLinkRef array for a valid topic </par> DosToOs2Text(<cText>) Convert a Dos string to a OS/2 String </par>
Examples:PROCEDURE Main() LOCAL oNg oNg := TOs2():New( "ngi\harbour.ngi" ) oNg:WriteTitle( "Harbour Reference Guide" ) oNg:WritePar( "HARBOUR" ) oNg:WriteLink( "OverView" ) oNg:WriteLink( "License" ) oNg:WritePar( "See the Links Above" ) oNg:Close() RETURN
Status:R
Compliance:This is a new Harbour Tools class </par>
Files:
See also:TNortonGuide()
Back to index


TRtf

Lang:ht_doc.txt
Component:hbmisc
Doc. source:hbmisc\doc\en\ht_doc.txt
Template:
Category:Harbour Tools
Subcategory:
Oneliner:Rtf Class
Syntax:oNg:=TRtf():New(<cFile>) --> oRtf
Arguments:<cFile> Name of the RTF file to create </par>
Returns:<oRtf> An instance of the TRtf Class </par>
Description:TRtf() is a class that creates the RTF Documentation Source Code of the same name you pass to the constructor. </par> The class methods are as follows: </par> New(<cFile>) Create a new instance of the TRtf class </par> Close() Close the create file </par> WriteTitle(<cTopic>,<cTitle>) Write the file title </par> WritePar(<cPar>) Write a paragraph </par> WriteParBold(<cPar>) Same as WritePar(), but the text is bold </par> WriteLink(<cLink>) Write a link to another topic </par> WriteHeader() Write the RTF header </par> EndPar() Write the end paragraph delimiter </par>
Examples:PROCEDURE Main() LOCAL oRtf oRtf := TRtf():New( "rtf\harbour.rtf" ) oRtf:WriteHeader() oRtf:WriteTitle( "Harbour Reference Guide" ) oRtf:WritePar( "HARBOUR" ):Endpar() oRtf:WriteLink( "OverView" ) oRtf:WriteLink( "License" ) oRtf:WritePar( "See the Links Above" ):EndPar() oRtf:Close() RETURN
Status:R
Compliance:This is a new Harbour Tools class </par>
Files:
See also:TNortonGuide()
Back to index


TTroff

Lang:ht_doc.txt
Component:hbmisc
Doc. source:hbmisc\doc\en\ht_doc.txt
Template:
Category:Harbour Tools
Subcategory:
Oneliner:Troff Class
Syntax:oTroff:=TTrof():New(<cFile>) --> oTrf
Arguments:<cFile> Name of the Troff file to create </par>
Returns:<oTrf> instance of the TTroff Class </par>
Description:TTroff() is a class that creates the TROFF Documentation Source Code of the same name you pass to the constructor. </par> The class methods are as follows: </par> New(<cFile>) Create a new instance of the THtml class Close() Close the created file </par> WriteTitle(<cTopic>,<cTitle>) Write the file title </par> WritePar(<cPar>) Write a paragraph </par> WriteParBold(<cPar>) Same as WritePar(), but the text is bold </par> WriteLink(<cLink>) Write a link to another topic </par> WriteText() Writes text without formating </par>
Examples:PROCEDURE Main() LOCAL oTroff oTroff := TTroff():New( "tr\harbour.ngi" ) oTroff:WriteTitle( "Harbour Reference Guide" ) oTroff:WritePar( "HARBOUR" ) oTroff:WriteLink( "OverView" ) oTroff:WriteLink( "License" ) oTroff:WritePar( "See the Links Above" ) oTroff:Close() RETURN
Status:R
Compliance:This is a new Harbour Tools class </par>
Files:
See also:TNortonGuide()
Back to index


JustRight

Lang:justify.txt
Component:hbct
Doc. source:hbct\doc\en\justify.txt
Template:
Category:Harbour Tools string functions
Subcategory:
Oneliner:Move characters from the end to the beginning of a string
Syntax:JustRight( <[@]cString>, [<cChar>|<nChar>] ) -> cJustifiedString
Arguments:
Returns:
Description:TODO: add documentation
Examples:
Status:Started
Compliance:JustRight() is compatible with CT3's JustRight().
Files:Library is hbct.
See also:JustLeft()
Back to index


SetDate

Lang:dattime3.txt
Component:hbct
Doc. source:hbct\doc\en\dattime3.txt
Template:
Category:HBCT Date and Time Functions
Subcategory:
Oneliner:Sets the system date
Syntax:SetDate( <dDate>, [<lMode>] ) --> lSet
Arguments:<dDate> Designates which date to use to set the system date. <lMode> Designates whether the date should also be set in the CMOS- RAM of an AT. The default is do not write (.F.). Note that in Windows plataform this adjust is automatic, therefore this parameter is without efect.
Returns:SetDate() RETURNs .T. when the date is successfully set.
Description:When you use this FUNCTION to set the system date from within your application, all files acquire this date with each write procedure.
Examples:// Set the system date in each case; but the hardware clock only // on an AT: dNewDate := hb_SToD( "19910730" ) IF IsAt() SetDate( dNewDate, .T. ) ELSE SetDate( dNewDate ) ENDIF Or, more compactly: SetDate( dNewDate, IsAt() )
Status:Ready
Compliance:This function is CA-Cl*pper Tools compatible.
Files:Library is hbct.
See also:SetTime()
Back to index


SetTime

Lang:dattime3.txt
Component:hbct
Doc. source:hbct\doc\en\dattime3.txt
Template:
Category:HBCT Date and Time Functions
Subcategory:
Oneliner:Sets the system clock
Syntax:SetTime( <cTime>, [<lMode>] ) --> lSet
Arguments:<cTime> Designates a character string that contains the time that is to become the system time. <lMode> Designates whether the time should also be set in the CMOS-RAM of an AT. The default is do not write to CMOS-RAM. Note that in Windows platform this adjust is automatic, therefore this parameter is without efect.
Returns:The FUNCTION RETURNs .T. when the time is set successfully.
Description:When you use this FUNCTION to convert the time into the system time from within your application, all files acquire this time with each write procedure.
Examples:// Set the system time in each case; but the hardware clock only // on an AT: cNewTime := "10:20:00" IF IsAt() SetTime( cNewTime, .T. ) ELSE SetTime( cNewTime ) ENDIF Or, more compactly: SetTime( cNewTime, IsAt() )
Status:Ready
Compliance:This function is CA-Cl*pper Tools compatible.
Files:Library is hbct.
See also:SetDate(),TimeValid()
Back to index


TimeValid

Lang:dattime3.txt
Component:hbct
Doc. source:hbct\doc\en\dattime3.txt
Template:
Category:HBCT Date and Time Functions
Subcategory:
Oneliner:Determines whether a specIFied time is valid
Syntax:TimeValid( <cTime> ) --> lValid
Arguments:<cTime> Designates a character string that contains the time to test.
Returns:TimeValid() RETURNs .T. when <cTime> is a valid time; or .F. when <cTime> is an invalid time.
Description:With input that requires time manipulation, writing your own UDF to check time inputs was unavoidable up to now. TimeValid() permits Complete checking of a time designation. You can use this FUNCTION effectively with a VALID clause within a READ mask. Note Note the format for time designations. There must always be two digits for hours, minutes, seconds, and hundredths; otherwise, the time it is regarded as invalid. Valid examples are "12", "12:59", "12:59:59", and "12:59:59:99". By contrast, invalid examples are "24", "12:60", or "12:1", and/or "12:". IF you work with time strings that are not completely filled and that you need to check with TimeValid(), then they must be TRIMmed prior to the use of TimeValid() (see following Examples).
Examples:// Using the VALID clause with TRIM, all valid times are // accepted, even IF no seconds or minutes are specIFied: cBegin := Space( 11 ) @ 5, 10 SAY "Please input time for beginning work:"; GET cBegin VALID TimeValid( RTrim( cBegin ) ) READ // Using a VALID clause without TRIM, hours and minutes must be // specified, so that TimeValid() can confirm a valid time: cBegin := Space( 5 ) @ 5, 10 SAY "Please input time for beginning work:"; GET cBegin VALID TimeValid( cBegin ) READ
Status:Ready
Compliance:This function is CA-Cl*pper Tools compatible.
Files:Library is hbct.
See also:SetTime()
Back to index


WaitPeriod

Lang:dattime3.txt
Component:hbct
Doc. source:hbct\doc\en\dattime3.txt
Template:
Category:HBCT date and time functions
Subcategory:
Oneliner:Pauses a specified time in increments of 1/100 seconds
Syntax:WaitPeriod( [<nDelay>] ) --> lNotElapsed
Arguments:<nDelay> Designates the waiting period at initialization in 1/100ths of seconds. Values from 1 to 8, 640, 000 (one day) are possible.
Returns:WaitPeriod() returns .T., if the time span designated at initialization has not elapsed.
Description:This function sets a time span for a DO WHILE loop to run. The function must initialize prior to the loop, since you must specify the <nDelay> parameter in 1/100th seconds. Subsequently, the function can be implemented without a parameter for additional loop conditions. It returns .T., as long as the designated time span has not yet run out. Note The function notes the status of the internal timer at initialization. From that point on, the initialization should always precede the respective DO WHILE; otherwise, the time delay is incorrect. The passing of midnight (the time resets to the 0 value) is taken into account.
Examples:// Run a loop for 5 seconds: WaitPeriod( 500 ) // Initialization, 5 seconds DO WHILE <cond1> .AND. <cond2> .AND. WaitPeriod() // ... ENDDO
Status:Ready
Compliance:WaitPeriod() is Clipper Tools compatible.
Files:Library is hbct.
See also:
Back to index


CharPix

Lang:video.txt
Component:hbct
Doc. source:hbct\doc\en\video.txt
Template:
Category:HBCT video functions
Subcategory:
Oneliner:Gets the number of scan lines per character.
Syntax:CharPix() --> nHeight
Arguments:
Returns:Returns the number of scan lines per character.
Description:Returns the number of scan lines per character.
Examples:
Status:Started
Compliance:
Files:Library is hbct.
See also:
Back to index


NToColor

Lang:color.txt
Component:hbct
Doc. source:hbct\doc\en\color.txt
Template:
Category:HBCT video functions
Subcategory:
Oneliner:
Syntax:NToColor( <nAttr>, [<lColorCode>] ) -> <cAttr>
Arguments:<nAttr> Designates the value for the combined numeric color attributes. <lColorCode> If designated as .F. or if the parameter is omitted, NToColor() returns a string with a numeric color code. When designated as .T., NToColor() returns a string with the CA-Cl*pper alpha color coding.
Returns:NToColor() returns the designated color attribute in the NN/NN or CC/CC form.
Description:NToColor() converts a color attribute returned from another function in numeric form, into the alphanumeric data format. Use this attribute in conjunction with the CA-Cl*pper SET COLOR TO command. TODO: add documentation
Examples:
Status:Started
Compliance:
Files:Library is hbct.
See also:
Back to index


SetFont

Lang:video.txt
Component:hbct
Doc. source:hbct\doc\en\video.txt
Template:
Category:HBCT video functions
Subcategory:
Oneliner:Loads font from a string.
Syntax:SetFont( <cFontString>, [<nFontArea>], [<nOffset>], [<nCounter>] ) --> nError or: SetFont( <cFontString>, [<nFontArea>], [<lCompute>] ) --> nError
Arguments:<cFontString> Binary string containing a valid font definition. <nFontArea> Number of a font area where the font must be loaded. <nOffset> First character code to be loaded. <nCounter> Number of characters to load. <lCompute> When .T., the function computes font height automatically.
Returns:
Description:TODO: Finish documentation
Examples:
Status:Started
Compliance:
Files:Library is hbct.
See also:
Back to index


VGAPalette

Lang:video.txt
Component:hbct
Doc. source:hbct\doc\en\video.txt
Template:
Category:HBCT video functions
Subcategory:
Oneliner:Changes VGA palette colors
Syntax:VGAPalette( [<cColor|nColor>, [<nRedValue>, <nGreenValue>, <nBlueValue]] ) --> lValid
Arguments:<cColor|nColor> - the color to change in CA-Cl*pper color notation or as a number from 0 to 15. <nRedValue>, <nGreenValue>, and <nBlueValue> specify the palette settings for the respective portions in the range from 0 to 63. If no RGB value is specified, the palette register is reset to its default value (currently unsupported). If the function is called without parameters, the palette registers for all colors are reset to their default values (currently unsupported).
Returns:Returns .T. on success.
Description:
Examples:
Status:Started
Compliance:
Files:Library is hbct.
See also:EGAPALETTE() FONTRESET()
Back to index


VideoType

Lang:video.txt
Component:hbct
Doc. source:hbct\doc\en\video.txt
Template:
Category:HBCT video functions
Subcategory:
Oneliner:Detects supported video adapter modes
Syntax:VideoType() --> nMask
Arguments:
Returns:
Description:TODO: Finish documentation
Examples:
Status:Started
Compliance:
Files:Library is hbct.
See also:ISCGA(), ISEGA(), ISHERCULES(), ISMCGA(), ISMONO(), ISPGA(), ISVGA()
Back to index


ft_Alt

Lang:alt.txt
Component:hbnf
Doc. source:hbnf\doc\en\alt.txt
Template:
Category:Keyboard/Mouse
Subcategory:
Oneliner:Determine status of the Alt key
Syntax:ft_Alt() -> lValue
Arguments:None
Returns:.T. if Alt key is pressed, .F. if otherwise.
Description:This function is useful for times you need to know whether or not the Alt key is pressed, such as during a MemoEdit().
Examples:IF ft_Alt() @ 24, 0 SAY "Alt" ELSE @ 24, 0 SAY " " ENDIF
Status:
Compliance:
Files:
See also:ft_CapLock() ft_Ctrl() ft_NumLock() ft_PrtScr() ft_Shift()
Back to index


ft_CapLock

Lang:caplock.txt
Component:hbnf
Doc. source:hbnf\doc\en\caplock.txt
Template:
Category:Keyboard/Mouse
Subcategory:
Oneliner:Determine and optionally change the status of CapLock key
Syntax:ft_CapLock([ <lNewSetting> ]) -> lCurrentSetting
Arguments:<lNewSetting> is optional and if supplied is the new setting for the CapLock key. Specify .T. to turn CapLock on, or .F. to turn it off.
Returns:.T. if CapLock is set, .F. if it isn't set. The value returned represents the setting in effect prior to any changes that might by made by <lNewSetting>.
Description:This function is useful if you need to know or set the status of the CapLock key for some reason.
Examples:IF ft_CapLock() ? "CapLock is active" ENDIF
Status:
Compliance:
Files:
See also:ft_Alt() ft_Ctrl() ft_NumLock() ft_PrtScr() ft_Shift()
Back to index


ft_Ctrl

Lang:ctrl.txt
Component:hbnf
Doc. source:hbnf\doc\en\ctrl.txt
Template:
Category:Keyboard/Mouse
Subcategory:
Oneliner:Determine status of the Ctrl key
Syntax:ft_Ctrl() -> lValue
Arguments:None
Returns:.T. if Ctrl key is pressed, .F. if otherwise.
Description:This function is useful for times you need to know whether or not the Ctrl key is pressed, such as during a MemoEdit().
Examples:IF ft_Ctrl() @ 24, 0 SAY "Ctrl" ELSE @ 24, 0 SAY " " ENDIF
Status:
Compliance:
Files:
See also:ft_CapLock() ft_NumLock() ft_PrtScr() ft_Shift() ft_Alt()
Back to index


ft_LastKey

Lang:setkeys.txt
Component:hbnf
Doc. source:hbnf\doc\en\setkeys.txt
Template:
Category:Keyboard/Mouse
Subcategory:
Oneliner:Force LastKey() to return a programmer-defined value.
Syntax:ft_LastKey( <nKey> ) -> NIL
Arguments:<nKey> is the Inkey() value of the desired key.
Returns:NIL
Description:It is occasionally useful to force LastKey() to return a known value. This is easily accomplishing by using the KEYBOARD command, but this has undesireable side effects (the keyboard buffer is cleared, and the keystroke is processed whether you needed it to be or not). This function accomplishes the same task but without the side effects. It does so by directly modifying the memory location where Clipper stores the LastKey() value. Some highly unorthodox programming techniques, not to mention rather strange use of Clipper internals, was necessary to make this function work. If this makes you uncomfortable, then don't use this function, you worthless crybaby.
Examples:hb_keyPut( K_ESC ) ? LastKey() // returns 27 ft_LastKey( K_F1 ) ? LastKey() // now returns 28
Status:
Compliance:
Files:
See also:
Back to index


ft_LastKey

Lang:setlastk.txt
Component:hbnf
Doc. source:hbnf\doc\en\setlastk.txt
Template:
Category:Keyboard/Mouse
Subcategory:
Oneliner:Force LastKey() to return a programmer-defined value.
Syntax:ft_LastKey( <nKey> ) -> NIL
Arguments:<nKey> is the Inkey() value of the desired key.
Returns:NIL
Description:It is occasionally useful to force LastKey() to return a known value. This is easily accomplishing by using the KEYBOARD command, but this has undesireable side effects (the keyboard buffer is cleared, and the keystroke is processed whether you needed it to be or not). This function accomplishes the same task but without the side effects. It does so by directly modifying the memory location where Clipper stores the LastKey() value. Some highly unorthodox programming techniques, not to mention rather strange use of Clipper internals, was necessary to make this function work. If this makes you uncomfortable, then don't use this function, you worthless crybaby.
Examples:hb_keyPut( K_ESC ) ? LastKey() // returns 27 ft_LastKey( K_F1 ) ? LastKey() // now returns 28
Status:
Compliance:
Files:
See also:
Back to index


ft_MButPrs

Lang:mouse1.txt
Component:hbnf
Doc. source:hbnf\doc\en\mouse1.txt
Template:
Category:Keyboard/Mouse
Subcategory:
Oneliner:Retrieve button press status
Syntax:ft_MButPrs( <nButton> [, @nButPrs [, @nX [, @nY] ] ] ) -> nButStatus
Arguments:<nButton> is the mouse button number: 0 - Left Button 1 - Right Button 2 - Middle Button [if applicable] <nButPrs> is the number of times the specified button was pressed since the last call to this routine. PASSED BY REFERENCE. <nX> is the X position of the cursor when the last press occurred. PASSED BY REFERENCE. <nY> is the Y position of the cursor when the last press occurred. PASSED BY REFERENCE.
Returns:An integer representing the button status: 0 - no buttons pressed 1 - left button pressed 2 - right button pressed 3 - left and right pressed 4 - middle pressed 5 - left and middle pressed 6 - middle and right buttons pressed 7 - all 3 buttons pressed
Description:Retrieves the mouse button status and the position of the cursor when a button was last pressed.
Examples:IF Empty( ft_MButPrs( 1 ) ) ? "No Item selected" ENDIF
Status:
Compliance:
Files:
See also:ft_MButRel() ft_MDblClk()
Back to index


ft_MButRel

Lang:mouse1.txt
Component:hbnf
Doc. source:hbnf\doc\en\mouse1.txt
Template:
Category:Keyboard/Mouse
Subcategory:
Oneliner:Get mouse button release information
Syntax:ft_MButRel( nButton [, @nButRel [, @nX [, @nY] ] ]) -> nBStat
Arguments:<nButton> is the mouse button number 0 - Left Button 1 - Right Button 2 - Middle Button [if applicable] <nButRel> is the number of times the specified button was released since the last call to this routine. PASSED BY REFERENCE. <nX> is the X position of the cursor when the last release occurred. PASSED BY REFERENCE. <nY> is the Y position of the cursor when the last release occurred. PASSED BY REFERENCE.
Returns:<nBStat> - an integer representing button release status 0 - None 1 - Left 2 - Right 3 - Middle
Description:This function returns the release status of the mouse buttons and the coordinates of the last release.
Examples:IF ft_MButRel( 0 ) == 1 ? "Left button released" ENDIF
Status:
Compliance:
Files:
See also:ft_MButPrs() ft_MDblClk()
Back to index


ft_MCOnOff

Lang:mouse1.txt
Component:hbnf
Doc. source:hbnf\doc\en\mouse1.txt
Template:
Category:Keyboard/Mouse
Subcategory:
Oneliner:Turn mouse cursur off if in specified region
Syntax:ft_MCOnOff( <nTop>, <nLeft>, <nBottom>, <nRight> )
Arguments:<nTop>, <nLeft> <nBottom> <nRight> are the four corners of the screen region in row and column coordinates.
Returns:NIL
Description:This function tells the mouse driver to hide the cursor if it is in the given region. The driver hides the cursor by decrementing the cursor flag. A call to FT_MSHOWCRS is required to turn the cursor back on. Calling FT_MSHOWCRS also disables this function. See FT_MSHOWCRS for a discussion of the cursor display flag.
Examples:ft_MCOnOff( 10, 10, 11, 20 )
Status:
Compliance:
Files:
See also:ft_MShowCrs() ft_MHideCrs() ft_MXLimit() ft_MYLimit() ft_MInRegion()
Back to index


ft_MCursor

Lang:mouse1.txt
Component:hbnf
Doc. source:hbnf\doc\en\mouse1.txt
Template:
Category:Keyboard/Mouse
Subcategory:
Oneliner:Set the mouse cursor
Syntax:ft_MCursor( [ <lState> ] ) -> lCursorState
Arguments:<lState> is a logical indicating whether to set the mouse cursor on. .T. - set mouse cursor on .F. - set mouse cursor off If omitted, no change is made to cursor state
Returns:A logical indicating the previous mouse cursor state.
Description:This function works like most Clipper state functions. If no value is sent to ft_MCursor() it will return the state of the mouse cursor.
Examples:IF ! ft_MCursor() ft_MCursor( .T. ) ENDIF
Status:
Compliance:
Files:
See also:
Back to index


ft_MDblClk

Lang:mouse1.txt
Component:hbnf
Doc. source:hbnf\doc\en\mouse1.txt
Template:
Category:Keyboard/Mouse
Subcategory:
Oneliner:Return true if a double click was detected
Syntax:ft_MDblClk( [ <nClick> [, <nButton> [, <nInterval> [, <nRow> [, <nCol>; [, <nTime> ] ] ] ] ] ] ) -> lIsDoubleClk
Arguments:<nClick> is a numeric value. If it is zero ft_MDblClk() will not check for the first press but rather will simply wait the specified period for a single press. This is useful if this routine is called from one which in turn responded to a button press. If it is not present or not equal to 0, then ft_MDblClk() will wait for two presses of the specified button. <nButton> is the mouse button number 0 - Left Button 1 - Right Button 2 - Middle Button [if applicable] <nInterval> is the interval to wait for the first click if requested and the time to wait for the second. If not present then defaults to 0.5 second. <nRow> is the row number for the mouse cursor location for a double click to be valid. If not present then the current position is taken as the valid location. <nCol> is the column number for the mouse cursor location for a double click to be valid. If not present, then the current position is taken as the valid location. <nTime> is an optional start time for the waiting period for the first click (of either one or two requested). If not given then the time is set at entry into this routine. This is useful when this routine is called from another routine which was called in response to a mouse click but needs to know if a double click has occurred
Returns:.T. if a double click was detected.
Description:This is a mouse meta function that checks for the presence of a double click.
Examples:IF FT_MISREGION( 10, 10, 11, 20 ) .AND. ; ft_MDblClk( 0, 1,, ft_MGetX(), ft_MGetY() ) // double click, right button // at current location with // default interval MnuItem1() ENDIF
Status:
Compliance:
Files:
See also:ft_MButPrs() ft_MButRel()
Back to index


ft_MDefCrs

Lang:mouse1.txt
Component:hbnf
Doc. source:hbnf\doc\en\mouse1.txt
Template:
Category:Keyboard/Mouse
Subcategory:
Oneliner:Define the mouse cursor
Syntax:ft_MDefCrs( <nCrsType>, <nScrMask>, <nCrsMask> ) -> NIL
Arguments:<nCrsType> is the cursor type. A value of 0 indicates the software cursor (the default) and a value of 1 indicates the hardware cursor. <nScrMask> is the screen mask for the software cursor or the first scan line of the hardware cursor. See the description for more information. <nCrsMask> is the cursor mask for the software cursor of the last scan line of the hardware cursor. See the description for more information.
Returns:NIL
Description:In text mode the mouse cursor can either be a software generated or the actual hardware cursor. This routine allows one choose between them. The software cursor is the default and its effect on the character it covers is determined by the screen mask and the cursor mask. Both of these masks are 16 bit values (which in Clipper are passed as standard numerical values). The 16 bit masks are arranged in a manner identical to the way information is stored for each character cell on the screen. The low order 8 bits represent the actual character displayed while the high order bits represent the display atributes such as blinking, intensity and forground and background colors. The mask is represented in the diagram below: Bit: │15 │14 12│11 │10 8│7 0│ Function:│blink │background│intensity│foreground│character│ Blinking and high intensity are on when the bit is 1. The background and foreground indicate which colors are used for each. The software mouse cursor uses these two values by taking the mask from the screen cell it is on and performing a logical AND on each bit with the screen mask value. The result is then logically XOR'ed with the cursor mask value. Thus to keep the character the same but invert the foreground and background colors the following values would be used: Bit: │15 │14 12│11 │10 8│7 0│ Function:│blink │background│intensity│foreground│character│ screen: │ 0 │ 111 │ 0 │ 111 │11111111 │ =30719 cursor: │ 0 │ 111 │ 0 │ 111 │00000000 │ =30464 The hardware cursor is the text cursor provided by the video board. One specifies the range of scan lines which are on using <nScrMask> and <nCrsMask>. The range of values is dependant upon the type of monitor. The first scan line is 0.
Examples:
Status:
Compliance:
Files:
See also:
Back to index


ft_MGetCoord

Lang:mouse1.txt
Component:hbnf
Doc. source:hbnf\doc\en\mouse1.txt
Template:
Category:Keyboard/Mouse
Subcategory:
Oneliner:Get mouse cursor position (text coord.) and button status
Syntax:ft_MGetPos( @<nX>, @<nY> ) -> nButtonStatus
Arguments:<nX> is a variable that will receive the mouse X position in text screen coordinates. It must be passed by reference. <nY> is a variable that will receive the mouse Y position in text screen coordinates. It must be passed by reference.
Returns:an integer representing button status - 0 for no button pressed - 1 for left pressed - 2 for right pressed - 3 for left and right pressed - 4 for middle pressed - 5 for left and middle pressed - 6 for right and middle pressed - 7 for all three buttons pressed
Description:Loads cursor position into x and y coordinates passed by reference and returns the button status.
Examples:LOCAL nX, nY LOCAL nButton := ft_MGetCoord( @nX, @nY ) ? "Mouse Row :", nX ? "Mouse Column :", nY ? "Button Status:", nButton
Status:
Compliance:
Files:
See also:ft_MGetPos() ft_MSetPos() ft_MDefCrs() ft_MGetX() ft_MGetY()
Back to index


ft_MGetPage

Lang:mouse1.txt
Component:hbnf
Doc. source:hbnf\doc\en\mouse1.txt
Template:
Category:Keyboard/Mouse
Subcategory:
Oneliner:Get the display page for the mouse pointer
Syntax:ft_MGetPage() -> <nPage>
Arguments:None
Returns:<nPage> is the display page on which the mouse is currently being displayed
Description:This function gets the display page for the mouse cursor. The valid values of nPage is dependent upon the display mode. See ft_SetVpg() for changing the current video page
Examples:nPage := ft_MGetPage( ) // Gets the mouse cursor display page
Status:
Compliance:
Files:
See also:ft_MSetPage()
Back to index


ft_MGetPos

Lang:mouse1.txt
Component:hbnf
Doc. source:hbnf\doc\en\mouse1.txt
Template:
Category:Keyboard/Mouse
Subcategory:
Oneliner:Get mouse cursor position and button status
Syntax:ft_MGetPos( @<nX>, @<nY> ) -> nButtonStatus
Arguments:<nX> is a variable that will receive the mouse X position in virtual screen coordinates. It must be passed by reference. <nY> is a variable that will receive the mouse Y position in virtual screen coordinates. It must be passed by reference.
Returns:an integer representing button status - 0 for no button pressed - 1 for left pressed - 2 for right pressed - 3 for left and right pressed - 4 for middle pressed - 5 for left and middle pressed - 6 for right and middle pressed - 7 for all three buttons pressed
Description:Loads cursor position into x and y coordinates passed by reference and returns the button status. The coordinate system in text mode has eight virtual coordinates per character cell. Thus x=16 means that you are in the Row 2. The values returned by this routine when in text mode and with mouse driver versions 6 and above are multiples of 8. We have experience with drivers prior to that version
Examples:LOCAL nX, nY LOCAL nButton := ft_MGetPos( @nX, @nY ) ? "Mouse Row :", nX ? "Mouse Column :", nY ? "Button Status:", nButton
Status:
Compliance:
Files:
See also:ft_MGetCoord() ft_MSetPos() ft_MDefCrs() ft_MGetX() ft_MGetY()
Back to index


ft_MGetSens

Lang:mouse1.txt
Component:hbnf
Doc. source:hbnf\doc\en\mouse1.txt
Template:
Category:Keyboard/Mouse
Subcategory:
Oneliner:Get the mouse sensitivity parameters
Syntax:ft_MGetSens( <@nHoriz>, <@nVert>, <@nDouble> ) -> NIL
Arguments:<nHoriz> is the percentage of maximum horizontal sensitivity. PASSED BY REFERENCE. <nVert> is the percentage of maximum vertical sensitivity. PASSED BY REFERENCE. <nDouble> is the percentage of maximum sensitivity for doubling the mouse cursor's speed on the screen. PASSED BY REFERENCE.
Returns:NIL
Description:This function returns the current values of the mouse movement sensitivity parameters. The first two arguments control the amount of movement necessary to move the cursor a given amount. The third argument determines the threshold above which the mouse moves at twice the normal speed. For further discussion of these values see ft_MSetSens()
Examples:ft_MGetSens( @nHoriz, @nVert, @nDouble )
Status:
Compliance:
Files:
See also:ft_MSetSens()
Back to index


ft_MGetX

Lang:mouse1.txt
Component:hbnf
Doc. source:hbnf\doc\en\mouse1.txt
Template:
Category:Keyboard/Mouse
Subcategory:
Oneliner:Get mouse cursor row position
Syntax:ft_MGetX() -> nRowPos
Arguments:NONE
Returns:<nRowPos> which is the row position of mouse in virtual screen coordinates.
Description:Retrieves mouse's row position in virtual screen coordinates. The values returned are multiples of 8 when in text mode and with at least Microsoft drivers 6 and above.
Examples:? ft_MGetX()
Status:
Compliance:
Files:
See also:ft_MGetCoord() ft_MDefCrs() ft_MGetPos() ft_MGetY()
Back to index


ft_MGetY

Lang:mouse1.txt
Component:hbnf
Doc. source:hbnf\doc\en\mouse1.txt
Template:
Category:Keyboard/Mouse
Subcategory:
Oneliner:Get mouse cursor column position
Syntax:ft_MGetY() -> nColPos
Arguments:NONE
Returns:<nColPos> Column position of mouse in virtual screen coordinates
Description:Retrieves mouse's column position in virtual screen coordinates. The values returned are multiples of 8 when in text mode and with at least Microsoft drivers 6 and above.
Examples:? ft_MGetY()
Status:
Compliance:
Files:
See also:ft_MGetCoord() ft_MDefCrs() ft_MGetPos() ft_MGetX()
Back to index


ft_MHideCrs

Lang:mouse1.txt
Component:hbnf
Doc. source:hbnf\doc\en\mouse1.txt
Template:
Category:Keyboard/Mouse
Subcategory:
Oneliner:Decrement internal mouse cursor flag and hide mouse cursor
Syntax:ft_MHideCrs() -> NIL
Arguments:NONE
Returns:NIL
Description:Hides the mouse cursor. Make sure to turn the mouse cursor off when redrawing screens. The mouse cursor dutifully saves the screen under it, so if you draw over the mouse cursor it will create a "hole" in your screen when you move the mouse cursor. Note: A call to ft_MHideCrs() decrements a mouse driver variable which indicates whether the cursor is shown. The cursor is visible only when the variable = 0. Thus multiple calls to ft_MHideCrs() require an equal number of calls to ft_MShowCrs() before the cursor will again be visible. Once the variable is 0 calls to ft_MShowCrs() does not increment the varaible above 0.
Examples:ft_MHideCrs() @ 10, 10 TO 20, 20 ft_MShowCrs()
Status:
Compliance:
Files:
See also:ft_MShowCrs() ft_MCOnOff()
Back to index


ft_MInit

Lang:mouse1.txt
Component:hbnf
Doc. source:hbnf\doc\en\mouse1.txt
Template:
Category:Keyboard/Mouse
Subcategory:
Oneliner:Initialize the mouse driver, vars and return status of mouse
Syntax:ft_MInit() -> lMouseStatus
Arguments:NONE
Returns:An logical representing the mouse status (.F. == mouse not installed)
Description:Initializes the mouse drive, associated variables and returns mouse status. It checks to see if the mouse has been previously initialized and if so it does not reinitialize. The row and column limits of mouse movement is set to the maximum for the current video mode. Use ft_MShowCrs() to display the mouse cursor.
Examples:IF ! ft_MInit() ? "No mouse driver is installed" ENDIF
Status:
Compliance:
Files:
See also:ft_MReset()
Back to index


ft_MInRegion

Lang:mouse1.txt
Component:hbnf
Doc. source:hbnf\doc\en\mouse1.txt
Template:
Category:Keyboard/Mouse
Subcategory:
Oneliner:Test if the mouse cursor is in the passed region
Syntax:ft_MInRegion( <nT>, <nL>, <nB>, <nR> ) -> lInRegion
Arguments:<nT>, <nL> <nB> <nR> are the four corners of the screen region.
Returns:.T. if mouse is in specified region.
Description:This function will check to see if the mouse cursor is within the confines of the specified region.
Examples:IF ft_MInRegion( 10, 10, 11, 20 ) nChoice := 1 ENDIF
Status:
Compliance:
Files:
See also:ft_MXLimit() ft_MYLimit() ft_MInRegion()
Back to index


ft_MMickeys

Lang:mouse1.txt
Component:hbnf
Doc. source:hbnf\doc\en\mouse1.txt
Template:
Category:Keyboard/Mouse
Subcategory:
Oneliner:Get mickeys
Syntax:ft_MMickeys( @<nX>, @<nY> ) -> NIL
Arguments:<nX> is a variable that will receive the vertical mickey count. <nY> is a variable that will receive the horizontal mickey count.
Returns:NIL
Description:<nX> and <nY> must be passed by reference to receive the mouse position in Mickeys.
Examples:ft_MMickeys( @nX, @nY ) ? nX ? nY
Status:
Compliance:
Files:
See also:
Back to index


ft_MReset

Lang:mouse1.txt
Component:hbnf
Doc. source:hbnf\doc\en\mouse1.txt
Template:
Category:Keyboard/Mouse
Subcategory:
Oneliner:Reset mouse driver and return status of mouse
Syntax:ft_MReset() -> nMouseStatus
Arguments:NONE
Returns:An integer representing the mouse status (0 == mouse not installed)
Description:Resets the mouse driver and returns mouse status. Use ft_MShowCrs() to display the mouse cursor. The mouse is set to allow it to cover the complete screen (as defined by MaxCol() and MaxRow()). This is necessary because at least some versions of the mouse drivers do not operate according to the documentation when confronted with a 43 or 50 line screen. Normally, ft_MInit() should be used to initialize the mouse since it will not reinitialize if already done.
Examples:IF Empty( ft_MReset() ) ? "No mouse driver is installed" ENDIF
Status:
Compliance:
Files:
See also:ft_MInit() ft_MShowCrs()
Back to index


ft_MSetCoord

Lang:mouse1.txt
Component:hbnf
Doc. source:hbnf\doc\en\mouse1.txt
Template:
Category:Keyboard/Mouse
Subcategory:
Oneliner:Position the mouse cursor using text screen coordinates
Syntax:ft_MSetPos( <nX>, <nY> ) -> NIL
Arguments:<nX> is the desired mouse row. <nY> is the desired mouse column.
Returns:NIL
Description:Positions mouse cursor on screen using text (normal row and column) coordinates.
Examples:ft_MSetCoord( 10, 20 ) // position mouse cursor at row 10, col 20 // in text screen coordinates
Status:
Compliance:
Files:
See also:ft_MGetPos() ft_MGetCoord() ft_MSetPos() ft_MDefCrs() ft_MGetX() ft_MGetY()
Back to index


ft_MSetPage

Lang:mouse1.txt
Component:hbnf
Doc. source:hbnf\doc\en\mouse1.txt
Template:
Category:Keyboard/Mouse
Subcategory:
Oneliner:Set the display page for the mouse pointer
Syntax:ft_MSetPage( <@nPage> ) -> NIL
Arguments:<nPage> is the desired display page.
Returns:NIL
Description:This function sets the display page for the mouse cursor. The valid values of nPage is dependent upon the display mode. See ft_SetVpg() for changing the current video page
Examples:ft_MSetPage( 1 ) // Sets the mouse cursor to page 1
Status:
Compliance:
Files:
See also:ft_MGetPage()
Back to index


ft_MSetPos

Lang:mouse1.txt
Component:hbnf
Doc. source:hbnf\doc\en\mouse1.txt
Template:
Category:Keyboard/Mouse
Subcategory:
Oneliner:Position the mouse cursor using virtual screen coordinates
Syntax:ft_MSetPos( <nX>, <nY> ) -> NIL
Arguments:<nX> is the desired mouse row. <nY> is the desired mouse column.
Returns:NIL
Description:Positions mouse cursor on screen. The virtual coordinate system in text mode has eight virtual coordinates per character cell. Thus x=16 means that you are in the Row 2.
Examples:ft_MSetPos( 10, 20 ) // position mouse cursor at row 10, col 20 // in virtual screen coordinates
Status:
Compliance:
Files:
See also:ft_MGetPos() ft_MGetCoord() ft_MSetCoord() ft_MGetX() ft_MGetY()
Back to index


ft_MSetSens

Lang:mouse1.txt
Component:hbnf
Doc. source:hbnf\doc\en\mouse1.txt
Template:
Category:Keyboard/Mouse
Subcategory:
Oneliner:Set the mouse sensitivity parameters
Syntax:ft_MSetSens( <nHoriz>, <nVert>, <nDouble> ) -> NIL
Arguments:<nHoriz> is the sensitivity of the mouse on the horizontal axis. This value is the integer percentage of highest sensitivity and thus has a range of 1 to 100. The default value is 50 and at this setting about 3.2 inches of mouse movement will move the mouse cursor across the screen. If NIL, the current value is used. <nVert> is the relative sensitivity of the mouse on the vertical axis. The value is an integer percentage of the highest sensitivity and thus has a range of 1 to 100. The default value is 50 and requires about 2 inches of mouse movement will move from top to bottom of the screen.If NIL, the current value is used. <nDouble> is the relative sensitivity of the mouse to doubling the ratio of cursor movement to mouse movement. The default value is 50. If NIL, the current value is used.
Returns:NIL
Description:This function allows one to control the mouse movement sensitivity. The first two arguments control the amount of movement necessary to move the cursor a given amount. The values are the percentage of full sensitivity and the default values after installing the mouse driver is 50 which represents approximately 3.2 inches of horizontal and 2 inches of vertical mouse movement to cover the entire screen. A value of 100 requires about 0.9 inches of horizontal mouse movement to cover the screen from one side to the other. The third argument changes the threshold above which the mouse moves at twice the normal speed. The value is a percentage of full sensitivity with the default (50) providing doubling at 64 mickeys per second. NOTE: These values are NOT restored after resetting the mouse driver/ hardware. A well behaved application should reset them to the original value upon exiting. NOTE: The above description is counter to all of the documentation I have available. However, it does not work the way it is documented with Microsoft drivers versions 6.16, 6.24, 7.04 and 8.20. The above movement values are documented to be the number of mickeys per 8 pixels and the double speed value as the number mickeys per second required to double the speed. Each of these values should range from 1 to 32K but the driver forces a maximum of 100. Also the documentation states that resetting the mouse will reset these values. This is not the case.
Examples:ft_MSetSens( 75, 75, 50 ) // a little less mouse movement necessary.
Status:
Compliance:
Files:
See also:ft_MGetSens()
Back to index


ft_MShowCrs

Lang:mouse1.txt
Component:hbnf
Doc. source:hbnf\doc\en\mouse1.txt
Template:
Category:Keyboard/Mouse
Subcategory:
Oneliner:Increment internal cursor flag and display mouse cursor
Syntax:ft_MShowCrs() -> NIL
Arguments:NONE
Returns:NIL
Description:Displays the mouse cursor. Make sure to turn the mouse cursor off when redrawing screens. The mouse cursor dutifully saves the screen under it, so if you draw over the mouse cursor it will create a "hole" in your screen when you move the mouse cursor. Note: A call to ft_MHideCrs() decrements a mouse driver variable which indicates whether the cursor is shown. The cursor is visible only when the variable = 0. Thus multiple calls to ft_MHideCrs() require an equal number of calls to ft_MShowCrs() before the cursor will again be visible. Once the variable is 0 calls to ft_MShowCrs() does not increment the variable above 0.
Examples:IF Empty( ft_MReset() ) ft_MShowCrs() ENDIF
Status:
Compliance:
Files:
See also:ft_MHideCrs() ft_MCOnOff()
Back to index


ft_MVersion

Lang:mouse1.txt
Component:hbnf
Doc. source:hbnf\doc\en\mouse1.txt
Template:
Category:Keyboard/Mouse
Subcategory:
Oneliner:Get the mouse driver version
Syntax:ft_MVersion( <@nMinor>, <@nType>, <@nIRQ> ) -> <nMajor>
Arguments:<nMinor> is the Minor version number. PASSED BY REFERENCE. <nType> is the Mouse type. PASSED BY REFERENCE. 1 = Bus Mouse 2 = Serial Mouse 3 = InPort Mouse 4 = PS/2 Mouse 5 = HP Mouse <nIRQ> is the IRQ number used for the mouse. PASSED BY REFERENCE. 0 = PS/2 2,3,4,5 or 7 = IRQ number
Returns:<nMajor> which is the major version number of the mouse driver.
Description:This function returns the current values of the mouse driver version number and type. The major version would be 6 and the minor version would be 10 if the driver were version 6.10. The mouse type and IRQ numbers are also returned. NOTE: It appears that the values reported when one starts the mouse driver actually have the minor version in hexadecimal! Thus on bootup my screen showed 6.24 but this routine returned 30 for the minor version number!
Examples:nMajor := ft_MVersion( @nMinor ) IF ( nMajor + nMinor / 100 ) < 7.2 ? "Sorry mouse driver version too old" RETURN ENDIF
Status:
Compliance:
Files:
See also:ft_MSetSens()
Back to index


ft_MXLimit

Lang:mouse1.txt
Component:hbnf
Doc. source:hbnf\doc\en\mouse1.txt
Template:
Category:Keyboard/Mouse
Subcategory:
Oneliner:Set vertical bounds of mouse using virtual screen coord.
Syntax:ft_MXLimit( <nX1>, <nX2> ) -> NIL
Arguments:<nX1> is the top row limit. <nX2> is the bottom row limit.
Returns:NIL
Description:Set maximum vertical bounds of mouse using virtual screen coordinates.
Examples:ft_MXLimit( 10, 20 )
Status:
Compliance:
Files:
See also:ft_MYLimit() ft_MInRegion()
Back to index


ft_MYLimit

Lang:mouse1.txt
Component:hbnf
Doc. source:hbnf\doc\en\mouse1.txt
Template:
Category:Keyboard/Mouse
Subcategory:
Oneliner:Set horiz. bounds of mouse using virtual screen coordinates
Syntax:ft_MYLimit( <nY1>, <nY2> ) -> NIL
Arguments:<nY1> is the left column limit. <nY2> is the right column limit.
Returns:NIL
Description:Set maximum horizontal bounds of mouse using virtual screen coordinates.
Examples:ft_MYLimit( 10, 20 )
Status:
Compliance:
Files:
See also:ft_MXLimit() ft_MInRegion()
Back to index


ft_NumLock

Lang:numlock.txt
Component:hbnf
Doc. source:hbnf\doc\en\numlock.txt
Template:
Category:Keyboard/Mouse
Subcategory:
Oneliner:Return status of NumLock key
Syntax:ft_NumLock( [ <lNewSetting> ] ) -> lCurrentSetting
Arguments:<lNewSetting> is optional and if supplied is the new setting for the CapLock key. Specify .T. to turn CapLock on, or .F. to turn it off.
Returns:lValue is .T. if NumLock is set, .F. if it isn't set. The value returned represents the setting in effect prior to any changes that might by made by <lNewSetting>.
Description:This function is useful if you need to know or set the status of the NumLock key for some reason.
Examples:IF ft_NumLock() ? "NumLock is active" ENDIF // Another one, slightly strange, courtesy of Glenn Scott: #include "inkey.ch" FUNCTION numBlink() LOCAL lOldNum := ft_NumLock() DO WHILE Inkey( 0.5 ) != K_ESC ft_NumLock( ! ft_NumLock() ) ENDDO RETURN ft_NumLock( lOldNum )
Status:
Compliance:
Files:
See also:ft_CapLock() ft_Ctrl() ft_PrtScr() ft_Shift() ft_Alt()
Back to index


ft_PrtScr

Lang:prtscr.txt
Component:hbnf
Doc. source:hbnf\doc\en\prtscr.txt
Template:
Category:Keyboard/Mouse
Subcategory:
Oneliner:Enable or disable the Print Screen key
Syntax:ft_PrtScr( [ <lSetStat> ] ) -> lCurStat
Arguments:<lSetStat> set to .T. will enable the Print Screen key, .F. will disable it. If omitted, leaves status as is.
Returns:The current state: .T. if enabled, .F. if disabled.
Description:This function is valuable if you have a need to disable the printscreen key. It works by fooling the BIOS into thinking that a printscreen is already in progress. The BIOS will then refuse to invoke the printscreen handler.
Examples:ft_PrtScr( .F. ) // Disable the printscreen key ft_PrtScr( .T. ) // Enable the printscreen key MemVar := ft_PrtScr() // Get the current status
Status:
Compliance:
Files:
See also:ft_CapLock() ft_Ctrl() ft_NumLock() ft_Shift() ft_Alt()
Back to index


ft_PutKey

Lang:putkey.txt
Component:hbnf
Doc. source:hbnf\doc\en\putkey.txt
Template:
Category:Keyboard/Mouse
Subcategory:
Oneliner:Stuff a keystroke into the keyboard buffer
Syntax:ft_PutKey( <nKeyValue> ) -> lResult
Arguments:<nKeyValue> is the Inkey() value of the keystroke to be stuffed.
Returns:.T. if the keystroke was put into the keyboard buffer. .F. if nKeyValue was invalid or the buffer was full.
Description:This function is similar to the KEYBOARD command, with a few exceptions. First, this function does not clear the keyboard buffer before inserting the keystroke. In addition, since it uses the Inkey() value, you can stuff any key, including function keys, into the keyboard buffer. However, this also means that unlike the KEYBOARD command, you can only stuff one keystroke at a time. You can easily create a User-Defined Command that makes this function even more like the KEYBOARD command. For example, #command KEYSTROKE <key> => ft_PutKey( <key> ) will create a command called KEYSTROKE that could be used as a companion command to KEYBOARD. The only difference is that it would insert a single keystroke instead of a string. Be aware that this function makes use of Clipper's internal event handler. If you don't like using internals, then don't use this function, you sniveling coward. This function is written to adhere to Turbo Assembler's IDEAL mode. To use another assembler, rearrange the SEGMENT and PROC directives and make any other necessary changes to the source code.
Examples:ft_PutKey( -9 ) // Stuff the F10 key ft_PutKey( 276 ) // Stuff the Alt T key KEYSTROKE 28 // Stuff the F1 key using a User-Defined Command
Status:
Compliance:
Files:
See also:
Back to index


ft_ScanCode

Lang:scancode.txt
Component:hbnf
Doc. source:hbnf\doc\en\scancode.txt
Template:
Category:Keyboard/Mouse
Subcategory:
Oneliner:Wait for keypress and return keyboard scan code
Syntax:ft_ScanCode() -> cCode
Arguments:None
Returns:A two-character string, corresponding to the keyboard scan code.
Description:ft_ScanCode() enables you to distinguish the different scancodes of similar keys (such as Grey minus versus regular minus), thus increasing the number of keys your input routine can recognize. It works like Inkey(), in that it waits for a key to be pressed. The scan code consists of two bytes, which are returned as a two-character string. For example, calling ft_ScanCode() and pressing the Grey-minus key will return a two character string: hb_BChar( 45 ) + hb_BChar( 74 ) LastKey() is not updated by ft_ScanCode(), so don't try to test LastKey() to see what was pressed during an ft_ScanCode() call. Simply assign the return value to a variable and test that (see the test driver below). * This was adapted from a short C routine posted by John Kaster on NANFORUM. It was written in Clipper to help demonstrate the FT_INT86 function of the Nanforum Toolkit. This program requires ft_int86().
Examples:cKey := ft_ScanCode() // <grey-> returns: hb_BChar( 45 ) + hb_BChar( 74 ) // <-> returns: hb_BChar( 45 ) + hb_BChar( 12 ) // <grey+> returns: hb_BChar( 43 ) + hb_BChar( 78 ) // <+> returns: hb_BChar( 43 ) + hb_BChar( 13 )
Status:
Compliance:
Files:
See also:
Back to index


ft_SetRate

Lang:kspeed.txt
Component:hbnf
Doc. source:hbnf\doc\en\kspeed.txt
Template:
Category:Keyboard/Mouse
Subcategory:
Oneliner:Set the keyboard delay and repeat rate on PC/AT & PS/2
Syntax:ft_SetRate( [ <nDelayTime> ] [, <nRepeatRate> ] ) -> NIL
Arguments:<nDelayTime> is the keyboard delay time. <nRepeatRate> is the keyboard repeat rate. ┌───────────────────────┐ ┌────────────────────────┐ │ nDelayTime DELAY │ │ RepeatRate SPEED │ ├───────────────────────┤ ├────────────────────────┤ │ 0 250ms │ │ 0 30.0cps │ │ 1 (default) 500ms │ │ 1 26.7cps │ │ 2 750ms │ │ 2 24.0cps │ │ 3 1000ms │ │ 3 21.8cps │ └───────────────────────┘ │ 4 20.0cps │ │ 5 18.5cps │ │ 6 17.1cps │ │ 7 16.0cps │ │ 8 15.0cps │ │ 9 13.3cps │ │ 10 12.0cps │ │ 11 10.9cps │ │ 12 (default) 10.0cps │ │ 13 9.2cps │ │ 14 8.6cps │ │ 15 8.0cps │ │ 16 7.5cps │ │ 17 6.7cps │ │ 18 6.0cps │ │ 19 5.5cps │ │ 20 5.0cps │ │ 21 4.6cps │ │ 22 4.3cps │ │ 23 4.0cps │ │ 24 3.7cps │ │ 25 3.3cps │ │ 26 3.0cps │ │ 27 2.7cps │ │ 28 2.5cps │ │ 29 2.3cps │ │ 30 2.1cps │ │ 31 2.0cps │ └────────────────────────┘
Returns:NIL
Description:This routine is used to adjust the IBM PC/AT and PS/2 "typematic" repeat and delay feature. This is used to allow the users of your application to adjust these speeds to the most comfortable level.
Examples:ft_SetRate( 0, 0 ) // Set keyboard to fastest possible settings ft_SetRate() // Set keyboard to AT defaults (10.9cps,500ms delay) ft_SetRate( 11, 1 ) // Set keyboard to PS/2 defaults (10cps,500ms delay)
Status:
Compliance:
Files:
See also:
Back to index


ft_Shift

Lang:shift.txt
Component:hbnf
Doc. source:hbnf\doc\en\shift.txt
Template:
Category:Keyboard/Mouse
Subcategory:
Oneliner:Determine status of shift key
Syntax:ft_Shift() -> lValue
Arguments:None
Returns:.T. if a shift key is pressed, .F. if otherwise.
Description:This function is useful for times you need to know whether or not the shift key is pressed, such as during a MemoEdit().
Examples:IF ft_Shift() @ 24, 0 SAY "Shift" ELSE @ 24, 0 SAY " " ENDIF
Status:
Compliance:
Files:
See also:ft_CapLock() ft_Ctrl() ft_NumLock() ft_PrtScr() ft_Alt()
Back to index


ft_SInkey

Lang:sinkey.txt
Component:hbnf
Doc. source:hbnf\doc\en\sinkey.txt
Template:
Category:Keyboard/Mouse
Subcategory:
Oneliner:Replacement for Inkey() that tests for SET KEY procedures
Syntax:ft_SInkey( [ <nWaitTime> ] ) -> nKey
Arguments:<nWaitTime> is the number of seconds to wait. If zero, ft_SInkey() will wait indefinitely for a keypress. If not passed, ft_SInkey() does not wait for a keypress. If NIL, it is treated the same as 0.
Returns:The Inkey() value of the key pressed.
Description:ft_SInkey() is similar to the function provided by Nantucket in keyboard.prg, with one significant difference: you can pass NIL to Inkey(), which will be treated as a zero (i.e., wait indefinitely for keypress). Therefore, it is necessary to differentiate between an explicit NIL and one that is a result of a formal parameter NOT being received. ft_SInkey() differs from the standard Inkey() in that it will respond to any keys set with SET KEY TO or SetKey().
Examples:SetKey( K_F1, {| n, l, r | HELP( n, l, r ) } ) nKey := ft_SInkey( 0 ) // HELP() will be called if F1 pressed
Status:
Compliance:
Files:
See also:
Back to index


ft_GCD

Lang:gcd.txt
Component:hbnf
Doc. source:hbnf\doc\en\gcd.txt
Template:
Category:Math
Subcategory:
Oneliner:Calculate greatest common divisor of two numbers
Syntax:ft_GCD( <nNumber1>, <nNumber2> ) -> nGCD
Arguments:<nNumber1> is the first number to find the GCD of. <nNumber2> is the second number to find the GCD of.
Returns:The greatest common divisor of the 2 numbers, or 0 if either is 0.
Description:This function calculates the greatest common divisor between 2 numbers, i.e., the largest number that will divide into both numbers evenly. It will return zero (0) if either number is zero.
Examples:? ft_GCD( 10, 15 ) // Result: 5 ? ft_GCD( 108, 54 ) // Result: 54 ? ft_GCD( 102, 54 ) // Result: 6 ? ft_GCD( 111, 17 ) // Result: 1
Status:
Compliance:
Files:
See also:
Back to index


ft_NetPV

Lang:netpv.txt
Component:hbnf
Doc. source:hbnf\doc\en\netpv.txt
Template:
Category:Math
Subcategory:
Oneliner:Calculate net present value
Syntax:ft_NetPV( <nInitialInvestment>, <nInterestRate>, <aCashFlow> ; [, <nNoOfCashFlows> ] ) -> nNetPV
Arguments:<nInitialInvestment> is the amount of cash invested for purposes of generating the cash flows. <nInterestRate> is the annual interest rate used to discount expected cash flows (10.5% = 10.5, not .105). <aCashFlow> is an array of the expected cash receipts each year. <nNoOfCashFlows> is the number of years cash flows are expected (optional, Len( aCashFlow ) ).
Returns:The difference between the initial investment and the discounted cash flow in dollars.
Description:This function calculates the net present value, the difference between the cost of an initial investment and the present value of the expected cash flow(s) from the investment. The present value of the expected cashflow(s) is calculated at the specified interest rate, which is often referred to as the "cost of capital". This function can be used to evaluate alternative investments. The larger the NPV, the more profitable the investment. See also the FutureValue and PresentValue for further explanations. The formula to calculate the net present value is: NetPresentValue := SUM( CashFlow[ i ] / ( ( 1 + InterestRate ) ** i ) ) FOR i := 1 TO NoOfCashFlows
Examples:nNetPresentValue := ft_NetPV( 10000, 10, { 10000, 15000, 16000, 17000 } )
Status:
Compliance:
Files:
See also:
Back to index


ft_Rand1

Lang:rand1.txt
Component:hbnf
Doc. source:hbnf\doc\en\rand1.txt
Template:
Category:Math
Subcategory:
Oneliner:Generate a random number
Syntax:ft_Rand1( <nMax> ) -> nRand
Arguments:<nMax> Maximum limit of value to be produced.
Returns:nRand is a random number between 0 (inclusive) and <nMax> (exclusive).
Description:Generates a non-integer random number based on the Linear Congruential Method. If you need a random number between 1 and <nMax> inclusive, Int() the result and add 1. If you need a random number between 0 and <nMax> inclusive, then you should Round() the result.
Examples:nResult := Int( ft_Rand1( 100 ) ) + 1 // 1 <= nResult <= 100 nResult := Round( ft_Rand1( 100 ), 0 ) // 0 <= nResult <= 100 nResult := ft_Rand1( 1 ) // 0 <= nResult < 1
Status:
Compliance:
Files:
See also:
Back to index


ft_Round

Lang:round.txt
Component:hbnf
Doc. source:hbnf\doc\en\round.txt
Template:
Category:Math
Subcategory:
Oneliner:Rounds a number to a specific place
Syntax:ft_Round( <nNumber> [, <nRoundToAmount> ; [, <cRoundType> [, <cRoundDirection> ; [, <nAcceptableError> ] ] ] ] ) -> nNumber
Arguments:<nNumber> is the number to round <nRoundToAmount> is the fraction to round to or the number of places, default is 2. <cRoundType> is the type of rounding desired "D" for Decimal (3 for thousandth, 1/1000) (default) "F" for Fraction (3 for thirds, 1/3) "W" for Whole numbers (3 for thousand, 1000) <cRoundDirection> is the direction to round the number toward "U" to round Up 1.31 -> 1.4 -1.31 -> -1.4 "D" to round Down 1.36 -> 1.3 -1.36 -> -1.3 "N" to round Normal 1.5 -> 2 -1.5 -> -2 1.49 -> 1 -1.49 -> -1 <nAcceptableError> is the amount that is considered acceptable to be within, i.e., if you're within this amount of the number you don't need to round
Returns:The number, rounded as specified.
Description:This function will allow you to round a number. The following can be specified: a. Direction (up, down or normal - normal is 4/5 convention) b. Type (whole, decimal, fraction) c. Amount (100's, 5 decimals, 16th, etc.)
Examples:// round normal to 2 decimal places nDollars := ft_Round( nDollars ) // round normal to 6 decimal places nIntRate := ft_Round( nIntRate, 6 ) // round to nearest thousands nPrice := ft_Round( nPrice, 3, NEAREST_WHOLE_NUMBER ) // round Up to nearest third nAmount := ft_Round( nAmount, 3, NEAREST_FRACTION, ROUND_UP ) // round down to 3 decimals Within .005 nAvg := ft_Round( nAvg, 3, , ROUND_DOWN, .005 )
Status:
Compliance:
Files:
See also:
Back to index


ft_Adder

Lang:popadder.txt
Component:hbnf
Doc. source:hbnf\doc\en\popadder.txt
Template:
Category:Menus/Prompts
Subcategory:
Oneliner:Pop up a simple calculator
Syntax:ft_Adder()
Arguments:None
Returns:NIL .... but optionally places Total of calculation in active Get variable using oGet:varPut()
Description:PopAdder() gives you an adding machine inside your Clipper 5.2 application. It has the basic functions add, subtract, multiply, and divide. You may move it from one side of the screen to the other. It even displays a scrollable tape, if you want it. There are a few HOT Keys while using the Adder: <D>ecimals - change # of decimals <M>ove - the Adder from right display to left <T>ape - turn the Tape Display On or Off <S>croll - the tape display <DEL> ---+-- 1st Clear entry +-- 2nd Clear ADDER <ESC> - Quit <F10> - return a <TOTAL> to the active get A couple of notes about the adder: 1.) It was designed to be used on an Enhanced keyboard with separate <DELETE> key. <DELETE> is used to clear the adder. However, it will still work on a Standard keyboard. 2.) You do not have to display the tape. You may turn it on at any time by pressing <T>. You may SCROLL back through the tape once there are more than 16 entries in the adder, by pressing <S>. 3.) To Quit the Adder just press <ESC>. To return your Total to the application press <F10>. The adder will place the Total in the active GET variable using oGet:varPut(). The adder will only return a Total to a numerical GET! 4.) There are many support functions that you might find interesting. They are part of my personal library, but are necessary to the operation of the adder. You might want to pull these out to reduce the overall size of the adder. Many are worth at least a little time studying. 5.) To make ft_Adder() a Hot key from inside your application at the beginning of your application add the line: SET KEY K_ALT_A TO ft_Adder() This will make <ALT-A> a key "Hot" and permit you to Pop - Up the adder from anywhere in the application. 6.) If you use ft_SInkey(), you can even have active hotkeys in an Inkey().
Examples:
Status:
Compliance:
Files:
See also:
Back to index


ft_Blink

Lang:blink.txt
Component:hbnf
Doc. source:hbnf\doc\en\blink.txt
Template:
Category:Menus/Prompts
Subcategory:
Oneliner:Display a blinking message on the screen
Syntax:ft_Blink( <cMsg>, [ <nRow> ], [ <nCol> ] ) -> NIL
Arguments:<cMsg> is the string to blink. <nRow> is an optional screen row for @...SAY, default current. <nCol> is an optional screen col for @...say, default current.
Returns:NIL
Description:A quick way to blink a msg on screen in the CURRENT colors. Restores colors on return.
Examples:ft_Blink( "WAIT", 5, 10 ) // Blinks "WAIT" in current colors @ 5,10 @ 5, 10 SAY "WAIT - Printing Report" ft_Blink( "..." ) // Blink "..." after wait message...
Status:
Compliance:
Files:
See also:
Back to index


ft_BrwsWhl

Lang:tbwhile.txt
Component:hbnf
Doc. source:hbnf\doc\en\tbwhile.txt
Template:
Category:Menus/Prompts
Subcategory:
Oneliner:Browse an indexed database limited to a while condition
Syntax:ft_BrwsWhl( <aFields>, <bWhileCond>, <cKey>, ; [ <nFreeze> ], [ <lSaveScrn> ], [ <cColorList> ], ; [ <cColorShadow> ], [ <nTop> ], [ <nLeft> ], ; [ <nBottom> ], [ <nRight> ] -> nRecno
Arguments:<aFields> is array of field blocks of fields you want to display. Example to set up last name and first name in array: aFields := {} AAdd( aFields, { "Last Name" , {|| Names->Last } } ) AAdd( aFields, { "First Name", {|| Names->First } } ) <bWhileCond> is the limiting WHILE condition as a block. Example 1: {|| Names->Last == "JONES" } Example 2: {|| Names->Last == "JONES" .AND. Names->First == "A" } <cKey> is the key to find top condition of WHILE. cLast := "JONES " cFirst := "A" Example 1: cKey := cLast Example 2: cKey := cLast + cFirst <nFreeze> is number of fields to freeze in TBrowse. Defaults to 0 if not passed. <lSaveScrn> is a logical indicating whether or not you want to save the screen from the calling program. Defaults to .T. if not passed. <cColorList> is a list of colors for the TBrowse columns. The 1st color is used as SAY/TBrowse Background and the 3rd and 4th colors are used as part of column:defColor := {3, 4} Thus if you pass a cColorList, you MUST pass at least 4 colors. Defaults to "N/W, N/BG, B/W, B/BG, B/W, B/BG, R/W, B/R" if not passed. <cColorShad> is the color of the TBrowse box shadow. Defaults to "N/N" if not passed. <nTop>, <nLeft>, <nBottom>, <nRight> are the coordinates of the area to display the TBrowse in. Defaults to 2, 2, MaxRow() - 2, MaxCol() - 2 with shadowed box, i.e. full screen.
Returns:nRecno is the number of the record selected by the <Enter> key. 0 is returned if there are either no records matching the WHILE condition or an <Esc> is pressed instead of an <Enter>
Description:This is a demonstration of TBrowse with a WHILE condition for an indexed database.
Examples:// This example will only show those people with last name of "JONES" // in the TBNames.dbf which contains at least the fields: // Last, First, City AND is indexed on Last + First. LOCAL nRecSel := 0 LOCAL aFields := {} LOCAL bWhile := {|| TBNames->Last = "JONES" } LOCAL cKey := "JONES" LOCAL nFreeze := 1 LOCAL lSaveScrn := .T. LOCAL cColorList := "N/W, N/BG, B/W, B/BG, B/W, B/BG, R/W, B/R" LOCAL cColorShad := "N/N" USE TBNames INDEX TBNames NEW // indexed on Last + First // Pass Heading as character and Field as Block including Alias // To eliminate the need to use FieldWBlock() function in ft_BrwsWhl() AAdd( aFields, { "Last Name" , {|| TBNames->Last } } ) AAdd( aFields, { "First Name", {|| TBNames->First } } ) AAdd( aFields, { "City" , {|| TBNames->City } } ) IF ft_BrwsWhl( aFields, bWhile, cKey, nFreeze, lSaveScrn, ; cColorList, cColorShad, 3, 6, MaxRow() - 2, MaxCol() - 6 ) == 0 ? "Sorry, NO Records Were Selected" ELSE ? "You Selected: " + TBNames->Last + " " + ; TBNames->First + " " + TBNames->City ENDIF
Status:
Compliance:
Files:
See also:
Back to index


ft_ClrSel

Lang:clrsel.txt
Component:hbnf
Doc. source:hbnf\doc\en\clrsel.txt
Template:
Category:Menus/Prompts
Subcategory:
Oneliner:User Selectable Colour Routine
Syntax:ft_ClrSel( <aClrData>, [ <lClrMode> ], [ <cTestChr> ] -> aClrData
Arguments:<aClrData> is an array of subarrays, with each subarray containing information about the colour settings. The subarray has the following structure: [1] cName is the name of this colour setting i.e. "Pick List" Maximum length is 20 bytes [2] cClrStr is the current colour string Default is "W/N,N/W,N/N,N/N,N/W" If Setting type is "M" (Menu) the colours are... 1. Prompt Colour 2. Message Colour 3. HotKey Colour 4. LightBar Colour 5. LightBar HotKey Colour Note: While there are many ways to code the individual colour combinations, they should be in the same format that gets returned from SetColor(), so the defaults can be found in the colour palette. foreground [+] / background [*] i.e. "GR+/BG*, N/W*, N+/N, , W/N" [3] cType is the type of colour setting Default is "W" (Window) T = Title Only 1 colour element D = Desktop Background colour and character M = Menu For ft_MenuTo() style menus W = Window Windows with radio buttons G = Get For use with @ SAY... B = Browse For TBrowse() and *dbEdit() A = aChoice Pick-lists etc... W/G/B/A are functionally the same but will provide a more appropriate test display. [4] cFillChar is the character (for desktop background only) Default is "▒▒▒▒▒▒▒▒▒▒▒▒▒▒" <lClrMode> .T. use colour palette .F. use monochrome palette Default is the IsColor() setting <cTestChr> 2 Byte character string for colour test display Default is "■■"
Returns:An array identical to the one passed, with new selected colours
Description:This function allows users to select their own colour combinations for all the different types of screen I/O in a typical application. This facilitates an easy implementation of Ted Means' replacement of the @..PROMPT/MENU TO found in the NanForum Toolkit. If you are not using ft_MenuTo(), you can specify "A" for setting type and have a normal colour string returned.
Examples:LOCAL aClrs := {} LOCAL lColour := IsColor() SET SCOREBOARD OFF SetBlink( .F. ) // Allow bright backgrounds // .... a typical application might have the following different settings // normally these would be stored in a .dbf/.dbv aClrs := { ; { "Desktop", "N/BG", "D", "▒" }, ; { "Title", "N/W", "T" }, ; { "Top Menu", "N/BG,N/W,W+/BG,W+/N,GR+/N", "M" }, ; { "Sub Menu", "W+/N*,GR+/N*,GR+/N*,W+/R,G+/R", "M" }, ; { "Standard Gets", "W/B, W+/N,,, W/N", "G" }, ; { "Nested Gets", "N/BG, W+/N,,, W/N", "G" }, ; { "Help", "N/G, W+/N,,, W/N", "W" }, ; { "Error Messages", "W+/R*,N/GR*,,,N/R*", "W" }, ; { "Database Query", "N/BG, N/GR*,,,N+/BG", "B" }, ; { "Pick List", "N/GR*,W+/B,,, BG/GR*", "A" } } aClrs := ft_ClrSel( aClrs, lColour )
Status:
Compliance:
Files:
See also:
Back to index


ft_DispMsg

Lang:dispmsg.txt
Component:hbnf
Doc. source:hbnf\doc\en\dispmsg.txt
Template:
Category:Menus/Prompts
Subcategory:
Oneliner:Display a message and optionally waits for a keypress
Syntax:ft_DispMsg( <aMessageArray>, [ <cKey2Check> ], [ <nTopBoxRow> ], [ <nLeftBoxColumn> ], [ <cnBoxType> ], [ <lShadow> ] ) -> lKeyMatch
Arguments:<aMessageArray> is a multidimensional array of messages to be displayed and the color attributes for each message. The first dimension of the array contains one or more elements, each representing one line in the message box, up to the maximum number of rows on the screen. Within each line of the message individual characters or groups of characters may be delimited with braces ([]). The braces will be stripped out and the character(s) inside those braces will be highlighted. The second dimension of the array contains a color attribute for the corresponding element in dimension one, plus one additional element for the color of the box border. Dimension two will always contain one more element than dimension one. If an attribute is omitted, the last color selected will be used. <Key2Check> is a character string of one or more keys to check for. If omitted, the message is displayed and control is returned to the calling procedure. If one character is specified, ft_DispMsg() waits for one keypress, restores the screen and returns. If multiple characters are specified, ft_DispMsg() remains in a loop until one of the specified keys has been pressed, then restores the screen and returns. <nTopBoxRow> is the upper row for the message box. If omitted, the box is centered vertically. <nLeftBoxColumn> is the leftmost column for the box. If omitted, the box is centered horizontally. <cnBoxType> is a string of characters or a variable for the box border. See the DispBox() function. If omitted, a double box is drawn. <lShadow> is a logical variable. If true (.T.) or omitted, it uses ft_Shadow() to add a transparent shadow to the box. If false (.F.), the box is drawn without the shadow.
Returns:If <Key2Check> is not specified, ft_DispMsg() will return false (.F.). If <Key2Check> is a one-character string, ft_DispMsg() will return true (.T.) if the user presses that key, or false (.F.) if any other key is pressed. If <Key2Check> consists of multiple characters, it will lock the user in a loop until one of those keys are pressed and return the Inkey() value of the keypress.
Description:ft_DispMsg() is a multi-purpose pop-up for user messages. Multiple lines may be displayed, each with a different attribute. The box will be automatically centered on the screen, or the row and/or column can be specified by the programmer. It also centers each line of the message within the box.
Examples:// The following example displays a simple two-line message // and returns immediately to the calling routine. ft_DispMsg( { { "Printing Report", ; "Press [ESC] To Interrupt" }, ; { "W+/B*", "W/B", "GR+/B" } } ) // The next example displays a message and waits for a key press. ft_DispMsg( { { "Press [D] To Confirm Deletion", ; "Or Any Other Key To Abort" }, ; { "W+/B", "W+/B", "GR+/B" } }, ; "D" ) // The next example displays a one-line message centered on row 5 // and returns to the calling procedure. ft_DispMsg( { { "Please Do Not Interrupt" }, ; { "W+/B", "GR+/B" } }, ; , 5, )
Status:
Compliance:
Files:
See also:
Back to index


ft_Fill

Lang:menu1.txt
Component:hbnf
Doc. source:hbnf\doc\en\menu1.txt
Template:
Category:Menus/Prompts
Subcategory:
Oneliner:Declare menu options for ft_Menu1()
Syntax:ft_Fill( <aSubArrayName>, <cMenuSelection>, <bFunction>, <lSelectable> ) -> NIL
Arguments:<aSubArrayName> is a sub-array of <acOptions> in ft_Menu1() denoting the group in which to include the selection -- e.g., acOptions[ 1 ] <cMenuSelection> is the character string that will appear on the menu. <bFunction> is the code block to be executed when that menu option is selected. i.e. {|| MyFunction() } would execute the function called MyFunction(). {|| .F. } would exit the FT_MENU1 and return to the calling routine. {|| .T. } would do nothing. <lSelectable> is a logical variable that determines whether the corresponding menu option is selectable or not.
Returns:NIL
Description:ft_Fill() is a function used to set up the menu options prior to calling ft_Menu1().
Examples:ft_Fill( aOptions[ 1 ], "A. Execute A Dummy Procedure" , {|| fubar() }, .T. ) The above would be added to the sub-menu associated with the first menu bar item, would execute the function FUBAR() when that option was selected, and would be selectable. ft_Fill( aOptions[ 3 ], "B. Enter Daily Charges" , {|| .T. }, .F. ) The above would be added to the sub-menu associated with the third menu bar item, and would be unselectable. ft_Fill( aOptions[ 2 ], "C. Enter Payments On Accounts", {|| .T. }, .T. ) The above would be added to the sub-menu associated with the second menu bar item, and would be selectable, but would do nothing when selected. ft_Fill( aOptions[ 4 ], "C. Exit" , {|| .F. }, .T. ) The above would be added to the sub-menu associated with the fourth menu bar item, and would be selectable, and would exit ft_Menu1() when chosen.
Status:
Compliance:
Files:
See also:ft_Menu1()
Back to index


ft_Menu1

Lang:menu1.txt
Component:hbnf
Doc. source:hbnf\doc\en\menu1.txt
Template:
Category:Menus/Prompts
Subcategory:
Oneliner:Pulldown menu system
Syntax:ft_Menu1( <acBarNames>, <acOptions>, <acAction>, <acColors> [, <nTopRow> ], [ <lShadow> ] ) -> NIL
Arguments:<acBarNames> is a character array containing the names to appear on the menu bar. <acOptions> is a multi-dimensional array with one element for each selection to appear on the pulldown menus. <acColors> is an array containing the colors for the menu groups. <nTopRow> is a numeric value that determines the row for the menu bar. If omitted, it defaults to 0. <lShadow> is a logical variable. If true (.T.) or omitted, it uses ft_Shadow() to add a transparent shadow to the each pulldown menu. If false (.F.), the menu is drawn without the shadow. All arguments except nTopRow and lShadow are required.
Returns:NIL
Description:ft_Menu1() is a function that displays a pulldown menu for each item on the menu bar and executes the corresponding function for the item selected. When a called function returns false, FT_MENU1 returns control to the calling program. Valid keystrokes and their corresponding actions: Home - Activates Pulldown for first item on the menu bar End - Activates Pulldown for last item on the menu bar Left Arrow - Activates next Pulldown to the left Right Arrow - Activates next Pulldown to the right Tab - Same as Right Arrow Shift-Tab - Same as Left Arrow Page Up - Top item on current Pulldown menu Page Down - Bottom item on current Pulldown menu Enter - Selects current item Alpha Character - Moves to closest match and selects Alt-<Key> - Moves to corresponding menu bar item Escape - Prompts for confirmation and either returns to the calling routine or resumes
Examples:// Declare arrays LOCAL aColors := {} LOCAL aBar := { " ENTER/EDIT ", " REPORTS ", " DISPLAY " } // Include the following two lines of code in your program, as is. // The first creates aOptions with the same length as aBar. The // second assigns a three-element array to each element of aOptions. LOCAL aOptions[ Len( aBar ) ] AEval( aBar, {| x, i | aOptions[ i ] := { {}, {}, {} } } ) // fill color array // Box Border, Menu Options, Menu Bar, Current Selection, Unselected aColors := iif( lColor, ; { "W+/G", "N/G", "N/G", "N/W", "N+/G" }, ; { "W+/N", "W+/N", "W/N", "N/W", "W/N" } ) // array for first pulldown menu ft_Fill( aOptions[ 1 ], "A. Execute A Dummy Procedure" , {|| fubar() }, .T. ) ft_Fill( aOptions[ 1 ], "B. Enter Daily Charges" , {|| .T. }, .F. ) ft_Fill( aOptions[ 1 ], "C. Enter Payments On Accounts", {|| .T. }, .T. ) // array for second pulldown menu ft_Fill( aOptions[ 2 ], "A. Print Member List" , {|| .T. }, .T. ) ft_Fill( aOptions[ 2 ], "B. Print Active Auto Charges" , {|| .T. }, .T. ) // array for third pulldown menu ft_Fill( aOptions[ 3 ], "A. Transaction Totals Display", {|| .T. }, .T. ) ft_Fill( aOptions[ 3 ], "B. Display Invoice Totals" , {|| .T. }, .T. ) ft_Fill( aOptions[ 3 ], "C. Exit To DOS" , {|| .F. }, .T. ) // Call ft_Fill() once for each item on each pulldown menu, passing it // three parameters: ft_Fill( <cMenuSelection>, <bCodeBlock>, <lSelectable> // <cMenuSelection> is a character string which will be displayed on // the pulldown menu. // <bCodeBlock> should contain one of the following: // A function name to execute, which in turn should return .T. or .F. // FT_MENU1 WILL RETURN CONTROL TO THE CALLING PROGRAM IF .F. IS // RETURNED OR CONTINUE IF .T. IS RETURNED. // .F. WHICH WILL CAUSE FT_MENU1 TO RETURN CONTROL TO THE CALLING // PROGRAM. // .T. WHICH WILL DO NOTHING. THIS ALLOWS THE DEVELOPER TO DESIGN A // SKELETON MENU STRUCTURE PRIOR TO COMPLETING ALL OF THE SUBROUTINES. // CALL FT_MENU1 ft_Menu1( aBar, aOptions, aColors, 0 ) // NOTE: ft_Menu1() disables Alt-C and Alt-D in order to make them // available for the menu bar. It enables Alt-D and resets // Alt-C to its previous state prior to calling each function.
Status:
Compliance:
Files:
See also:ft_Fill()
Back to index


ft_Menu2

Lang:vertmenu.txt
Component:hbnf
Doc. source:hbnf\doc\en\vertmenu.txt
Template:
Category:Menus/Prompts
Subcategory:
Oneliner:Vertical lightbar menu
Syntax:ft_Menu2( <aMenuarray> [, <cColors> ] ) -> NIL
Arguments:<aMenuarray> is an array of menu options, messages, and action blocks. Each element in this array is a nested array with the structure: element[ x, 1 ] = menu option element[ x, 2 ] = message to be displayed when option is highlighted element[ x, 3 ] = code block to be executed when option is selected <cColors> is a string containing colors for the prompts, in the same format as that returned by Set( _SET_COLOR ). If not supplied, colors default to the current color setting.
Returns:NIL
Description:This function greatly simplifies the process of displaying light-bar menus. All prompts are padded out with spaces so they are the same length, a box is drawn around the prompts, the box is automatically centered on the screen, and the underlying screen is restored after a menu selection has been made. Additionally, because you can tie action blocks to each menu option, you can save on a lot of DO CASE or IF..ELSEIF code in your main program. See the test code for a succinct demonstration.
Examples:LOCAL mainmenu := { ; { "Data Entry", "Enter data", {|| ft_Menu2( datamenu ) } }, ; { "Reports", "Hard copy", {|| ft_Menu2( repmenu ) } }, ; { "Maintenance", "Reindex files", {|| ft_Menu2( maintmenu ) } }, ; { "Quit", "See ya later" } } ft_Menu2( mainmenu )
Status:
Compliance:
Files:
See also:
Back to index


ft_MenuTo

Lang:menutonf.txt
Component:hbnf
Doc. source:hbnf\doc\en\menutonf.txt
Template:
Category:Menus/Prompts
Subcategory:
Oneliner:Execute light bar menu using prompts created with @...PROMPT
Syntax:#include "ftmenuto.ch" MENU TO <var> [COLD]
Arguments:<var> is the name of the variable to which the result of the menu selection should be assigned. [COLD] is optional and if specified indicates that trigger characters should be treated as "cold," i.e. rather than causing the menu item to be selected it only causes the light bar to move to that selection.
Returns:
Description:This enhanced version of MENU TO requires the inclusion of the header file ftmenuto.ch in any source file that uses it. It may be used in place of the standard Clipper MENU TO command. However, in the interests of functionality it is NOT 100% compatible (in particular, you should make sure that the target memvar exists before executing the menu -- the Clipper version will create a PRIVATE memvar for you if it does not already exist, but this version does not). No whining! If compatibility is such a big deal then use the standard Clipper command. Note that this command can also be called using function-style syntax. See the entry for ft_MenuTo() for further details.
Examples:#include "ftmenuto.ch" // Simple command MENU TO MEMVAR
Status:
Compliance:
Files:
See also:ft_Prompt()
Back to index


ft_Pending

Lang:pending.txt
Component:hbnf
Doc. source:hbnf\doc\en\pending.txt
Template:
Category:Menus/Prompts
Subcategory:
Oneliner:Display same-line pending messages after a wait.
Syntax:ft_Pending( <cMsg>, [ <nRow> ], [ <nCol> ], ; [ <nWait> ], [ <cColor> ] ) -> NIL
Arguments:<cMsg> is the message string to display. <nRow> is an optional screen row for message display, default row 24. <nCol> is an optional screen col for message display, default col 0. <nWait> is an optional wait (sec) between messages, default 5 sec. <cColor> is an optional color string for displayed messages, default is white text over red background.
Returns:NIL
Description:A good way to display information messages during the running of an application is to send them all to the SAME line on the screen where users are expected to look for them. In order to give users a chance to read the current message before the next one is displayed we may need to insert a delay after each message. ft_Pending() function displays messages by keeping track of the time of the last message and providing a delay ONLY if the next pending message is issued much too soon after the current one.
Examples:ft_Pending( "Message one", 20, 0, 3, "W+/G" ) // Displays "Message one." // sets row to 20, col to 0. // wait to 3 and color to // bright white over green. ft_Pending( "Message two" ) // Displays "Message two", after 5 sec. ft_Pending( "Message three" ) // Displays "Message three", after 5 sec. // Note that default row, col, wait time and color need to be set only // once in the very first call to ft_Pending() and only if the internal // default values are not appropriate.
Status:
Compliance:
Files:
See also:
Back to index


ft_PickDay

Lang:pickday.txt
Component:hbnf
Doc. source:hbnf\doc\en\pickday.txt
Template:
Category:Menus/Prompts
Subcategory:
Oneliner:Picklist of days of week
Syntax:ft_PickDay() -> cDayOfWeek
Arguments:None
Returns:Character string containing day of week
Description:This function is ideal if you need the user to select a day.
Examples:mday := ft_PickDay()
Status:
Compliance:
Files:
See also:
Back to index


ft_Prompt

Lang:menutonf.txt
Component:hbnf
Doc. source:hbnf\doc\en\menutonf.txt
Template:
Category:Menus/Prompts
Subcategory:
Oneliner:Define a menu item for use with ft_MenuTo()
Syntax:#include "ftmenuto.ch" @ <nRow>, <nCol> PROMPT <cPrompt> ; [COLOR <cColor>] ; [MESSAGE <cMessage>] ; [MSGROW <nMsgRow>] ; [MSGCOL <nMsgCol>] ; [MSGCOLOR <cMsgColor>] ; [TRIGGER <nTrigger>] ; [TRIGGERCOLOR <cTriggerColor>] ; [HOME <nHome>] ; [END <nEnd>] ; [UP <nUp>] ; [DOWN <nDown>] ; [LEFT <nLeft>] ; [RIGHT <nRight>] ; [EXECUTE <bExec>] ;
Arguments:<nRow> is the row at which the prompt is to appear. <nCol> is the column at which the prompt will appear. <cPrompt> is the menu item string. <cColor> is optional and is the color attribute of the prompt. Note that two colors are required; one for the standard setting and one for the enhanced setting (i.e. the light bar color). See the example below if this isn't clear. If <cColor> is not specified then the current SetColor() value is used by default. <cMessage> is optional and is the message associated with the prompt. If not specified, then no message will be displayed. <nMsgRow> is optional and is the row at which the message, if any, will appear. If not specified, the default is the current setting of the SET MESSAGE TO command. <nMsgCol> is optional and is the column at which the message, if any, will appear. If not specified, the default is either zero or centered, depending on the current setting of the CENTER option of the SET MESSAGE TO command. <cMsgColor> is optional and is the color attribute of the message. If not specified, the default is the same as the prompt color. <nTrigger> is optional and is the position within the prompt string where the trigger character is located. If not specified, the default is one. <cTriggerColor> is optional and is the color attribute of the trigger character. Note that two colors are required; one for the standard setting and one for the enhanced setting (i.e. the light bar color). See the example below if this isn't clear. If <cTriggerColor> is not specified then the default is the same color as the rest of the prompt. <nHome> is optional and specifies which prompt becomes active when the home key is pressed. If not specified, the default is the first prompt. <nEnd> is optional and specifies which prompt becomes active when the end key is pressed. If not specified, the default is the last prompt. <nUp> is optional and specifies which prompt becomes active when the up arrow key is pressed. If not specified, the default is the previous prompt. The current setting of SET WRAP TO is obeyed. <nDown> is optional and specifies which prompt becomes active when the down arrow key is pressed. If not specified, the default is the next prompt. The current setting of SET WRAP TO is obeyed. <nRight> is optional and specifies which prompt becomes active when the right arrow key is pressed. If not specified, the default is the next prompt. The current setting of SET WRAP TO is obeyed. <nLeft> is optional and specifies which prompt becomes active when the left arrow is pressed. If not specified, the default is the previous prompt. The current setting of SET WRAP TO is obeyed. <bExec> is optional and is a code block to evaluate whenever the menu item to which it belongs is selected.
Returns:
Description:Clipper's @...PROMPT and MENU TO commands are fine as far as they go. But many times you need more flexibility. As you'll no doubt notice if you read the argument list, this function is almost completely flexible. You can adjust locations and colors for every part of the prompt and its associated message. In addition, since you can control the effect of the arrow keys, you can allow both horizontal and vertical movement, or even disable certain arrow keys if you so desire. Support for nested menus is also available, since the prompts are stored in stack-based static arrays. Note that this command can also be called using function-style syntax. See the entry for ft_Prompt() for further details. This enhanced version of @...PROMPT requires the inclusion of the header file ftmenuto.ch in any source file that uses it. It is may be used in place of the standard Clipper @...PROMPT command. However, in the interests of functionality it is NOT 100% compatible. No whining! If compatibility is such a big deal then use the standard Clipper commands.
Examples:#include "ftmenuto.ch" // Simple prompt @ 1, 1 PROMPT "Menu choice #1" // Prompt with color @ 3, 1 PROMPT "Menu choice #2" COLOR "W+/R,W+/B" // Prompt with a message @ 5, 1 PROMPT "Menu choice #3" MESSAGE "Go to lunch" // Prompt with pinpoint message control @ 7, 1 PROMPT "Menu choice #4" MESSAGE "Drop Dead" ; MSGROW 22 MSGCOL 4 MSGCOLOR "GR+/N" // Prompt with a trigger character ("#" character) @ 11, 1 PROMPT "Menu choice #6" TRIGGER 13 // Prompt with trigger character color control @ 13, 1 PROMPT "Menu Choice #7" TRIGGER 13 TRIGGERCOLOR "R+/BG,G+/N" // Prompt with right and left arrow keys disabled @ 15, 1 PROMPT "Menu Choice #8" RIGHT 8 LEFT 8
Status:
Compliance:
Files:
See also:
Back to index


FT_SLEEP

Lang:sleep.txt
Component:hbnf
Doc. source:hbnf\doc\en\sleep.txt
Template:
Category:Menus/Prompts
Subcategory:
Oneliner:Wait for a specified amount of time
Syntax:ft_Sleep( <nSeconds>, [<nInitial>] ) -> nil
Arguments:<nSeconds> is the number of seconds to pause <nInitial> is an optional clock value (from a call to Seconds()) from which the <nSeconds> seconds are to elapse. Useful for setting a minimum time between the start of events which could take a variable amount of time due to the execution of intervening code.
Returns:NIL
Description:This routine will wait a specified period of time. It provides resolution based upon the execution of the Seconds() function. It does not use an input state such as Inkey(). The specified time is the minimum time sleeping and will usually be slightly longer. The second optional argument allows one to begin timing an event prior to executing some operation. This is useful when, for example, you input a key or mouse click and wish to do something but still want to note if the user double entered (mouse or key) within a certain time which in turn may have meaning within your program's context. The routine correctly handles passing through midnight but will not work for more than 24 hours.
Examples:// Example 1: ft_Sleep( 10.0 ) // Sleep for 10.0 seconds // Example 2: nTime := Seconds() // usually after some interupt from mouse or // keyboard // ... intervening code ... // ft_Sleep( 0.5, nTime ) // Sleep until the sytem clock is // nTime+0.5 seconds.
Status:
Compliance:
Files:
See also:
Back to index


ft_XBox

Lang:xbox.txt
Component:hbnf
Doc. source:hbnf\doc\en\xbox.txt
Template:
Category:Menus/Prompts
Subcategory:
Oneliner:Display a self-sizing message box and message
Syntax:ft_XBox( [ <cJustType> ], [ <cRetWait> ], [ <cBorType> ], ; [ <cBorColor> ], [ <cBoxColor> ], [ <nStartRow> ], ; [ <nStartCol> ], <cLine1>, <cLine2>, <cLine3>, ; <cLine4>, <cLine5>, <cLine6>, <cLine7>, <cLine8> ) -> NIL
Arguments:<cJustType> is a character indicating the type of text justification. "L" or "l" will cause the text to be left-justified in the box. Centered text is the default. <cRetWait> is a character which determines if the function will wait for a keypress after displaying the box. "W" or "w" will cause the function to wait for a keypress before returning control to the calling routine. Not waiting is the default <cBorType> is a character which determines whether a single or double border will be displayed. "D" or "d" will cause a double border to be displayed. A single border is the default. <cBorColor> is a character string denoting the border color. 'N/W' is the default if this parameter is not a string. <cBoxColor> is a character string denoting the text color. 'W/N' is the default if this parameter is not a string. <nStartRow> is a number denoting the starting row. If '99' is passed, the box is centered vertically. If necessary, nStartRow is decreased so the entire box can be displayed. <nStartCol> is a number denoting the starting column. If '99' is passed, the box is centered horizontally. If necessary, nStartCol is decreased so the entire box can be displayed. <cLine1> thru <cLine8> are 1 to 8 character strings to be displayed. They are truncated to fit on the screen if necessary.
Returns:NIL
Description:ft_XBox() allows the programmer to display a message box on the screen without needing to calculate the dimensions of the box. Only the upper left corner needs to be defined. The function will calculate the lower right corner based on the number and length of strings passed. A maximum of eight strings can be displayed. If a string is too long to fit on the screen it is truncated. The first seven parameters are optional. The default settings are: Lines of text are centered. Control is returned to the calling routine immediately. A single line border is painted. The border is black on white. The text is white on black. The box is centered both vertically and horizontally.
Examples:// The following displays a two-line box with default settings: ft_XBox( ,,,,,,, "This is a test", "of the ft_XBox() function" ) // The following uses all optional parameters and displays a three-line // box. The box is left-justified with a double border. It has a yellow // on red border and white on blue text. The function will wait for a // keypress before returning control to the calling routine. ft_XBox( "L", "W", "D", "GR+/R", "W/B", 5, 10, ; "It is so nice", ; "to not have to do the messy chore", ; "of calculating the box size!" )
Status:
Compliance:
Files:
See also:
Back to index


ft_NWLStat

Lang:nwlstat.txt
Component:hbnf
Doc. source:hbnf\doc\en\nwlstat.txt
Template:
Category:NetWare
Subcategory:
Oneliner:Return the current Novell NetWare logical station number
Syntax:ft_NWLStat() -> nStatNum
Arguments:None
Returns:A numeric corresponding to the current logical station number assigned by NetWare.
Description:In order to find out information about a particular node logged in to a NetWare server, you will need the logical station number, also known as a "connection number." This function will return that number. This will be a number from 1 to 100 under NetWare 286, or from 1 to 250 under NetWare 386. This is *not* the same as a physical station number. This function requires ft_int86(). This function does NOT test for the existence of the NetWare shell. The behavior is undefined if no shell is loaded.
Examples:? "Logical station: " + Str( ft_NWLStat() )
Status:
Compliance:
Files:
See also:
Back to index


ft_NWSemClose

Lang:nwsem.txt
Component:hbnf
Doc. source:hbnf\doc\en\nwsem.txt
Template:
Category:NetWare
Subcategory:
Oneliner:Close a NetWare semaphore
Syntax:ft_NWSemClose( <nHandle> ) -> nRc
Arguments:<nHandle> is the semaphore handle, returned from a previous call to ft_NWSemOpen().
Returns:nRc, a numeric, as follows: 0 - success 255 - invalid semaphore handle
Description:Call ft_NWSemClose() when the app is finished. This decrements the open count for the semaphore. If the open count hits zero, the semaphore is deleted by NetWare.
Examples:? "Close returns: " + Str( ft_NWSemClose( nHandle ) )
Status:
Compliance:
Files:
See also:ft_NWSemOpen() ft_NWSemEx() ft_NWSemWait() ft_NWSemSig() ft_NWSemLock()
Back to index


ft_NWSemEx

Lang:nwsem.txt
Component:hbnf
Doc. source:hbnf\doc\en\nwsem.txt
Template:
Category:NetWare
Subcategory:
Oneliner:Examine a NetWare semaphore's value and open count
Syntax:ft_NWSemEx( <nHandle>, <@nValue>, <@nOpenCnt> ) -> nRc
Arguments:<nHandle> is the semaphore handle, returned from a previous call to ft_NWSemOpen(). <@nValue> will get the current semaphore value. THIS NUMERIC ARGUMENT MUST BE PASSED BY REFERENCE! <@nOpenCnt> will get the current number of workstations that have opened the semaphore. THIS NUMERIC ARGUMENT MUST BE PASSED BY REFERENCE!
Returns:nRc, a numeric, as follows: 0 - success 255 - invalid semaphore handle In addition, nValue will be set to the semaphore's current value, and nOpenCnt will be set to the number of stations that have opened the semaphore.
Description:See the description for ft_NWSemOpen().
Examples:nInitVal := 2 nHandle := 0 nOpenCnt := 0 ft_NWSemOpen( "Semaphore Test", nInitVal, @nHandle, @nOpenCnt ) nRc := ft_NWSemWait( nHandle ) IF nRc == 254 ? "All slots for this resource are currently in use" QUIT ENDIF ft_NWSemEx( nHandle, @nValue, @nOpenCnt ) ? "Semaphore test -> Open at [" + ; hb_ntos( nOpenCnt ) + ; "] stations, value is [" + ; hb_ntos( nValue ) + "]"
Status:
Compliance:
Files:
See also:ft_NWSemOpen() ft_NWSemWait() ft_NWSemSig() ft_NWSemClose() ft_NWSemLock()
Back to index


ft_NWSemLock

Lang:nwsem.txt
Component:hbnf
Doc. source:hbnf\doc\en\nwsem.txt
Template:
Category:NetWare
Subcategory:
Oneliner:Perform a semaphore "lock"
Syntax:FT_NWSEMLOCK ( <cSemaphore>, <@nHandle> ) -> lRet
Arguments:<cSemaphore> is the name of a semaphore you want to "lock." <nHandle> is the semaphore's handle, if you get the lock. THIS MUST BE PASSED BY REFERENCE!
Returns:lRet == .T. if you get the lock, .T. if you don't. If the lock succeeds, <nHandle> will contain the semaphore handle. If it fails, the value of <nHandle> is undefined.
Description:ft_NWSemLock() uses the Nanforum Toolkit's NetWare Semaphore API functions in order to provide a general purpose "lock" you can use in a NetWare environment. An interesting byproduct of NetWare's semaphore functions is the "open count" which tells you how many connections have this semaphore open. This is different from the semaphore's _value_, which is set when the semaphore is opened and changed with Signal() and wait(). The point of semaphores is that you don't care how many users are using the resource; you merely wait on a semaphore until the resource becomes available or you give up. When you're done, you signal it and off you go. Back to the open count. ft_NWSemLock() opens the semaphore as named in <cSemaphore>. After it is opened, the open count is checked. If it is anything other than 1, that means someone else has it (or you failed in your open) so the semaphore is closed and the "lock" is refused. If the value is 1, then your app is that 1 station so the "lock" is granted. You can use a semaphore lock to control access to anything that Clipper's RLock() and FLock() can't help you with, such as text files written with the low level file i/o functions, etc.
Examples:LOCAL nHandle := 0 IF ft_NWSemLock( "error.log", @nHandle ) // Note, you aren't actually LOCKING this file, you are // just locking a semaphore by the same name. As long as // all apps that might be using this file are cooperating // with the same kind of semaphore lock, you can effectively // control access to the file. ELSE ? "Couldn't lock file." ENDIF // Processing, then: ft_NWSemUnlock( nHandle )
Status:
Compliance:
Files:
See also:ft_NWSemOpen() ft_NWSemEx() ft_NWSemWait() ft_NWSemSig() ft_NWSemUnlock()
Back to index


ft_NWSemOpen

Lang:nwsem.txt
Component:hbnf
Doc. source:hbnf\doc\en\nwsem.txt
Template:
Category:NetWare
Subcategory:
Oneliner:Open or create a NetWare semaphore
Syntax:ft_NWSemOpen( <cName>, <nInitVal>, <@nHandle>, <@nOpenCnt> ) -> nRc
Arguments:<cName> is the semaphore name, maximum length is 127 characters. <nInitVal> is the initial value for the semaphore. It must start as a positive number, to a maximum of 127. <@nHandle> is the semaphore handle. THIS MUST BE PASSED BY REFERENCE! On exit, <nHandle> will contain a numeric value that refers to the opened semaphore. You will need it to pass to other semaphore functions! PASS IT BY REFERENCE! <@nOpenCnt> is the number of stations that have opened the semaphore. THIS MUST BE PASSED BY REFERENCE! On exit, <nOpenCnt> will contain a numeric value.
Returns:nRc, a numeric result code, as follows: 0 - success 254 - Invalid semaphore name length 255 - Invalid semaphore value <nHandle> will contain the semaphore handle, and <nOpenCnt> will contain the number of stations that have opened the semaphore.
Description:A semaphore is simply a label that indirectly controls network activity. There is a semaphore name, which can be up to 127 characters, and an associated value, which can range from 0 to 127. A semaphore can be used for many things, but is most often used to limit the number of users in an application, and to control access to a network resource. A semaphore essentially allows you to place locks on resources other than files. An application begins the process by calling ft_NWSemOpen(). If the semaphore doesn't exist, NetWare will create it. ft_NWSemOpen() returns a handle that is used in other semaphore calls. Applications use ft_NWSemWait() to wait for a semaphore to become available. ft_NWSemWait() decrements the semaphore's value by 1. If the value > 0, then the application should be allowed to access the semaphore's resource. If the value goes negative, then the application is placed in a queue. How long your app is in the queue is determined by how you set the timeout parameter. If you can't get the resource in the time you allot, you're let out of the queue and the value increments by 1 again. When an application finishes with a semaphore, it should call ft_NWSemSig() to increment the value, and then ft_NWSemClose() to close the semaphore. When the semaphore's open count goes to 0, NetWare deletes it. ft_NWSemEx() can be used to examine the value and open count without affecting them. For an interesting discussion on the operating system aspects of semaphores, check "Operating Systems Design and Implementation" by A. Tanenbaum, page 60. For more details on NetWare's semaphore facilities, refer to Charles Rose's "Programmer's Guide to NetWare". The "Programmer's Guide" will make an excellent companion guide to the source code for all NetWare functions in the Nanforum Toolkit.
Examples:LOCAL nInitVal, nRc, nHandle, nOpenCnt nInitVal := 2 nRc := ft_NWSemOpen( "Semaphore Test", nInitVal, ; @nHandle, @nOpenCnt ) IF nRc != 0 ? "Error: " + Str( nRc ) QUIT ENDIF
Status:
Compliance:
Files:
See also:ft_NWSemEx() ft_NWSemWait() ft_NWSemSig() ft_NWSemClose() ft_NWSemLock()
Back to index


ft_NWSemSig

Lang:nwsem.txt
Component:hbnf
Doc. source:hbnf\doc\en\nwsem.txt
Template:
Category:NetWare
Subcategory:
Oneliner:Signal a NetWare semaphore (increment)
Syntax:ft_NWSemSig( nHandle ) -> nRc
Arguments:<nHandle> is the semaphore handle, returned from a previous call to ft_NWSemOpen().
Returns:nRc, a numeric, as follows 0 - success 1 - semaphore overflow ( value > 127 ) 255 - invalid semaphore handle
Description:Use ft_NWSemSig() when your app has finished with the resource locked by a semaphore. This will increase the value (thus making a slot available to another app). For more information, see the description under ft_NWSemOpen().
Examples:? "Signal returns: " + Str( ft_NWSemSig( nHandle ) )
Status:
Compliance:
Files:
See also:ft_NWSemOpen() ft_NWSemEx() ft_NWSemWait() ft_NWSemClose() ft_NWSemLock()
Back to index


ft_NWSemUnlock

Lang:nwsem.txt
Component:hbnf
Doc. source:hbnf\doc\en\nwsem.txt
Template:
Category:NetWare
Subcategory:
Oneliner:"Unlock" a semaphore locked by ft_NWSemLock()
Syntax:ft_NWSemUnlock( <nHandle> ) -> lRet
Arguments:<nHandle> is the semaphore handle returned from ft_NWSemLock()
Returns:lRet == .T. if you successfully unlock the semaphore, .F. if you don't. If this call fails, it could be that you're passing an invalid semaphore handle.
Description:This call unlocks a semaphore prevsiously locked via ft_NWSemLock(). It is important that you get a valid semaphore handle from ft_NWSemLock() before you use this call. Make sure when you call ft_NWSemLock() that you pass a numeric parameter in for the handle BY REFERENCE.
Examples:LOCAL nHandle := 0 IF ft_NWSemLock( "error.log", @nHandle ) // Note, you aren't actually LOCKING this file, you are // just locking a semaphore by the same name. As long as // all apps that might be using this file are cooperating // with the same kind of semaphore lock, you can effectively // control access to the file. ELSE ? "Couldn't lock file." ENDIF // Processing, then: ft_NWSemUnlock( nHandle )
Status:
Compliance:
Files:
See also:ft_NWSemOpen() ft_NWSemEx() ft_NWSemWait() ft_NWSemSig() ft_NWSemLock()
Back to index


ft_NWSemWait

Lang:nwsem.txt
Component:hbnf
Doc. source:hbnf\doc\en\nwsem.txt
Template:
Category:NetWare
Subcategory:
Oneliner:Wait on a NetWare semaphore (decrement)
Syntax:ft_NWSemWait( <nHandle> [, nTimeout ] ) -> nRc
Arguments:<nHandle> is the semaphore handle, returned from a previous call to ft_NWSemOpen(). <nTimeOut> is an optional parameter telling how long you wish to wait on this semaphore. This is a numeric indicating the number of clock ticks (approx 1/18 sec ) to wait. A zero (the default) means "don't wait."
Returns:nRc, a numeric, as follows: 0 - success 254 - timeout failure 255 - invalid semaphore handle
Description:See the description for the ft_NWSemOpen() function.
Examples:ft_NWSemOpen( "Semaphore Test", nInitVal, @nHandle, @nOpenCnt ) nRc := ft_NWSemWait( nHandle ) IF nRc == 254 ? "All slots for this resource are currently in use" QUIT ENDIF
Status:
Compliance:
Files:
See also:ft_NWSemOpen() ft_NWSemEx() ft_NWSemSig() ft_NWSemClose() ft_NWSemLock()
Back to index


ft_NWUID

Lang:nwuid.txt
Component:hbnf
Doc. source:hbnf\doc\en\nwuid.txt
Template:
Category:NetWare
Subcategory:
Oneliner:Return the current Novell NetWare User ID
Syntax:ft_NWUID( [ <nConnection> ] ) -> cUid
Arguments:<nConnection> is a connection number, or logical station number, to find a userid for. Under NetWare 286, this number can be from 1 to 100. Under NetWare 386, 1-250. If not supplied, ft_NWUID() defaults to the current connection (i.e., the connection running the application).
Returns:A string containing the userid, or "login name." The maximum length of this string, as defined by current versions of Novell NetWare, is 48 characters.
Description:ft_NWUID() returns the current NetWare userid, or "login name." This is useful for implementing security or audit trail procedures within your programs. There is no simple way a user can "fool" this function into retrieving an incorrect value, provided a NetWare shell is loaded. This function requires ft_int86() and ft_NWLStat() This function does NOT test for the existence of the NetWare shell. The behavior is undefined if no shell is loaded. You'll usually get garbage. This function has not been tested on NetWare 386.
Examples:? "I am: " + ft_NWUID() FOR x := 1 TO 100 cUid := ft_NWUID( x ) IF ! Empty( cUid ) ? Str( x, 3 ) + Space( 3 ) + cUid ENDIF NEXT
Status:
Compliance:
Files:
See also:
Back to index


BASE/1003

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Attempt to access nonexisting or hidden variable
Syntax:
Arguments:
Returns:
Description:The specified variable was not found. If it is a database field ensure that the required database is open. If it is a private or public variable then it must be first created using PRIVATE or PUBLIC statement.
Examples:
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1068

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Invalid type of argument
Syntax:
Arguments:
Returns:
Description:The used data is not of logical type.
Examples:
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1068

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Bound error in array access
Syntax:
Arguments:
Returns:
Description:The attempt to retrieve data from non-array value.
Examples:
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1068

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Bound error in array element assignment
Syntax:
Arguments:
Returns:
Description:The specified index into an array was greater then the number of elements in the array.
Examples:
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1069

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Bound error in array access
Syntax:
Arguments:
Returns:
Description:The attempt to set data to non-array value.
Examples:
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1072

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Invalid type of arguments
Syntax:
Arguments:
Returns:
Description:The type of compared arguments do not match.
Examples:<>
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1073

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Invalid type of arguments
Syntax:
Arguments:
Returns:
Description:The type of compared argument do not match.
Examples:<
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1074

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Invalid type of arguments
Syntax:
Arguments:
Returns:
Description:The type of compared arguments do not match.
Examples:<=
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1075

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Invalid type of arguments
Syntax:
Arguments:
Returns:
Description:The type of compared arguments do not match.
Examples:>
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1076

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Invalid type of arguments
Syntax:
Arguments:
Returns:
Description:The type of compared arguments do not match.
Examples:>=
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1076

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Invalid type of arguments
Syntax:
Arguments:
Returns:
Description:The value of argument cannot be incremented.
Examples:++
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1076

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Invalid type of arguments
Syntax:
Arguments:
Returns:
Description:The arguments of '$' operator are not a strings.
Examples:
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1077

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Invalid type of arguments
Syntax:
Arguments:
Returns:
Description:Operation is not allowed for passed argument. The argument is not a logical value.
Examples:!
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1078

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Invalid type of arguments
Syntax:
Arguments:
Returns:
Description:The type of compared arguments do not match.
Examples:==
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1078

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Invalid type of arguments
Syntax:
Arguments:
Returns:
Description:The type of one or both arguments is not a logical.
Examples:.AND.
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1079

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Invalid type of arguments
Syntax:
Arguments:
Returns:
Description:The type of one or both arguments is not a logical.
Examples:.OR.
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1081

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Invalid type of arguments
Syntax:
Arguments:
Returns:
Description:The plus operation is not allowed for used arguments.
Examples:+
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1082

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Invalid type of arguments
Syntax:
Arguments:
Returns:
Description:The minus operation is not allowed for used arguments.
Examples:-
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1085

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:The argument (or arguments) passed to a function is not an numeric value
Examples:MOD
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1089

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:The argument (or arguments) passed to a function is not an numeric value
Examples:ABS
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1090

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:The argument (or arguments) passed to a function is not an numeric value
Examples:INT
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1092

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:The argument (or arguments) passed to a function is not an numeric value
Examples:MIN
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1093

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:The argument (or arguments) passed to a function is not an numeric value
Examples:MAX
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1094

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:The argument (or arguments) passed to a function is not an numeric value
Examples:ROUND
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1095

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:The argument (or arguments) passed to a function is not an numeric value
Examples:LOG
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1096

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:The argument (or arguments) passed to a function is not an numeric value
Examples:EXP
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1097

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:The argument (or arguments) passed to a function is not an numeric value
Examples:SQRT
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1098

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:The argument (or arguments) passed to a function is not a string value
Examples:VAL
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1099

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:The argument (or arguments) passed to a function is not a numeric value
Examples:STR
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1100

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Incorrect type of argument
Syntax:
Arguments:
Returns:
Description:The specified argument is not a string.
Examples:RTRIM, TRIM
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1101

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Incorrect type of argument
Syntax:
Arguments:
Returns:
Description:The specified argument is not a string.
Examples:LTRIM
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1102

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:The first argument passed to a function is not a string.
Examples:UPPER
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1103

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:The first argument passed to a function is not a string.
Examples:LOWER
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1104

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Incorrect type of argument
Syntax:
Arguments:
Returns:
Description:The specified argument is not a numeric value.
Examples:CHR
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1105

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:The arguments passed to a function are of incorrect type.
Examples:SPACE
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1106

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:The arguments passed to a function are of incorrect type.
Examples:REPLICATE
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1107

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Incorrect type of argument
Syntax:
Arguments:
Returns:
Description:The specified argument is not a string.
Examples:ASC
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1108

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Incorrect type of argument
Syntax:
Arguments:
Returns:
Description:The specified argument is not a string.
Examples:AT
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1110

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:The first argument passed to a function is not a string.
Examples:SUBSTR
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1110

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:The passed argument is neither a string nor an array.
Examples:LEN
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1112

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:The argument (or arguments) passed to a function are of incorrect type
Examples:YEAR
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1113

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:The argument (or arguments) passed to a function are of incorrect type
Examples:MONTH
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1114

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:The argument (or arguments) passed to a function are of incorrect type
Examples:DAY
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1115

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:The argument (or arguments) passed to a function are of incorrect type
Examples:DOW
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1116

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:The argument (or arguments) passed to a function are of incorrect type
Examples:CMONTH
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1117

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:The argument (or arguments) passed to a function is of incorrect type
Examples:CDOW
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1120

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:The argument (or arguments) passed to a function is of incorrect type
Examples:DTOS
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1122

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Incorrect type of argument
Syntax:
Arguments:
Returns:
Description:The argument (or arguments) passed to a function is of incorrect type
Examples:TRANSFORM
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1124

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Incorrect type of argument
Syntax:
Arguments:
Returns:
Description:The first argument is not a string.
Examples:LEFT
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1126

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:The first arguments passed to a function is not a string.
Examples:STRTRAN
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1132

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Bound error in array access
Syntax:
Arguments:
Returns:
Description:The specified index into an array was greater then the number of elements in the array.
Examples:
Status:
Compliance:C
Files:
See also:
Back to index


BASE/1133

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Bound error in array assignment
Syntax:
Arguments:
Returns:
Description:The specified index into an array was greater then the number of elements in the array.
Examples:
Status:
Compliance:C
Files:
See also:
Back to index


BASE/2010

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Incorrect arguments type
Syntax:
Arguments:
Returns:
Description:Passed Run time errors was not strings with filenames to copy/
Examples:__COPYFILE
Status:
Compliance:H
Files:
See also:
Back to index


BASE/2012

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:File error
Syntax:
Arguments:
Returns:
Description:An error has occurred during the attempt to open, create or write during copy operation
Examples:__COPYFILE
Status:
Compliance:C
Files:
See also:
Back to index


BASE/2017

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Invalid argument passed to a function
Syntax:
Arguments:
Returns:
Description:The first argument is not an array or/and the second argument is not a code block
Examples:AEVAL
Status:
Compliance:C
Files:
See also:
Back to index


BASE/2020

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:The passed value is negative. Only values > 0 are allowed.
Examples:SET DECIMALS SET EPOCH SET MARGIN SET MESSAGE
Status:
Compliance:C
Files:
See also:
Back to index


BASE/3001

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Incorrect argument type
Syntax:
Arguments:
Returns:
Description:The passed argument is not an object. Only data of type OBJECT can be cloned by this function
Examples:OCLONE
Status:
Compliance:H
Files:
See also:
Back to index


BASE/3002

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Super class does not return an object
Syntax:
Arguments:
Returns:
Description:Passed argument is not a name of defined class or specified class doesn't have a super class
Examples:__INSTSUPER
Status:
Compliance:H
Files:
See also:
Back to index


BASE/3003

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Cannot find super class
Syntax:
Arguments:
Returns:
Description:Passed argument is not a name of defined class
Examples:__INSTSUPER
Status:
Compliance:H
Files:
See also:
Back to index


BASE/3004

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Cannot modify a DATA item in a class
Syntax:
Arguments:
Returns:
Description:The attempt to modify a data member of a class was made. Only INLINE and METHOD can be modified
Examples:CLASSMOD
Status:
Compliance:H
Files:
See also:
Back to index


BASE/3005

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Incorrect arguments type
Syntax:
Arguments:
Returns:
Description:Either the first argument was not an object or the second argument wasn't a string.
Examples:ISMESSAGE, OSEND
Status:
Compliance:H
Files:
See also:
Back to index


BASE/3007

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Invalid type of argument
Syntax:
Arguments:
Returns:
Description:The passed arguments are causing conflict in handling of the request. There is no point in waiting forever for no input events!
Examples:INKEY
Status:
Compliance:H
Files:
See also:
Back to index


BASE/3008

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Invalid type of argument
Syntax:
Arguments:
Returns:
Description:The passed argument(s) is not a string. It should be a string with a variable name or an one-dimensional array of strings.
Examples:__MVPRIVATE, __MVPUBLIC
Status:
Compliance:H
Files:
See also:
Back to index


BASE/3009

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Incorrect argument passed to __MVGET function
Syntax:
Arguments:
Returns:
Description:__MVGET function expects only one argument: a string with a name of variable. The value of this variable will be returned.
Examples:__MVGET
Status:
Compliance:H
Files:
See also:
Back to index


BASE/3010

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Incorrect argument passed to __MVPUT function
Syntax:
Arguments:
Returns:
Description:__MVPUT function expects at least one argument: a string with a name of variable. The value of this variable will be set.
Examples:__MVPUT
Status:
Compliance:H
Files:
See also:
Back to index


BASE/3011

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Invalid argument passed to a function
Syntax:
Arguments:
Returns:
Description:The attempt to retrieve the function argument that was not passed. The number of requested argument is greater then the number of passed arguments.
Examples:PVALUE
Status:
Compliance:H
Files:
See also:
Back to index


BASE/3012

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Invalid argument passed to a function
Syntax:
Arguments:
Returns:
Description:The first argument is not a string with function/procedure name that should be called.
Examples:DO
Status:
Compliance:H
Files:
See also:
Back to index


BASE/3101

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Invalid argument passed to an object/class function
Syntax:
Arguments:
Returns:
Description:One passed argument is not of the required type.
Examples:__OBJ*()
Status:
Compliance:H
Files:
See also:
Back to index


BASE/3102

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:A symbol should be modified or deleted from a class, but the symbol doesn't exist.
Syntax:
Arguments:
Returns:
Description:A symbol should be modified or deleted from a class, but the symbol doesn't exist.
Examples:__OBJ*()
Status:
Compliance:H
Files:
See also:
Back to index


BASE/3103

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:A symbol should be added to a class, but the symbol already exists.
Syntax:
Arguments:
Returns:
Description:A symbol should be added to a class, but the symbol already exists.
Examples:__OBJ*()
Status:
Compliance:H
Files:
See also:
Back to index


TERM/2013

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Create error
Syntax:
Arguments:
Returns:
Description:The specified file cannot be created due some OS error.
Examples:SET, SET ALTERNATE TO
Status:
Compliance:C
Files:
See also:
Back to index


TOOLS/4001

Lang:subcodes.txt
Component:harbour
Doc. source:.\doc\en\subcodes.txt
Template:Run time error
Category:Run time errors
Subcategory:
Oneliner:Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:The second arguments passed to a function is not a string.
Examples:ISLEAPYEAR
Status:
Compliance:H
Files:
See also:
Back to index


ft_At2

Lang:at2.txt
Component:hbnf
Doc. source:hbnf\doc\en\at2.txt
Template:
Category:String
Subcategory:
Oneliner:Find position of the nth occurrence of a substring
Syntax:ft_At2( <cSearch>, <cTarget> [, <nOccurs> [, <lCaseSens> ] ] ) -> nPos
Arguments:<cSearch> is the character substring to search for. <cTarget> is the character string to search. <nOccurs> is the occurrence of cSearch to look for, defaults to 1. <lCaseSens> is a logical value denoting case sensitivity. If .F., then search is NOT sensitive to case, defaults to .T.
Returns:The position of the nth occurrence of a substring
Description:This function will find the nth occurrence of a substring within a string.
Examples:cSearch := "t" cTarget := "This is the day that the Lord has made." ft_At2( cSearch, cTarget ) // Returns ( 9 ) ft_At2( cSearch, cTarget, 2 ) // Returns ( 17 ) ft_At2( cSearch, cTarget, 2, .F. ) // Returns ( 9 )
Status:
Compliance:
Files:
See also:ft_FindITh(), ft_RAt2()
Back to index


ft_BitClr

Lang:bitclr.txt
Component:hbnf
Doc. source:hbnf\doc\en\bitclr.txt
Template:
Category:String
Subcategory:
Oneliner:Clear (reset) selected bit in a byte
Syntax:ft_BitClr( <cByte>, <nBitPos> ) -> cByte
Arguments:<cByte> is a character from hb_BChar( 0 ) to hb_BChar( 255 ). <nBitPos> is a number from 0 to 7 conforming to standard right-to-left bit numbering convention and representing the position of the bit within the byte.
Returns:Returns new byte, with designated bit cleared (reset). If parameters are faulty, returns NIL.
Description:In effect, ANDs argument byte with a byte that has all bits set except the target bit. If bit is already clear (0), it remains clear. Note: Calls ft_IsBit() which is also in this Library. 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:// This code would clear bit 4 in a byte represented by hb_BChar( 115 ): cNewByte := ft_BitClr( hb_BChar( 115 ), 4 ) ? hb_BCode( cNewbyte ) // result: 99 ? cNewByte // result: "c" // This code would clear bit 5 in the byte represented by letter "A": ft_BitClr( "A", 5 ) // result: "A", since // bit 5 already clear
Status:
Compliance:
Files:
See also:ft_BitSet() ft_IsBit()
Back to index


ft_BitSet

Lang:bitset.txt
Component:hbnf
Doc. source:hbnf\doc\en\bitset.txt
Template:
Category:String
Subcategory:
Oneliner:Set selected bit in a byte
Syntax:ft_BitSet( <cByte>, <nBitPos> ) -> cByte
Arguments:<cByte> is a character from hb_BChar( 0 ) to hb_BChar( 255 ). <nBitPos> is a number from 0 to 7 conforming to standard right-to-left bit numbering convention and representing the position of the bit within the byte.
Returns:Returns new byte, with designated bit set. If parameters are faulty, returns NIL.
Description:In effect, ORs argument byte with a byte that has only the target bit set. If bit is already set, it remains set. Note: Calls ft_IsBit() which is also in this Library. 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:// This code would set bit 4 in a byte represented by hb_BChar( 107 ): cNewbyte := ft_BitSet( hb_BChar( 107 ), 4 ) ? hb_BCode( cNewbyte ) // result: 123 ? cNewbyte // result: "{" // This code would set bit 5 in the byte represented by the letter "A". ? ft_BitSet( "A", 5 ) // result: "a" // bit 5 set
Status:
Compliance:
Files:
See also:ft_BitClr() ft_IsBit()
Back to index


ft_ByteAnd

Lang:byteand.txt
Component:hbnf
Doc. source:hbnf\doc\en\byteand.txt
Template:
Category:String
Subcategory:
Oneliner:Perform bit-wise AND on two ASCII characters (bytes)
Syntax:ft_ByteAnd( <cByte1>, <cByte2> ) -> cByte
Arguments:<cByte1> and <cByte2> are characters from hb_BChar( 0 ) to hb_BChar( 255 ). May be passed in hb_BChar() form, as character literals, or as expressions evaluating to character values.
Returns:Returns resulting byte, as a string. If parameters are faulty, returns NIL.
Description:Can be used for any bit-wise masking operation. In effect, this is a bit-by-bit AND operation. Equivalent to AND assembler instruction. 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:// This code would mask out the high nibble (four most significant bits) // of the byte represented by hb_BChar( 123 ) and leave the low nibble // bits as in the parameter byte. cNewbyte := ft_ByteAnd( hb_BChar( 123 ), hb_BChar( 15 ) ) ? hb_BCode( cNewByte ) // result: 11 ? cNewByte // result: non-printable character
Status:
Compliance:
Files:
See also:ft_ByteOr() ft_ByteXor() ft_ByteNot() ft_ByteNeg()
Back to index


ft_ByteNeg

Lang:byteneg.txt
Component:hbnf
Doc. source:hbnf\doc\en\byteneg.txt
Template:
Category:String
Subcategory:
Oneliner:Perform bit-wise negation on an ASCII character
Syntax:ft_ByteNeg( <cByte> ) -> cNewByte
Arguments:<cByte> is a character from hb_BChar( 0 ) to hb_BChar( 255 ). May be passed in hb_BChar() form, as character literals, or as expressions evaluating to character values.
Returns:Returns resulting byte, as a string. If parameters are faulty, returns NIL.
Description:Can be used for bit-wise byte manipulation. In effect, this is a bit-by-bit NEG (two's complement) operation. Equivalent to NEG assembler instruction. 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:// This code performs a bit-wise NEG on byte represented by hb_BChar( 32 ): cNewByte := ft_ByteNot( hb_BChar( 32 ) ) ? hb_BCode( cNewByte ) // result: 224
Status:
Compliance:
Files:
See also:ft_ByteOr() ft_ByteXor() ft_ByteNot() ft_ByteAnd()
Back to index


ft_ByteNot

Lang:bytenot.txt
Component:hbnf
Doc. source:hbnf\doc\en\bytenot.txt
Template:
Category:String
Subcategory:
Oneliner:Perform bit-wise NOT on an ASCII character (byte)
Syntax:ft_ByteNot( <cByte> ) -> cNewByte
Arguments:<cByte> is a character from hb_BChar( 0 ) to hb_BChar( 255 ). May be passed in hb_BChar() form, as character literals, or as expressions evaluating to character values.
Returns:Returns resulting byte, as a string. If parameters are faulty, returns NIL.
Description:Can be used for bitwise byte manipulation. In effect, this is a bit-by-bit NOT (one's complement) operation. Equivalent to the NOT assembler instruction. 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:// This code performs a bitwise NOT on byte represented by hb_BChar( 32 ): cNewByte := ft_ByteNot( hb_BChar( 32 ) ) ? hb_BCode( cNewByte ) // result: 223
Status:
Compliance:
Files:
See also:ft_ByteOr() ft_ByteXor() ft_ByteNeg() ft_ByteAnd()
Back to index


ft_ByteOr

Lang:byteor.txt
Component:hbnf
Doc. source:hbnf\doc\en\byteor.txt
Template:
Category:String
Subcategory:
Oneliner:Perform bit-wise OR on two ASCII characters (bytes)
Syntax:ft_ByteOr( <cByte1>, <cByte2> ) -> cNewByte
Arguments:<cByte1> and <cByte2> are characters from hb_BChar( 0 ) to hb_BChar( 255 ). May be passed in hb_BChar() form, as character literals, or as expressions evaluating to character values.
Returns:Returns resulting byte, as a string. If parameters are faulty, returns NIL.
Description:Can be used for bit-wise byte manipulation. In effect, this is a bit-by-bit OR operation. Equivalent to OR assembler instruction. 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:// This code performs a bit-wise OR on two bytes represented // by hb_BChar( 20 ) and hb_BChar( 10 ): cNewByte := ft_ByteOr( hb_BChar( 20 ), hb_BChar( 10 ) ) ? hb_BCode( cNewByte ) // result: 30 ? cNewByte // result: non-printable character
Status:
Compliance:
Files:
See also:ft_ByteXor() ft_ByteNot() ft_ByteNeg() ft_ByteAnd()
Back to index


ft_ByteXor

Lang:bytexor.txt
Component:hbnf
Doc. source:hbnf\doc\en\bytexor.txt
Template:
Category:String
Subcategory:
Oneliner:Perform bit-wise XOR on two ASCII characters (bytes)
Syntax:ft_ByteXor( <cByte1>, <cByte2> ) -> cNewByte
Arguments:<cByte1> and <cByte2> are characters from hb_BChar( 0 ) to hb_BChar( 255 ). May be passed in hb_BChar() form, as character literals, or as expressions evaluating to character values.
Returns:Returns resulting byte, as a string. If parameters are faulty, returns NIL.
Description:Can be used for bit-wise byte manipulation. In effect, this is a bit-by-bit XOR operation. Equivalent to XOR assembler instruction. 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:// This code performs a bit-wise XOR on two bytes represented // by hb_BChar( 32 ) and hb_BChar( 55 ): cNewByte := ft_ByteXor( hb_BChar( 32 ), hb_BChar( 55 ) ) ? hb_BCode( cNewByte ) // result: 23 ? cNewByte // result: non-printable character
Status:
Compliance:
Files:
See also:ft_ByteOr() ft_ByteNot() ft_ByteNeg() ft_ByteAnd()
Back to index


ft_Color2N

Lang:color2n.txt
Component:hbnf
Doc. source:hbnf\doc\en\color2n.txt
Template:
Category:String
Subcategory:
Oneliner:Returns the numeric complement of a Clipper color string
Syntax:ft_Color2N( <cColor> ) -> nValue
Arguments:<cColor> is a Clipper color string
Returns:The numeric complement of a color string or 0 if passed color is invalid.
Description:This function is useful when calling other functions that expect a numeric color parameter. It is often more convenient to pass a converted color string than having to calculate or look up the corresponding number.
Examples:nColor := ft_Color2N( "gr+/b" ) // returns 30 ft_SetAttr( 0, 0, 10, 10, nColor )
Status:
Compliance:
Files:
See also:ft_N2Color()
Back to index


ft_FindITh

Lang:findith.txt
Component:hbnf
Doc. source:hbnf\doc\en\findith.txt
Template:
Category:String
Subcategory:
Oneliner:Find the "ith" occurrence of a substring within a string
Syntax:ft_FindITh( <cCheckFor>, <cCheckIn>, <nWhichOccurrence> ; [, <lIgnoreCase> ] ) -> <nStringPosition>
Arguments:<cCheckFor> is the string to search for. <cCheckIn> is the string to search. <nWhichOccurrence> is the number of the occurrence to find. <lIgnoreCase> is a logical indicating if the search is to be case sensitive. The default is no case sensitivity (.F.).
Returns:The position in the string cCheckIn of the ith occurrence of cCheckFor.
Description:This function finds the position in a string of the "ith" time another string appears in it.
Examples:// Find the Position in cMemoString of // the 10th Occurrence of "the", case // insensitive nNextPosition := ft_FindITh( "the", cMemoString, 10 )
Status:
Compliance:
Files:
See also:ft_At2()
Back to index


ft_IsBit

Lang:isbit.txt
Component:hbnf
Doc. source:hbnf\doc\en\isbit.txt
Template:
Category:String
Subcategory:
Oneliner:Test the status of an individual bit
Syntax:ft_IsBit( <cByte>, <nBitPos> ) -> lResult
Arguments:<cByte> is a character from hb_BChar( 0 ) to hb_BChar( 255 ). <nBitPos> is a number from 0 to 7 conforming to standard right-to-left bit-numbering convention and representing the position of the bit within the byte.
Returns:.T. if designated bit is set (1), .F. if not set (0), NIL if invalid parameters.
Description:Tests for status of any selected bit in the byte passed as a parameter. Byte must be presented in hb_BChar() form, as a literal constant, or as the one-byte character result of an expression. This function is presented to illustrate that bit-wise operations are possible with Clipper code. For greater speed, write .c versions and use the Clipper Extend system.
Examples:// This code tests whether bit 3 is set in the byte represented by // hb_BChar( 107 ): lBitflag := ft_IsBit( hb_BChar( 107 ), 3 ) ? lBitflag // result: .T. // This code tests whether bit 5 is set in the byte represented by ASCII // 65 (letter "A") ? ft_IsBit( "A", 5 ) // result: .F.
Status:
Compliance:
Files:
See also:ft_BitSet() ft_BitClr()
Back to index


ft_IsBitOn

Lang:isbiton.txt
Component:hbnf
Doc. source:hbnf\doc\en\isbiton.txt
Template:
Category:String
Subcategory:
Oneliner:Determine the state of individual bits in a number
Syntax:ft_IsBitOn( <nNumber>, <nBit> ) -> lResult
Arguments:<nNumber> is an integer for which a bit state needs to be checked. <nBit> is a number from 0 to 15 that indicates which bit to test.
Returns:.T. if the specified bit was on., .F. if off.
Description:This function is useful when dealing with binary integers. It will come in very handy if you use the ft_int86() function, because the CPU flags are returned as a series of bits. Using this function, you can determine the state of each CPU flag.
Examples:IF ft_IsBitOn( nCPUFlags, 0 ) ? "The carry flag was set." ENDIF IF ft_IsBitOn( nCPUFlags, 7 ) ? "The sign flag was set." ENDIF
Status:
Compliance:
Files:
See also:
Back to index


ft_Metaph

Lang:metaph.txt
Component:hbnf
Doc. source:hbnf\doc\en\metaph.txt
Template:
Category:String
Subcategory:
Oneliner:Convert a character string to MetaPhone format
Syntax:ft_Metaph( <cName> [, <nSize> ] ) -> cMetaPhone
Arguments:<cName> is the character string to convert <nSize> is the length of the character string to be returned. If not specified the default length is 4 bytes.
Returns:A phonetically spelled character string
Description:This function is a character function use to index and search for sound-alike or phonetic matches. It is an alternative to the SoundEx() function, and addresses some basic pronunciation rules, by looking at surrounding letters to determine how parts of the string are pronounced. ft_Metaph() will group sound-alikes together, and forgive shortcomings in spelling ability.
Examples:USE persons INDEX ON ft_Metaph( LastName ) TO lastname SEEK ft_Metaph( "Philmore" ) ? Found(), LastName // Result: .T. Philmore SEEK ft_Metaph( "Fillmore" ) ? Found(), LastName // Result: .T. Philmore
Status:
Compliance:
Files:
See also:
Back to index


ft_N2Color

Lang:n2color.txt
Component:hbnf
Doc. source:hbnf\doc\en\n2color.txt
Template:
Category:String
Subcategory:
Oneliner:Returns the string complement of a Clipper color number
Syntax:ft_Color2N( <nColor> ) -> cColor
Arguments:<nColor> a number representing a Clipper color
Returns:The string complement of a number representing a Clipper or a null string if the parameter is invalid
Description:This function is useful for converting a number to a Clipper color string.
Examples:cColor := ft_Color2N( 239 ) // returns "*+w/gr"
Status:
Compliance:
Files:
See also:ft_N2Color()
Back to index


ft_NoOccur

Lang:nooccur.txt
Component:hbnf
Doc. source:hbnf\doc\en\nooccur.txt
Template:
Category:String
Subcategory:
Oneliner:Find the number of times one string occurs in another
Syntax:ft_NoOccur( <cCheckFor>, <cCheckIn> ; [, <lIgnoreCase> ] ) -> <nOccurrences>
Arguments:<cCheckFor> is the string to search for <cCheckIn> is the string to search <lIgnoreCase> is a boolean variable to force case sensitivity (optional, defaults to .F.).
Returns:The number of times <cCheckFor> appears in <cCheckIn>
Description:This function finds the number of times a string occurs in a second string.
Examples:// Find the number of times "the" appears in cMemoString, case // insensitive nNoOfOccurrences := ft_NoOccur( "the", cMemoString ) // Find the number of times "the" appears in cMemoString, case // sensitive nNoOfOccurrences := ft_NoOccur( "the", cMemoString, .T. )
Status:
Compliance:
Files:
See also:
Back to index


ft_PChr

Lang:pchr.txt
Component:hbnf
Doc. source:hbnf\doc\en\pchr.txt
Template:
Category:String
Subcategory:
Oneliner:Convert printer control codes
Syntax:ft_PChr( <cString> ) -> <cPrinterFormat>
Arguments:<cString> is the representation of the printer control codes in text, numeric, hexadecimal, Epson command format, or any combination separated by commas.
Returns:A character string of printer control codes.
Description:This function is useful for allowing the user to enter printer control codes in text (enclosed in double quotes), numeric, hexadecimal, or Epson commands preceded by a slash and returns the printer control code equivalent. NOTES" - Combinations of text, numbers, hex, and commands must be separated by commas ("A",27,&1B,/RESET). - Text must be enclosed in double quotes ("x"). - Hexadecimal must be preceded by an ampersand (&1B). - Epson commands, listed below, must be preceded by a forward slash (/RESET). Epson commands: (slash commands are specific to the Epson) Job Control: /RESET or /INIT Reset or initialize the printer /BELL or /BEEP Cause the printer's speaker to beep (not HS) /CAN Clear print buffers (not MX) /SLOW Set low speed mode (not CR, HS, MX) /FAST Cancel low speed mode (not CR, HS, MX) /ONE Select Unidirectional mode /TWO Select Directional mode /ON Activate printer /OFF Turn off printer /FF or /EJECT Form Feed Page Control: /1/6 Set 6 lines per inch /1/8 Set 8 lines per inch /SKIP Set Skip perforation ON /SKIPOFF Set Skip perforation OFF Font Selection and Manipulation: /ITALIC Select italic char. set (only FX86, EX, LX, no LQ-1500, SX) /GRAPHIC Select graphic char. set (only FX86, EX, LX, no LQ-1500, SX) /ROMAN Choose Roman font /SANS Choose Sans Serif font /DRAFT Choose draft /NLQ Choose near letter quality /PICA Choose 10 chars per inch /ELITE Choose 12 chars per inch /COND or /SI Choose 15 chars per inch /EMPH Turn emphasize on /EMPHOFF Turn emphasize off /SPANISH Select spanish international char set /USA Select USA international char set
Examples:SET PRINTER ON cSetUp := "27,116,1" ? ft_PChr( cSetUp ) // -> hb_BChar( 27 ) + hb_BChar( 116 ) + hb_BChar( 1 ) // <select Epson char. graphics> ? ft_PChr( '27,"x",0' ) // -> hb_BChar( 27 ) + hb_BChar( 120 ) + hb_BChar( 0 ) // <Epson draft mode> ? ft_PChr( '&1B,"E"' ) // -> hb_BChar( 27 ) + hb_BChar( 69 ) // <HP reset> ? ft_PChr( "/ELITE,/NLQ" ) // -> hb_BChar( 27 ) + hb_BChar( 77 ) + ; // hb_BChar( 27 ) + hb_BChar( 120 ) + hb_BChar( 1 ) // <Epson elite & near letter quality>
Status:
Compliance:
Files:
See also:
Back to index


ft_Proper

Lang:proper.txt
Component:hbnf
Doc. source:hbnf\doc\en\proper.txt
Template:
Category:String
Subcategory:
Oneliner:Convert a string to proper-name case
Syntax:ft_Proper( <cString> ) -> cProperName
Arguments:<cString> is the string to be converted.
Returns:A string of the same length as <cString>, only converted to proper name case (upper/lower case).
Description:ft_Proper() uses a brute-force algorithm to convert a string to propername case. First, it capitalizes the first letter of all words starting after a blank, dash, or apostrophe. This catches most names, including special cases such as names beginning with O' (O'Malley, O'Reilly) and hyphenated names (such as Susan Chia-Mei Lo). Next, it does a specific adjustment for words beginning in "Mc" It finds the first 'Mc' and capitalizes the next character after it. It does this for all occurrences of Mc. The original ft_Proper() was written in Clipper by Glenn Scott and Mark Zechiel; it was re-written in C (and thus, optimized and enhanced) by Robert DiFalco.
Examples:PROCEDURE Main( cStr ) OutStd( ft_Proper( cStr ) + hb_eol() ) RETURN
Status:
Compliance:
Files:
See also:
Back to index


ft_RAt2

Lang:at2.txt
Component:hbnf
Doc. source:hbnf\doc\en\at2.txt
Template:
Category:String
Subcategory:
Oneliner:Find position of the reversed nth occurrence of a substring
Syntax:ft_RAt2( <cSearch>, <cTarget> [, <nOccurs> [, <lCaseSens> ] ] ) -> nPos
Arguments:<cSearch> is the character substring to search for. <cTarget> is the character string to search. <nOccurs> is the occurrence of cSearch to look for, defaults to 1. <lCaseSens> is a logical value denoting case sensitivity. If .F., then search is NOT sensitive to case, defaults to .T.
Returns:The position of the nth occurrence of a reversed substring
Description:This function will find the nth occurrence of a reversed substring within a string.
Examples:cSearch := "t" cTarget := "This is the day that the Lord has made." ft_RAt2( cSearch, cTarget ) // Returns ( 22 ) ft_RAt2( cSearch, cTarget, 2 ) // Returns ( 20 ) ft_RAt2( cSearch, cTarget, 2, .F. ) // Returns ( 22 )
Status:
Compliance:
Files:
See also:ft_FindITh(), ft_At2()
Back to index


gt_AsciiSum

Lang:hbgt.txt
Component:hbgt
Doc. source:hbgt\doc\en\hbgt.txt
Template:
Category:String Tools
Subcategory:
Oneliner:Sum the ascii values in a string.
Syntax:gt_AsciiSum(<cStr>) --> nSum
Arguments:<cStr> - The string to sum
Returns:<nSum> - The sum of all ascii values in <cStr>.
Description:Sum the ascii value of every character in the passed string and return the result.
Examples:
Status:R
Compliance:
Files:Library is hbgt
See also:
Back to index


gt_AscPos

Lang:hbgt.txt
Component:hbgt
Doc. source:hbgt\doc\en\hbgt.txt
Template:
Category:String Tools
Subcategory:
Oneliner:Return the ascii value of a specified character in a string
Syntax:gt_AscPos(<cStr>, <nPos>) --> nAscVal
Arguments:<cStr> - The string <nPos> - The position in <cStr>
Returns:<nAscVal> - The ascii value of SubStr(<cStr>, <nPos>, 1)
Description:Return the ascii value of a specified character in a string Equivalent (but much faster) to Asc(SubStr(cStr, nPos, 1) NOTE: invalid parameters will return -1 nPos > Len(cStr) will return -2 This last behaviour is different to the Funcky function of the same name. I changed the behaviour because some of the strings I process contain embedded NULs.
Examples:? gt_AscPos( "the cat sat on the mat", 3 ) // prints e
Status:R
Compliance:
Files:Library is hbgt
See also:
Back to index


gt_AtDiff

Lang:hbgt.txt
Component:hbgt
Doc. source:hbgt\doc\en\hbgt.txt
Template:
Category:String Tools
Subcategory:
Oneliner:Return the position where two strings begin to differ
Syntax:gt_AtDiff(<cStr1>, <cStr2>) --> nPos
Arguments:<cStr1> - A character string to compare <cStr2> - The string to compare with
Returns:<nPos> - The position in <cStr2> where <cStr1> begins to differ
Description:Return the position in <cStr2> where <cStr1> begins to differ. If the strings differ in the first character gt_AtDiff() will return 1. If the two strings are identical (or identical upto the last character in <cStr2>) the function will return 0. NOTE: invalid parameters will return -1
Examples:? gt_AtDiff( "the cat", "the rat" ) // prints 5 ? gt_AtDiff( "the cat", "the " ) // prints 0
Status:R
Compliance:
Files:Library is hbgt
See also:
Back to index


gt_CharEven

Lang:hbgt.txt
Component:hbgt
Doc. source:hbgt\doc\en\hbgt.txt
Template:
Category:String Tools
Subcategory:
Oneliner:Return a string of all the characters in even positions
Syntax:gt_CharEven(<cStr>) --> cRet
Arguments:<cStr> - A character string to extract chars from
Returns:<cRet> - A string of all the chars in even positions
Description:Return a string consisting of all the characters in even positions in <cStr1>. NOTE: invalid parameters will return ""
Examples:? gt_CharEven( "abcdefghijklm" ) // prints "bdfhjl"
Status:R
Compliance:
Files:Library is hbgt
See also:
Back to index


gt_CharMix

Lang:hbgt.txt
Component:hbgt
Doc. source:hbgt\doc\en\hbgt.txt
Template:
Category:String Tools
Subcategory:
Oneliner:Amalgamate two strings to form the return value
Syntax:gt_CharMix(<cStr1>, <cStr2>) --> cRet
Arguments:<cStr1> - A character string to mix <cStr2> - A character string to mix with
Returns:<cRet> - A string consisting of all the characters in <cStr1> mixed with all the characters in <cStr2>
Description:Return a string consisting of all the characters in <cStr1> mixed with the characters from <cStr2>. NOTE: invalid parameters will return ""
Examples:? gt_CharMix( "abc", "123" ) // prints "a1b2c3" ? gt_CharMix( "abcde", "123" ) // prints "a1b2c3de" ? gt_CharMix( "abc", "12345" ) // prints "a1b2c345"
Status:R
Compliance:
Files:Library is hbgt
See also:
Back to index


gt_CharOdd

Lang:hbgt.txt
Component:hbgt
Doc. source:hbgt\doc\en\hbgt.txt
Template:
Category:String Tools
Subcategory:
Oneliner:Return a string of all the characters in odd positions
Syntax:gt_CharOdd(<cStr>) --> cRet
Arguments:<cStr> - A character string to extract chars from
Returns:<cRet> - A string of all the chars in odd positions
Description:Return a string consisting of all the characters in odd positions in <cStr1>. NOTE: invalid parameters will return ""
Examples:? gt_CharOdd( "abcdefghijklm" ) // prints "acegikm"
Status:R
Compliance:
Files:Library is hbgt
See also:
Back to index


gt_ChrCount

Lang:hbgt.txt
Component:hbgt
Doc. source:hbgt\doc\en\hbgt.txt
Template:
Category:String Tools
Subcategory:
Oneliner:Count the number of times a character appears in a string
Syntax:gt_ChrCount(<cChr>, <cStr>) --> nFreq
Arguments:<cChr> - The character to find the frequence of <cStr> - The string in which to find the character
Returns:nFreq - The number of times <cChr> occurs in <cStr>
Description:gt_ChrCount() counts how many times a specified character appears in a string. NOTE: invalid parameters will return -1
Examples:? gt_ChrCount( "t", "the cat sat on the mat" ) // prints 4
Status:R
Compliance:
Files:Library is hbgt
See also:
Back to index


gt_ChrFirst

Lang:hbgt.txt
Component:hbgt
Doc. source:hbgt\doc\en\hbgt.txt
Template:
Category:String Tools
Subcategory:
Oneliner:Find which character occurs first in a string
Syntax:gt_ChrFirst(<cChars>, <cStr>) --> nAsc
Arguments:<cChars> - The set of characters to find <cStr> - The input string
Returns:<nAsc> - The ASCII value of the first character in <cChars> which appears first in <cStr>
Description:Return the ascii value of a character in <cChars> which appears first in <cStr>.
Examples:? Chr( gt_ChrFirst( "sa ", "This is a test" ) ) // prints "s" ? Chr( gt_ChrFirst( "et", "This is a test" ) ) // prints "t"
Status:R
Compliance:
Files:Library is hbgt
See also:
Back to index


gt_ChrTotal

Lang:hbgt.txt
Component:hbgt
Doc. source:hbgt\doc\en\hbgt.txt
Template:
Category:String Tools
Subcategory:
Oneliner:Find number of times a set of characters appears in a string
Syntax:gt_ChrTotal(<cChrs>, <cStr>) --> nTotOcc
Arguments:<cChrs> - The set of characters <cStr> - The string to search
Returns:<nTotOcc> - The number of times the characters specified in <cChrs> appears in <cStr>
Description:Returns the numnber of occurrences of characters belonging to the set <cChrs> in the string <cStr>. If no characters in <cChrs> appears in <cStr> gt_ChrTotal() will return 0. NOTE: invalid parameters will return -1
Examples:LOCAL cStr1 := "the cat sat on the mat" ? gt_ChrTotal( "tae", cStr1 ) // prints 10 ? gt_ChrTotal( "zqw", cStr1 ) // prints 0
Status:R
Compliance:
Files:Library is hbgt
See also:
Back to index


gt_StrCount

Lang:hbgt.txt
Component:hbgt
Doc. source:hbgt\doc\en\hbgt.txt
Template:
Category:String Tools
Subcategory:
Oneliner:Count the number of times a substring appears in a string
Syntax:gt_StrCount(<cChrs>, <cStr>) --> nFreq
Arguments:<cChrs> - The substring to find the frequence of <cStr> - The string in which to find the character
Returns:<nFreq> - The number of times <cChrs> occurs in <cStr>
Description:gt_StrCount() counts how many times a specified substring appears in a string. If the substring does NOT appear in <cStr> this function will return 0. If the substring is a single character use gt_ChrCount() as it will be faster. NOTE: invalid parameters will return -1
Examples:? gt_StrCount( "the", "the cat sat on the mat" ) // prints 2
Status:R
Compliance:
Files:Library is hbgt
See also:
Back to index


gt_StrCSPN

Lang:hbgt.txt
Component:hbgt
Doc. source:hbgt\doc\en\hbgt.txt
Template:
Category:String Tools
Subcategory:
Oneliner:Return length of prefix in string of chars NOT in set.
Syntax:gt_StrCSPN(<cString>, <cSet>) --> nLength
Arguments:<cString> - The string to find the prefix in <cSet> - The set of characters
Returns:<nLength> - The length of a string upto a character in the set
Description:Return the number of characters in the leading segment of a string that consists solely of characters NOT in the set.
Examples:? gt_StrCSPN( "this is a test", "as " ) // prints 3 ? gt_StrCSPN( "this is a test", "elnjpq" ) // prints 11
Status:R
Compliance:
Files:Library is hbgt
See also:
Back to index


gt_StrDiff

Lang:hbgt.txt
Component:hbgt
Doc. source:hbgt\doc\en\hbgt.txt
Template:
Category:String Tools
Subcategory:
Oneliner:Return a string where it begins to differ from another
Syntax:gt_StrDiff(<cStr1>, <cStr2>) --> cRet
Arguments:<cStr1> - A character string to compare <cStr2> - The string to compare with
Returns:<cRet> - A string beginning at the position in <cStr2> where <cStr1> begins to differ from <cStr1>
Description:Return a string beginning at the position in <cStr2> where <cStr1> begins to differ from <cStr1>. If the two strings are identical (or identical upto the last character in <cStr2>) the function will return "". NOTE: invalid parameters will return ""
Examples:? gt_StrDiff( "the cat", "the rat" ) // prints "rat" ? gt_StrDiff( "the cat", "the " ) // prints ""
Status:R
Compliance:
Files:Library is hbgt
See also:
Back to index


gt_StrExpand

Lang:hbgt.txt
Component:hbgt
Doc. source:hbgt\doc\en\hbgt.txt
Template:
Category:String Tools
Subcategory:
Oneliner:Insert fillers between characters in a passed string
Syntax:gt_StrExpand(<cStr>, [<nNum>], [<cChar>]) --> cRet
Arguments:<cStr1> - A character string to insert chars into <nNum> - The number of fill characters to insert (default 1) <cChar> - The fill chararacter (default space)
Returns:<cRet> - The input string with fill characters inserted between every character in the original.
Description:Inserts fill characters into a string. NOTE: invalid parameters will return ""
Examples:? gt_StrExpand( "abc" ) // prints "a b c" ? gt_StrExpand( "abc", 2 ) // prints "a b c" ? gt_StrExpand( "abc", 2, '|' ) // prints "a||b||c"
Status:R
Compliance:
Files:Library is hbgt
See also:
Back to index


gt_StrLeft

Lang:hbgt.txt
Component:hbgt
Doc. source:hbgt\doc\en\hbgt.txt
Template:
Category:String Tools
Subcategory:
Oneliner:Find length of prefix of a string
Syntax:gt_StrLeft(<cStr>, <cChars>) --> nLen
Arguments:<cStr> - The input string <cChars> - The set of characters to find
Returns:nLen - The length of the prefix found.
Description:Return the length of the leading segment in the passed string <cStr> that consists solely of the characters in the character set <cChars>. If no characters in the the search set are found, the function shall return 0
Examples:? gt_StrLeft( "this is a test", "hsit " ) // prints 8 ? gt_StrLeft( "this is a test", "hit a" ) // prints 3 ? gt_StrLeft( "this is a test", "zxy" ) // prints 0
Status:R
Compliance:
Files:Library is hbgt
See also:
Back to index


gt_StrPBRK

Lang:hbgt.txt
Component:hbgt
Doc. source:hbgt\doc\en\hbgt.txt
Template:
Category:String Tools
Subcategory:
Oneliner:Return string after 1st char from a set
Syntax:gt_StrPBRK(<cStr>, <cSet>) --> cString
Arguments:<cStr> - The input string <cSet> - The set of characters to find
Returns:<cString> - The input string after the first occurance of any character from <cSet>
Description:Return a string after the first occurance of any character from the input set <cSet>.
Examples:? gt_StrPBRK( "This is a test", "sa " ) // prints "s is a test" ? gt_StrPBRK( "This is a test", "et" ) // prints "test"
Status:R
Compliance:
Files:Library is hbgt
See also:
Back to index


gt_StrRight

Lang:hbgt.txt
Component:hbgt
Doc. source:hbgt\doc\en\hbgt.txt
Template:
Category:String Tools
Subcategory:
Oneliner:Find length of a suffix of a string
Syntax:gt_StrRight(<cStr>, <cChars>) --> nLen
Arguments:<cStr> - The input string <cChars> - The set of characters to find
Returns:<nLen> - The length of the prefix found.
Description:Return the length of the trailing segment in the passed string <cStr> that consists solely of the characters in the character set <cChars>. If no characters in the the search set are found, the function shall return 0
Examples:? gt_StrRight( "this is a test", "teas " ) // prints 8 ? gt_StrRight( "this is a test", "tes h" ) // prints 5 ? gt_StrRight( "this is a test", "zxy" ) // prints 0
Status:R
Compliance:
Files:Library is hbgt
See also:
Back to index


StrFormat

Lang:ht_str.txt
Component:hbmisc
Doc. source:hbmisc\doc\en\ht_str.txt
Template:
Category:String Tools
Subcategory:
Oneliner:Format a string
Syntax:StrFormat(<cMask>[, <cPar1>[, <cParn>[, ...]]) --> cString
Arguments:<cMask> Holds the mask for the resulting string </par> <cParn> Holds the strings to be inserted in the mask maximum 9 of them can be specified. </par>
Returns:<cString> Return the mask with all the parameters inserted. </par>
Description:String replacment, can be useful when writing international apps. You can separate the constant strings from the variable ones. Each %1 - %9 marks will be replaced with the appropriate parameter from the parameter list. </par> Marks can be in any order, and can be duplicated. </par> You can print "%" character with "%%". </par>
Examples:StrFormat( "Please insert disk %1 to drive %2", hb_ntos( 2 ), "A:" ) StrFormat( "This is %1 from %2", "Victor", "Hungary" ) StrFormat( "%2 %1 %2", "Param1", "Param2" )
Status:Done
Compliance:All platforms
Files:Library is hbmisc
See also:
Back to index


TBrowseNew

Lang:tbrowse.txt
Component:harbour
Doc. source:.\doc\en\tbrowse.txt
Template:Class
Category:TBrowse class
Subcategory:
Oneliner:Create a Browse Object
Syntax:
Arguments:<nTop> Top Row <nLeft> Top Left Column <nBottom> Bottom Row <nRight> Bottom Right Column
Returns:<oBrowse> An new Browse Object
Description:This function set up a browsing window at top-left coordinates of <nTop>,<nLeft> to bottom-right coordinates of <nBottom>,<nRight>. To browse Database files use TBrowseDB() function insted.
Examples:See tests/tbrowse.prg
Status:S
Compliance:This functions is Compatible with CA-Cl*pper 5.2. The applykey() and SetKey() methods are only visible if HB_COMPAT_C53 is defined.
Files:Library is core
See also:TBrowseNew(),TBColumnNew()
Back to index


ft_Adapter

Lang:adapter.txt
Component:hbnf
Doc. source:hbnf\doc\en\adapter.txt
Template:
Category:Video
Subcategory:
Oneliner:Report the type of video adapter installed
Syntax:ft_Adapter() -> nResult
Arguments:None
Returns:Integer representing type of video adapter 0 - monochrome 1 - CGA 2 - EGA 3 - VGA
Description:This function is valuable if you use a graphics library and need to know what type of graphics adapter is installed. The source code is written to adhere to Turbo Assembler's IDEAL mode. To use another assembler, you will need to rearrange the PROC and SEGMENT directives, and also the ENDP and ENDS directives (a very minor task).
Examples:iVideo := ft_Adapter() DO CASE CASE iVideo == 0 QOut( "You have a monochrome adapter." ) CASE iVideo == 1 QOut( "You have a CGA adapter." ) CASE iVideo == 2 QOut( "You have an EGA adapter." ) CASE iVideo == 3 QOut( "You have a VGA adapter." ) ENDCASE
Status:
Compliance:
Files:
See also:ft_SetMode()
Back to index


ft_CLS

Lang:video1.txt
Component:hbnf
Doc. source:hbnf\doc\en\video1.txt
Template:
Category:Video
Subcategory:
Oneliner:Clear screen
Syntax:ft_CLS( <nTRow>, <nLCol>, <nBRow>, <nRCol>, <nColor> ) -> NIL
Arguments:<nTRow>, <nLCol>, <nBRow> and <nRCol> are the screen coordinates to clear. <nColor> is an integer representing the color attribute. The formula is: nFore + ( nBack * 16 ) The default is black.
Returns:NIL
Description:This is a high speed function to clear the screen at the given coordinates with the given color attribute. This does not change Clipper's color settings. It uses direct video writes for speed.
Examples:ft_CLS( 0, 0, MaxRow(), MaxCol(), 165 ) // This example will clear the entire screen with the colors // bright white on magenta.
Status:
Compliance:
Files:
See also:
Back to index


ft_GetMode

Lang:vidmode.txt
Component:hbnf
Doc. source:hbnf\doc\en\vidmode.txt
Template:
Category:Video
Subcategory:
Oneliner:Get the video mode
Syntax:ft_GetMode() -> nVMode
Arguments:None.
Returns:The video mode, as a numeric.
Description:Use this function to find out what mode your display adapter is in. Uses DOS interrupt 10h to get the mode. For a table of modes available on various graphics adapters, refer to a book such as Wilton's "Programmer's Guide to PC & PS/2 Video Systems" (Microsoft Press)
Examples:PROCEDURE Main( cMode ) ft_SetMode( Val( cMode ) ) ? "Video mode is: " + Str( ft_GetMode() ) RETURN
Status:
Compliance:
Files:
See also:
Back to index


ft_GetVCur

Lang:vidcur.txt
Component:hbnf
Doc. source:hbnf\doc\en\vidcur.txt
Template:
Category:Video
Subcategory:
Oneliner:Return info about the cursor on a specified video page
Syntax:ft_GetVCur( [<nPage>] ) -> <aCurInfo>
Arguments:<nPage> is the video page to get the cursor information for. Defaults to the current page, as returned by ft_GetVPg().
Returns:A four-element array (<aCurInfo>), set up as follows: aCurInfo[ 1 ] = Top line of cursor aCurInfo[ 2 ] = Bottom line of cursor aCurInfo[ 3 ] = Character row aCurInfo[ 4 ] = Character column
Description:ft_GetVCur() uses ft_int86() to invoke interrupt 10h, function 3, to return the character cursor location for the specified video page. The top line and bottom line of cursor are set depending on the current cursor mode, and are only meaningful in alphanumeric video modes. For more information on graphics programming, cursors, and cursor modes, refer to Richard Wilton's _Programmer's Guide to PC and PS/2 Video Systems_ (Microsoft Press).
Examples:aCurInfo := getVCur( 1 ) // Get info on cursor pos in page 1 ? "Row: " + Str( aCurInfo[ 3 ] ) + " Col: " + Str( aCurInfo[ 4 ] )
Status:
Compliance:
Files:
See also:
Back to index


ft_GetVPg

Lang:page.txt
Component:hbnf
Doc. source:hbnf\doc\en\page.txt
Template:
Category:Video
Subcategory:
Oneliner:Get the currently selected video page
Syntax:ft_GetVPg() -> <nPage>
Arguments:None.
Returns:The video page, as a numeric.
Description:Get the currently selected video page For more information on graphics programming and video pages, consult a reference such as _Programmer's Guide to PC and PS/2 Video Systems_ (Microsoft Press).
Examples:nPage := ft_GetVPg()
Status:
Compliance:
Files:
See also:ft_SetVpg()
Back to index


ft_PopVid

Lang:pvid.txt
Component:hbnf
Doc. source:hbnf\doc\en\pvid.txt
Template:
Category:Video
Subcategory:
Oneliner:Restore previously saved video states.
Syntax:ft_PopVid() -> <nStackSize>
Arguments:None
Returns:The number of items remaining in the internal stack.
Description:This is the complementary function to ft_PushVid(). At some time after saving the video states it will probably be necessary to restore them. This is done by restoring the settings from the last call to ft_PushVid(). The number of items on the internal stack is then reduced by one. Note that the use of stack logic means that items on the stack are retrieved in Last In First Out order.
Examples:ft_PopVid() // Restore video states
Status:
Compliance:
Files:
See also:ft_PushVid()
Back to index


ft_PushVid

Lang:pvid.txt
Component:hbnf
Doc. source:hbnf\doc\en\pvid.txt
Template:
Category:Video
Subcategory:
Oneliner:Save current video states on internal stack.
Syntax:ft_PushVid() -> <nStackSize>
Arguments:None
Returns:The current size of the internal stack (i.e. the number of times ft_PushVid() has been called).
Description:Menus, picklists, browses, and other video-intensive items often require you to save certain video states -- screen image, cursor position, and so forth. Constantly saving and restoring these items can get very tedious. This function attempts to alleviate this problem. When called, it saves the cursor position, color setting, screen image, cursor style, blink setting, scoreboard setting, snow setting, and maximum row and column to a series of static arrays. All that is needed to restore the saved settings is a call to ft_PopVid().
Examples:ft_PushVid() // Save the current video states
Status:
Compliance:
Files:
See also:ft_PopVid()
Back to index


ft_RestAtt

Lang:ftattr.txt
Component:hbnf
Doc. source:hbnf\doc\en\ftattr.txt
Template:
Category:Video
Subcategory:
Oneliner:Restore the attribute bytes of a specified screen region.
Syntax:ft_RestAtt( <nTop>, <nLeft>, <nBottom>, <nRight>, <cAttributes> ) -> NIL
Arguments:<nTop>, <nLeft>, <nBottom>, and <nRight> define the screen region. <cAttributes> is a character string containing the attribute bytes for the screen region. This will most often be a string previously returned by ft_SaveAtt(), but any character string may be used (provided it is of the proper size).
Returns:NIL
Description:This function is similar to Clipper's RestScreen(), except that it only restores the attribute bytes. This is useful if you want to change the screen color without affecting the text. *** INTERNALS ALERT *** This function calls the Clipper internals __gtSave and __gtRest to manipulate the the screen image. If you're too gutless to use internals, then this function isn't for you.
Examples:// Restore attributes of row 4 ft_RestAtt( 4, 0, 4, MaxCol(), cBuffer ) // Restore attributes to middle of screen ft_RestAtt( 10, 20, 14, 59, cBuffer )
Status:
Compliance:
Files:
See also:ft_SaveAtt()
Back to index


ft_RevAttr

Lang:video1.txt
Component:hbnf
Doc. source:hbnf\doc\en\video1.txt
Template:
Category:Video
Subcategory:
Oneliner:Reverse colors of specified screen coordinates
Syntax:ft_RevAttr( <nTRow>, <nLCol>, <nBRow>, <nRCol> ) -> NIL
Arguments:<nTRow>, <nLCol>, <nBRow>, and <nRCol> are the coordinates of the screen region.
Returns:NIL
Description:This is a high speed function to reverse the color of a specified screen region without disturbing any text on the screen. This function will correctly reverse the color attributes in a region containing multiple color combinations.
Examples:ft_RevAttr( 0, 0, MaxRow(), MaxCol() ) // This example will change the entire screen's colors to their reverse // attributes without changing or overwriting any text.
Status:
Compliance:
Files:
See also:
Back to index


ft_RevChr

Lang:video1.txt
Component:hbnf
Doc. source:hbnf\doc\en\video1.txt
Template:
Category:Video
Subcategory:
Oneliner:Reverse the color of a single character on the screen
Syntax:ft_RevChr( <nTRow>, <nLCol> ) -> NIL
Arguments:<nTRow>, <nLCol> are the screen coordinates of the character.
Returns:NIL
Description:This is a high speed function to reverse the color of a single character on the screen without changing the character itself. This function is the same as ft_RevAttr() except that it changes only one character on screen and hence is faster and uses less memory.
Examples:ft_RevChr( 10, 20 ) // This example will change the text and background at 10, 20 to it's // reverse color attributes without changing or overwriting the // character itself.
Status:
Compliance:
Files:
See also:
Back to index


ft_RgnStack

Lang:scregion.txt
Component:hbnf
Doc. source:hbnf\doc\en\scregion.txt
Template:
Category:Video
Subcategory:
Oneliner:Push or pop a saved screen region on or off the stack
Syntax:ft_RgnStack( <cAction>, [ <nTop> ], [ <nLeft> ], [ <nBottom> ], [ <nRight> ] ) -> NIL
Arguments:<cAction> determines what action ft_RgnStack() will take. The allowable values for this parameter are "push", "pop", and "pop all". If the function is called with any other string as the first parameter no action is performed. <cAction> with a value of "push" will push a saved screen region onto the stack. A value of "pop" will restore the most recently pushed screen region. "pop all" tells the function to restore all screen images which are currently on the stack. The use of <nTop>, <nLeft>, <nBottom>, and <nRight> depends on the <cAction> parameter. If <cAction> is "push", the next four parameters define the screen region to save. If <cAction> is "pop" or "pop all" the following four parameters are ignored.
Returns:ft_RgnStack() returns NIL.
Description:ft_RgnStack() allows multiple screens to be saved and restored from a stack. The stack is implemented with Clipper static array that is visible only to ft_RgnStack(). The purpose of ft_RgnStack() is to allow multiple screen regions to be managed without the need to remember the original coordinates or to create variables for each one. When called with "push", ft_RgnStack() places the saved screen area at the end of the static array. The array size is incremented by one to accommodate the new screen area. When called with "pop", the function restores the screen image stored in the last element of the array, and the array size is decremented by one. If "pop all" is specified, all the saved screens are restored until the array is empty. ft_RgnStack() calls ft_SavRgn() and ft_RstRgn(). Refer to the documentation for these two functions for more information.
Examples:// The following example uses ft_RgnStack() to save and restore various // sections of the screen. @ 0, 0, 24, 79 BOX "111111111" // fill the screen with 1's ft_RgnStack( "push", 10, 5, 15, 15 ) // push a region @ 0, 0, 24, 79 BOX "222222222" // fill the screen with 2's ft_RgnStack( "push", 10, 20, 15, 30 ) // push a region @ 0, 0, 24, 79 BOX "333333333" // fill the screen with 3's ft_RgnStack( "push", 10, 35, 15, 45 ) // push a region @ 0, 0, 24, 79 BOX "444444444" // fill the screen with 4's ft_RgnStack( "push", 10, 50, 15, 60 ) // push a region @ 0, 0, 24, 79 BOX "555555555" // fill the screen with 5's ft_RgnStack( "push", 10, 65, 15, 75 ) // push a region CLEAR ft_RgnStack( "pop" ) // restore the 5's region ft_RgnStack( "pop" ) // restore the 4's region ft_RgnStack( "pop all" ) // restore the 3's, 2's and 1's regions
Status:
Compliance:
Files:
See also:ft_SavRgn() ft_RstRgn()
Back to index


ft_RstRgn

Lang:scregion.txt
Component:hbnf
Doc. source:hbnf\doc\en\scregion.txt
Template:
Category:Video
Subcategory:
Oneliner:Restore region of the screen saved with ft_SavRgn()
Syntax:ft_RstRgn( <cScreen>, [ <nTop> ], [ <nLeft> ] ) -> NIL
Arguments:<cScreen> is a screen region previously returned from ft_SavRgn(). <nTop> and <nLeft> are optional parameters that define a new location for the upper left corner of the screen area contained in <cScreen>. Allowable values are 0 through 255.
Returns:ft_RstRgn() returns NIL.
Description:ft_RstRgn() restores a screen region previously saved with ft_SavRgn(). Calling ft_RstRgn() with <cScreen> as the only parameter will restore the saved region to its original location. <nTop> and <nLeft> may be used to define a new location for the upper left corner of the saved region. <nTop> and <nLeft> are dependent upon each other. You may not specify one without the other. ft_RstRgn() calls Clipper's RestScreen(). Refer to the Clipper documentation for more information regarding this function.
Examples:// The following example uses ft_RstRgn() to restore a saved portion // of the screen to different locations. @ 0, 0, 24, 79 BOX "111111111" // fill the screen with 1's cScreen := ft_SavRgn( 10, 10, 20, 30 ) // save a region @ 0, 0, 24, 79 BOX "222222222" // fill the screen with 2's ft_RstRgn( cScreen ) // restore the 1's region @ 0, 0, 24, 79 BOX "222222222" // fill the screen with 2's ft_RstRgn( cScreen, 15, 15 ) // restore to a different location @ 0, 0, 24, 79 BOX "222222222" // fill the screen with 2's ft_RstRgn( cScreen, 20, 60 ) // restore to a different location
Status:
Compliance:
Files:
See also:ft_SavRgn() ft_RgnStack()
Back to index


ft_SaveAtt

Lang:ftattr.txt
Component:hbnf
Doc. source:hbnf\doc\en\ftattr.txt
Template:
Category:Video
Subcategory:
Oneliner:Save the attribute bytes of a specified screen region.
Syntax:ft_SaveAtt( <nTop>, <nLeft>, <nBottom>, <nRight> ) -> cAttributes
Arguments:<nTop>, <nLeft>, <nBottom>, and <nRight> define the screen region.
Returns:A character string containing the screen attribute bytes for the specified region. If the memory to store the return value could not be allocated, the function returns NIL.
Description:This function is similar to Clipper's SaveScreen(), except that it only saves the attribute bytes. This is useful if you want to change the screen color without affecting the text. *** INTERNALS ALERT *** This function calls the Clipper internal __gtMaxCol to obtain the maximum column value for the current video mode. If you're too gutless to use internals, then this function isn't for you.
Examples:// Save attributes of row 4 cBuffer := ft_SaveAtt( 4, 0, 4, MaxCol() ) // Save attributes from middle of screen cBuffer := ft_SaveAtt( 10, 20, 14, 59 )
Status:
Compliance:
Files:
See also:ft_RestAtt()
Back to index


ft_SavRgn

Lang:scregion.txt
Component:hbnf
Doc. source:hbnf\doc\en\scregion.txt
Template:
Category:Video
Subcategory:
Oneliner:Save a screen region for later display
Syntax:ft_SavRgn( <nTop>, <nLeft>, <nBottom>, <nRight> ) -> cScreen
Arguments:<nTop>, <nLeft>, <nBottom>, and <nRight> define the portion of the screen to save. Allowable values are 0 through 255.
Returns:ft_SavRgn() returns the saved screen region and its coordinates as a character string.
Description:ft_SavRgn() is similar to Clipper's SaveScreen(), but it saves the screen coordinates as well as the display information. The saved area can be restored by passing the returned string to ft_RstRgn(). Note that the strings returned from ft_SavRgn() and Clipper's SaveScreen() are not interchangeable. A screen region saved with with ft_SavRgn() must be restored using ft_RstRgn(). ft_SavRgn() calls Clipper's SaveScreen(). Refer to the Clipper documentation for more information regarding this function.
Examples:// The following example uses ft_SavRgn() and ft_RstRgn() to save // and restore a portion of the screen. @ 0, 0, 24, 79 BOX "111111111" // fill the screen with 1's cScreen := ft_SavRgn( 10, 10, 20, 30 ) // save a region @ 0, 0, 24, 79 BOX "222222222" // fill the screen with 2's ft_RstRgn( cScreen ) // restore the 1's region
Status:
Compliance:
Files:
See also:ft_RstRgn() ft_RgnStack()
Back to index


ft_SetAttr

Lang:video1.txt
Component:hbnf
Doc. source:hbnf\doc\en\video1.txt
Template:
Category:Video
Subcategory:
Oneliner:Change color attributes of screen region
Syntax:ft_SetAttr( <nTRow>, <nLCol>, <nBRow>, <nRCol>, <nColor> ) -> NIL
Arguments:<nTRow>, <nLCol>, <nBRow>, and <nRCol> are the coordinates of the screen region. <nColor> is an integer representing the new color attribute. The formula is: nFore + ( nBack * 16 )
Returns:NIL
Description:This is a high speed function to change the colors of a specified region of the screen without disturbing any text. Uses direct video writes.
Examples:ft_SetAttr( 0, 0, MaxRow(), MaxCol(), 95 ) // This example will change the entire screen's colors to bright white on // magenta without changing or overwriting any text on the screen.
Status:
Compliance:
Files:
See also:
Back to index


ft_SetMode

Lang:vidmode.txt
Component:hbnf
Doc. source:hbnf\doc\en\vidmode.txt
Template:
Category:Video
Subcategory:
Oneliner:Set the video mode
Syntax:ft_SetMode( <nMode> ) -> NIL
Arguments:<nMode> is one of the DOS video modes.
Returns:NIL
Description:Use this function to put your display adapter into a video mode. Uses DOS interrupt 10h to set the mode. For a table of modes available on various graphics adapters, refer to a book such as Wilton's "Programmer's Guide to PC & PS/2 Video Systems" (Microsoft Press)
Examples:PROCEDURE Main( cMode ) ft_SetMode( Val( cMode ) ) ? "Video mode is: " + Str( ft_GetMode() ) RETURN
Status:
Compliance:
Files:
See also:ft_Adapter()
Back to index


ft_SetVcur

Lang:vidcur.txt
Component:hbnf
Doc. source:hbnf\doc\en\vidcur.txt
Template:
Category:Video
Subcategory:
Oneliner:Set the cursor position on a specified video page
Syntax:ft_SetVcur( [ <nPage> ], [ <nRow> ], [ <nCol> ] ) -> NIL
Arguments:<nPage> is the video page (defaults to current page, determined by ft_GetVPg() <nRow> is the row coordinate (defaults to 0 ) <nCol> is the column coordinate (defaults to 0 )
Returns:NIL
Description:ft_SetVcur() sets the cursor position on a specific video page. It uses ft_int86() to invoke interrupt 10h, function 2. For more information on graphics programming, cursors, and video pages, refer to Richard Wilton's _Programmer's Guide to PC and PS/2 Video Systems_ (Microsoft Press).
Examples:// Set the position to row 5, column 10 on video page 1: ft_SetVcur( 1, 5, 10 )
Status:
Compliance:
Files:
See also:
Back to index


ft_SetVpg

Lang:page.txt
Component:hbnf
Doc. source:hbnf\doc\en\page.txt
Template:
Category:Video
Subcategory:
Oneliner:Set the current video page
Syntax:ft_SetVpg( <nPage> ) -> NIL
Arguments:<nMode> is a valid video page.
Returns:NIL
Description:Selects the video page. For more information on graphics programming and video pages, consult a reference such as "Programmer's Guide to PC and PS/2 Video Systems" (Microsoft Press).
Examples:// The following sets the current video page to 1 ft_SetVpg( 1 )
Status:
Compliance:
Files:
See also:ft_GetVPg()
Back to index


ft_Shadow

Lang:shadow.txt
Component:hbnf
Doc. source:hbnf\doc\en\shadow.txt
Template:
Category:Video
Subcategory:
Oneliner:Draw a non-destructive shadow on the screen
Syntax:ft_Shadow( <nTop>, <nLeft>, <nBottom>, <nRight> [ ,<nAttr>] ) -> NIL
Arguments:<nTop> is the top row of the shadow area. <nLeft> is the upper left column of the shadow area. <nBottom> is the bottom row of the shadow area. <nRight> is the lower right column of the shadow area. <nAttr> is optional and is the screen attribute to use for drawing the shadow. If not specified, the default is 8.
Returns:NIL
Description:This function allows you to implement the popular "shadow effect." It draws a shadow using the specified screen coordinates. The shadow is drawn along the bottom and right side of the specified region. The source code is written to TASM IDEAL mode.
Examples:ft_Shadow( 10, 10, 15, 50, 8 ) // draw a dim shadow ft_Shadow( 10, 10, 15, 40, 47 ) // draw a green shadow
Status:
Compliance:
Files:
See also:
Back to index


ft_VidStr

Lang:video1.txt
Component:hbnf
Doc. source:hbnf\doc\en\video1.txt
Template:
Category:Video
Subcategory:
Oneliner:Display string on screen in specified attribute
Syntax:ft_VidStr( <nRow>, <nCol>, <cString> [, <nColor> ] ) -> NIL
Arguments:<nRow> and <nCol> are the screen coordinates. <cString> is the string to be printed on the screen. <nColor> is an integer representing the color attribute. The formula is: nFore + ( nBack * 16 ) ft_VidStr() will display the string in the current color if <nColor> is not passed.
Returns:NIL
Description:This is a high speed function to display a string of any ASCII characters on screen in a specified color attribute. This function is useful for constructing screens with a lot of text or repetitive screen prints where speed is important.
Examples:ft_VidStr( 10, 20, "Enter Name :", 165 ) // This example will print the specified text at coordinates 10, 20 // in bright white on top of Magenta.
Status:
Compliance:
Files:
See also:
Back to index


ft_WrtChr

Lang:video1.txt
Component:hbnf
Doc. source:hbnf\doc\en\video1.txt
Template:
Category:Video
Subcategory:
Oneliner:Display character on screen
Syntax:ft_WrtChr( <nRow>, <nCol>, <cChar>, <nColor> ) -> NIL
Arguments:<nRow> and <nCol> are the screen coordinates. <cChar> is the single character to print on the screen. <nColor> is an integer representing the color attribute. The formula is: nFore + ( nBack * 16 )
Returns:NIL
Description:This is a high speed function to display a single ASCII character on screen in a specified color attribute. This function is useful for constructing screens with a lot of text or repetitive screen prints where speed is important. It is faster and requires less memory than ft_VidStr().
Examples:FOR nX := 1 TO MaxRow() FOR nY := 1 TO MaxCol() ft_WrtChr( nX, nY, "∙", ( nX - 1 ) + ( nY * 16 ) ) NEXT NEXT This example will write the ASCII character 249 TO every location ON SCREEN in every possible COLOR combination. It will recognize the status of SetBlink(). It uses direct video writes FOR speed.
Status:
Compliance:
Files:
See also:
Back to index


hb_GetZipComment

Lang:hbziparc.txt
Component:hbziparc
Doc. source:hbziparc\doc\en\hbziparc.txt
Template:
Category:Zip Functions
Subcategory:
Oneliner:Return the comment of an zip file
Syntax:hb_GetZipComment( <szFile> ) --> <szComment>
Arguments:<szFile> File to get the comment from
Returns:<szComment> The comment that was stored in <szFile>
Description:This function receives a valid zip file name as parameter, and returns the global comment stored within.
Examples:? "The comment in test.zip is ", hb_GetZipComment( "test.zip" )
Status:R
Compliance:This function is a Harbour extension
Files:Library is hbziparc
See also:
Back to index


hb_SetBuffer

Lang:hbziparc.txt
Component:hbziparc
Doc. source:hbziparc\doc\en\hbziparc.txt
Template:
Category:Zip Functions
Subcategory:
Oneliner:
Syntax:hb_SetBuffer( [<nWriteBuffer>], [<nExtractBuffer>], [<nReadBuffer>] ) --> NIL
Arguments:<nWriteBuffer> The size of the write buffer. <nExtractBuffer> The size of the extract buffer. <nReadBuffer> The size of the read buffer.
Returns:<NIL> This function always returns NIL.
Description:This function set the size of the internal buffers for write/extract/read operation. If the size of the buffer is smaller then the default, the function will automatically use the default values, which are 65535/16384/32768 respectively. This function be called before any of the compression/decompression functions.
Examples:hb_SetBuffer( 100000, 115214, 65242 )
Status:R
Compliance:This function is a Harbour extension
Files:Library is hbziparc
See also:
Back to index


hb_SetDiskZip

Lang:hbziparc.txt
Component:hbziparc
Doc. source:hbziparc\doc\en\hbziparc.txt
Template:
Category:Zip Functions
Subcategory:
Oneliner:Set an codeblock for disk changes
Syntax:hb_SetDiskZip( <bBlock> ) --> .T.
Arguments:<bBlock> an Code block that contains an function that will be performed when the need of changing disk are need.
Returns:It always returns True
Description:This function will set an codeblock that will be evaluated every time that an changedisk event is necessary. <bBlock> receives nDisk as a code block param that corresponds to the diskette number to be processed. Set this function before opening archives that are in removable media. This block will be released, when the caller finish it job.
Examples:hb_SetDiskZip( {| nDisk | Alert( "Please insert disk no " + Str( nDisk, 3 ) ) } )
Status:
Compliance:This function is a Harbour extension
Files:Library is hbziparc
See also:
Back to index


hb_SetZipComment

Lang:hbziparc.txt
Component:hbziparc
Doc. source:hbziparc\doc\en\hbziparc.txt
Template:
Category:Zip Functions
Subcategory:
Oneliner:Set an Zip archive Comment
Syntax:hb_SetZipComment( <cComment> ) --> NIL
Arguments:<cComment> Comment to add to the zip archive
Returns:<NIL> this function always return NIL
Description:This function stored an global comment to an zip archive. It should be called before any of the compression functions.
Examples:hb_SetZipComment( "This is an Test" ) hb_ZipFile( "test.zip", { "ios.ini", "win.ini" } )
Status:R
Compliance:This function is a Harbour extension
Files:Library is hbziparc
See also:
Back to index


hb_UnzipFile

Lang:hbziparc.txt
Component:hbziparc
Doc. source:hbziparc\doc\en\hbziparc.txt
Template:
Category:Zip Functions
Subcategory:
Oneliner:Unzip a compressed file
Syntax:hb_UnzipFile( <cFile>, <bBlock>, <lWithPath>, <cPassWord>, <cPath>, <cFile> | <aFile>, <pFileProgress> ) --> lCompress
Arguments:<cFile> Name of the zip file to extract <bBlock> Code block to execute while extracting <lWithPath> Toggle to create directory if needed <cPassWord> Password to use to extract files <cPath> Path to extract the files to - mandatory <cFile> | <aFiles> A File or Array of files to extract - mandatory <pFileProgress> Code block for File Progress
Returns:<lCompress> .T. if all file was successfully restored, otherwise .F.
Description:This function restores all files contained inside the <cFile>. If the extension is omitted, .zip will be assumed. If a file already exists, it will be overwritten. If <bBlock> is used, every time the file is opened to compress it will evaluate bBlock. Parameters of bBlock are cFile and nPos. The <cPath> is a mandatory parameter. Set to ".\" to extract to the current directory If <cFile> or <aFiles> are not provided, no files will be extracted! Make sure you provide the file or files you want extracted If <pFileProgress> is used, an Code block is evaluated, showing the total of that file has being processed. The codeblock must be defined as follow {| nPos, nTotal | GaugeUpdate( aGauge1, nPos / nTotal ) }
Examples:PROCEDURE Main() LOCAL aExtract := hb_GetFilesInZip( "test.zip" ) // extract all files in zip IF hb_UnzipFile( "test.zip",,,, "." + hb_ps(), aExtract ) ? "File was successfully extracted" ENDIF aExtract := hb_GetFilesInZip( "test2.zip" ) // extract all files in zip IF hb_UnzipFile( "test2.zip", {| cFile | QOut( cFile ) },,, "." + hb_ps(), aExtract ) ? "File was successfully extracted" ENDIF RETURN
Status:R
Compliance:This function is a Harbour extension
Files:Library is hbziparc
See also:
Back to index


hb_ZipDeleteFiles

Lang:hbziparc.txt
Component:hbziparc
Doc. source:hbziparc\doc\en\hbziparc.txt
Template:
Category:Zip Functions
Subcategory:
Oneliner:Delete files from an zip archive
Syntax:hb_ZipDeleteFiles( <cFile>, <cFiletoDelete> | <aFiles> | <nFilePos> ) --> <lDeleted>
Arguments:<cFile> The name of the zip files from where the files will be deleted <cFiletoDelete> An File to be removed _or_ <aFiles> An Array of Files to be removed _or_ <nFilePos> The Position of the file to be removed
Returns:<lDeleted> If the files are deleted, it will return .T.; otherwise it will return .F. in the following cases: Spanned Archives; the file(s) could not be found in the zip file.
Description:This function removes files from an Zip archive.
Examples:? "has the file zipnew.i been deleted ", iif( hb_ZipDeleteFiles( "test23.zip", "zipnew.i" ), "Yes", "No" )
Status:R
Compliance:This function is a Harbour extension
Files:Library is hbziparc
See also:
Back to index


hb_ZipFile

Lang:hbziparc.txt
Component:hbziparc
Doc. source:hbziparc\doc\en\hbziparc.txt
Template:
Category:Zip Functions
Subcategory:
Oneliner:Create a zip file
Syntax:hb_ZipFile( <cFile>, <cFileToCompress> | <aFiles>, <nLevel>, <bBlock>, <lOverWrite>, <cPassword>, <lWithPath>, <lWithDrive>, <pFileProgress> ) --> lCompress
Arguments:<cFile> Name of the zip file to create <cFileToCompress> Name of a file to Compress, Drive and/or path can be used _or_ <aFiles> An array containing files to compress, Drive and/or path can be used <nLevel> Compression level ranging from 0 to 9 <bBlock> Code block to execute while compressing <lOverWrite> Toggle to overwrite the file if exists <cPassword> Password to encrypt the files <lWithPath> Toggle to store the path or not <lWithDrive> Toggle to store the Drive letter and path or not <pFileProgress> Code block for File Progress
Returns:<lCompress> .T. if file was create, otherwise .F.
Description:This function creates a zip file named <cFile>. If the extension is omitted, .zip will be assumed. If the second parameter is a character string, this file will be added to the zip file. If the second parameter is an array, all file names contained in <aFiles> will be compressed. If <nLevel> is used, it determines the compression type where 0 means no compression and 9 means best compression. If <bBlock> is used, every time the file is opened to compress it will evaluate bBlock. Parameters of bBlock are cFile and nPos. If <lOverWrite> is used, it toggles to overwrite or not the existing file. Default is to overwrite the file,otherwise if <lOverWrite> is false the new files are added to the <cFile>. If <cPassword> is used, all files that are added to the archive are encrypted with the password. If <lWithPath> is used, it tells the path should also be stored with the file name. Default is false. If <lWithDrive> is used, it tells thats the Drive and path should also be stored with the file name. Default is false. If <pFileProgress> is used, an Code block is evaluated, showing the total of that file has being processed. The codeblock must be defined as follow {| nPos, nTotal | GaugeUpdate( aGauge1, nPos / nTotal ) }
Examples:PROCEDURE Main() IF hb_ZipFile( "test.zip", "test.prg" ) ? "File was successfully created" ENDIF IF hb_ZipFile( "test1.zip", { "test.prg", "test.hbp" } ) ? "File was successfully created" ENDIF IF hb_ZipFile( "test2.zip", { "test.prg", "test.hbp" }, 9, {| cFile, nPos | QOut( cFile ) } ) ? "File was successfully created" ENDIF aFiles := { "test.prg", "test.hbp" } nLen := Len( aFiles ) aGauge := GaugeNew( 5, 5, 7, 40, "W/B", "W+/B" , "." ) GaugeDisplay( aGauge ) hb_ZipFile( "test33.zip", aFiles, 9, {| cFile, nPos | GaugeUpdate( aGauge, nPos / nLen ) },, "hello" ) RETURN
Status:R
Compliance:This function is a Harbour extension
Files:Library is hbziparc
See also:
Back to index


hb_ZipFileByPKSpan

Lang:hbziparc.txt
Component:hbziparc
Doc. source:hbziparc\doc\en\hbziparc.txt
Template:
Category:Zip Functions
Subcategory:
Oneliner:Create a zip file on removable media
Syntax:hb_ZipFileByPKSpan( <cFile>, <cFileToCompress> | <aFiles>, <nLevel>, <bBlock>, <lOverWrite>, <cPassword>, <lWithPath>, <lWithDrive>, <pFileProgress> ) --> lCompress
Arguments:<cFile> Name of the zip file <cFileToCompress> Name of a file to Compress, Drive and/or path can be used _or_ <aFiles> An array containing files to compress, Drive and/or path can be used <nLevel> Compression level ranging from 0 to 9 <bBlock> Code block to execute while compressing <lOverWrite> Toggle to overwrite the file if exists <cPassword> Password to encrypt the files <lWithPath> Toggle to store the path or not <lWithDrive> Toggle to store the Drive letter and path or not <pFileProgress> Code block for File Progress
Returns:<lCompress> .T. if file was create, otherwise .F.
Description:This function creates a zip file named <cFile>. If the extension is omitted, .zip will be assumed. If the second parameter is a character string, this file will be added to the zip file. If the second parameter is an array, all file names contained in <aFiles> will be compressed. Also, the use of this function is for creating backup in removable media like an floppy drive/zip drive. If <nLevel> is used, it determines the compression type where 0 means no compression and 9 means best compression. If <bBlock> is used, every time the file is opened to compress it will evaluate bBlock. Parameters of bBlock are cFile and nPos. If <lOverWrite> is used , it toggles to overwrite or not the existing file. Default is to overwrite the file, otherwise if <lOverWrite> is false the new files are added to the <cFile>. If <cPassword> is used, all files that are added to the archive are encrypted with the password. If <lWithPath> is used, it tells thats the path should also be stored with the file name. Default is false. If <lWithDrive> is used, it tells thats the Drive and path should also be stored with the file name. Default is false. If <pFileProgress> is used, an Code block is evaluated, showing the total of that file has being processed. The codeblock must be defined as follow {| nPos, nTotal | GaugeUpdate( aGauge1, nPos / nTotal ) } Before calling this function, Set an Changedisk codeblock by calling the hb_SetDiskZip().
Examples:PROCEDURE Main() hb_SetDiskZip( {| nDisk | Alert( "Please insert disk no " + Str( nDisk, 3 ) ) } ) IF hb_ZipFileByPKSpan( "test.zip", "test.prg" ) ? "File was successfully created" ENDIF IF hb_ZipFileByPKSpan( "test1.zip", { "test.prg", "test.hbp" } ) ? "File was successfully created" ENDIF IF hb_ZipFileByPKSpan( "test2.zip", { "test.prg", "test.hbp" }, 9, {| nPos, cFile | QOut( cFile ) } ) ? "File was successfully created" ENDIF aFiles := { "test.prg", "test.hbp" } nLen := Len( aFiles ) aGauge := GaugeNew( 5, 5, 7, 40, "W/B", "W+/B", "." ) GaugeDisplay( aGauge ) hb_ZipFileByPKSpan( "test33.zip", aFiles, 9, {| cFile, nPos | GaugeUpdate( aGauge, nPos / nLen ) },, "hello" ) RETURN
Status:R
Compliance:This function is a Harbour extension
Files:Library is hbziparc
See also:
Back to index


hb_ZipFileByTDSpan

Lang:hbziparc.txt
Component:hbziparc
Doc. source:hbziparc\doc\en\hbziparc.txt
Template:
Category:Zip Functions
Subcategory:
Oneliner:Create a zip file
Syntax:hb_ZipFileByTDSpan( <cFile> ,<cFileToCompress> | <aFiles>, <nLevel>, <bBlock>, <lOverWrite>, <cPassword>, <iSize>, <lWithPath>, <lWithDrive>, <pFileProgress>) --> lCompress
Arguments:<cFile> Name of the zip file <cFileToCompress> Name of a file to Compress, Drive and/or path can be used _or_ <aFiles> An array containing files to compress, Drive and/or path can be used <nLevel> Compression level ranging from 0 to 9 <bBlock> Code block to execute while compressing <lOverWrite> Toggle to overwrite the file if exists <cPassword> Password to encrypt the files <iSize> Size of the archive, in bytes. Default is 1457664 bytes <lWithPath> Toggle to store the path or not <lWithDrive> Toggle to store the Drive letter and path or not <pFileProgress> Code block for File Progress
Returns:<lCompress> .T. if file was create, otherwise .F.
Description:This function creates a zip file named <cFile>. If the extension is omitted, .zip will be assumed. If the second parameter is a character string, this file will be added to the zip file. If the second parameter is an array, all file names contained in <aFiles> will be compressed. If <nLevel> is used, it determines the compression type where 0 means no compression and 9 means best compression. If <bBlock> is used, every time the file is opened to compress it will evaluate bBlock. Parameters of bBlock are cFile and nPos. If <lOverWrite> is used, it toggles to overwrite or not the existing file. Default is to overwrite the file, otherwise if <lOverWrite> is false the new files are added to the <cFile>. If <lWithPath> is used, it tells thats the path should also be stored with the file name. Default is false. If <lWithDrive> is used, it tells thats the Drive and path should also be stored with the file name. Default is false. If <pFileProgress> is used, an Code block is evaluated, showing the total of that file has being processed. The codeblock must be defined as follow {| nPos, nTotal | GaugeUpdate( aGauge1, nPos / nTotal ) }
Examples:PROCEDURE Main() IF hb_ZipFileByTDSpan( "test.zip", "test.prg" ) ? "File was successfully created" ENDIF IF hb_ZipFileByTDSpan( "test1.zip", { "test.prg", "test.hbp" } ) ? "File was successfully created" ENDIF IF hb_ZipFileByTDSpan( "test2.zip", { "test.prg", "test.hbp" }, 9, {| nPos, cFile | QOut( cFile ) }, "hello",, 521421 ) ? "File was successfully created" ENDIF aFiles := { "test.prg", "test.hbp" } nLen := Len( aFiles ) aGauge := GaugeNew( 5, 5, 7, 40, "W/B", "W+/B", "." ) GaugeDisplay( aGauge ) hb_ZipFileByTDSpan( "test33.zip", aFiles, 9, {| cFile, nPos | GaugeUpdate( aGauge, nPos / nLen ) },, "hello",, 6585452 ) RETURN
Status:R
Compliance:This function is a Harbour extension
Files:Library is hbziparc
See also:
Back to index


hb_ZipTestPK

Lang:hbziparc.txt
Component:hbziparc
Doc. source:hbziparc\doc\en\hbziparc.txt
Template:
Category:Zip Functions
Subcategory:
Oneliner:Test pkSpanned zip files
Syntax:hb_ZipTestPK( <cFile> ) --> <nReturnCode>
Arguments:<cFile> File to be tested.
Returns:<nReturn> A code that tells if the current disk is the last of a pkSpanned disk set.
Description:This function tests if the disk inserted is the last disk of an backup set or not. It will return the follow return code when an error is found <table> Error code Meaning 114 Incorrect Disk 103 No Call back was set with hb_ZipTestPK() </table> Call this function to determine if the disk inserted is the correct one before any other function.
Examples:IF hb_ZipTestPK( "test22.zip" ) == 114 ? "Invalid Diskette" ENDIF
Status:R
Compliance:This function is a Harbour extension
Files:Library is hbziparc
See also:
Back to index




941 functions written




End of document