hb_M - Petewg/harbour-core GitHub Wiki
-
hb_macroBlock(
<cExpr>
) ➜ bCodeBlock
converts the<cExpr>
macro expression to codeblock. The createdbCodeBlock
codeblock does NOT inherit scope and/or attributes of the caller. -
hb_MD5(
<cString>, [<lBin>]
) ➜ cMD5
calculates and returns the MD5 checksum of<cString>
. On error, i.e. wrong params etc., it returns null (empty) string.
<lBin>
flag controls whether to return binary data or hexadecimal string, default is.F.
(i.e. returns hexadecimal string)
Note: MD5 algorithm is considered insecure. Use SHA256 or higher.
See also: hb_SHA...() family of relevant functions. -
hb_MD5File(
<cFileName>, [<lBin>]
) ➜ cMD5
same as above function, but used to calculate the checksum of a file instead of a string. -
hb_MD5Encrypt(
<cText>, <cPasswd>
) ➜ cCipher
this function encrypts the given<cText>
and returns a cipher (encrypted text).
<cPasswd>
is the password used to encrypt/decrypt text.
Warning! on wrong call (f.e., when a param(s) omitted or their value types are improper (i.e., not char) the function returns NIL and the same apply to below hb_MD5Decrypt(), as well. -
hb_MD5Decrypt(
<cCipher>, <cPasswd>
) ➜ cText
decrypts the<cCipher>
created by hb_MD5Encrypt() (see above) and returns original text. -
hb_MemoRead(
<cFile>
) ➜ cString
is identical to MemoRead() except it won't truncate the last byte (on non-UNIX compatible systems) if it's anEOF
char. -
hb_MemoWrit(
<cFileName>, <cString>
) ➜ lSuccess
writes (or save) a memo field or character string to a text file on disk. If not specified a path,<cFileName>
is written to the current directory (ignores SET DEFAULT). If<cFileName>
already exists, it is overwritten. Returns.T.
on success or.F.
on failure.
NOTE: unlike MemoWrit(), this function never adds an EOFChr( 26 )
character at the end of the created file. -
hb_Minute(
<tTimeStamp>
) ➜ nMinute
returns the minute (mm) part (or "member") of aTimeStamp
. -
hb_MLEval(
<cString>, <bCode>, [<nLineLength>], [<nTabSize>], [<lWrap>], [<nPos>], [@<nRow>], [@<nCol>]
) ➜ nLines
enumerates (returns) the number of lines in<cString>
following text format rules used by Cl*pper MemoEdit() (unlike of Cl*pper memo lines functions).
For each line being processed, the<bCode>
code-block is evaluated with 2 parameters:|<cLine>, <lSoftCR>|
. It recognizes and accepts anyEOL
(end of lines) just likehb_ATokens( <cText>, .T. )
and strip out or convertsCR
(soft carriage returns) depending on<lWrap>
word wrap mode.
Default values for optional parameters: nLineLength ➜ 79, nTabSize ➜ 4, lWrap ➜ .T. -
hb_MSecToT(
<nMilliseconds>
) ➜ tTime
converts milliseconds to tTimestamp value. -
hb_mvRestore(
<cFileName>, [lAdditive], [cMask], [lIncludeMask]
) ➜ xValue
restores saved memory variables (public, privates). Returns: 1st restored value or NIL if no value restored or .F. on error. -
hb_mvSave(
<cFileName>, [cMask] [, lIncludeMask]
) ➜ NIL
saves memory variables (public, privates), visible within the current procedure or user-defined function, to a memory file (.hbv
). Supports variable names lengthier than 10 chars.