hb_A - Petewg/harbour-core GitHub Wiki
aArray := hb_ACmdLine()
It returns an array with all command line parameters. This function returns all parameters, including hidden (internals) ones, just like hb_CmdLine() and hb_argV()/hb_argC() functions, (and unlike hb_AParams(__dbgProcLevel() - 1)).
aArray := hb_ADel(<aArray> [,<nElement>,<lAutoSize>])
Deletes the value of <nElement>
of array <aArray>
, moves all the following values to the previous position, and assigns the last element a NIL
value. The difference to the legacy ADel()
function is that hb_ADel() provides a third <lAutoSize>
parameter which if specified .T.
then the last array element is removed and the size of array is decreased by one, otherwise if <lAutoSize>
is .F.
or not passed at all, the size of array remains unchanged --i.e., operates just like ADel().
Default values for optional parameters: <nElement> => 1
, <lAutoSize> => .F.
nChkSum := hb_Adler32(<cValue> [, <nStart>])
Calculates and returns the checksum of <cValue>
using the Adler-32 checksum algorithm.
Inserts <uValue>
in the <nPos>
position of the array, moving all the items to the next position. If <lAutoSize>
is .T., a new element will be added, making room for the previous last element, else the size of <aArray>
won't change and the last item of <aArray>
will be lost. Default values for optional parameters: <nPos>
= 1, <uValue>
= NIL, <lAutoSize>
= .F.
returns the nSelection
, which is the ordinal position of the selected option into aOptions[...]
array, or 0
if Esc
key has pressed, or 1
if the nDelay
seconds has passed without user action.
First argument is the displayed message and can be either a string or an 1-dim array filled with values of any type. This way, in the alert message can be displayed data of all valid types, recognized by Harbour (e.g. numbers, dates, et.c.).
The optional cColorNorm
is a color pair for painting box, message and options.
The optional nDelay
when specified actuates the `time-out` functionality; it defines the number of seconds waiting the user to make a choice and when this time's passing with no response the hb_Alert() aborts! (default nDelay
value is 0
, i.e., `wait forever`). Please note that if the user do use the right or left arrow key to move between available options, the nDelay
shall be reset to 0
, which, as mentioned, means "wait forever", that is, the `time-out` functionality is canceled.
UPDATE: after this [2023-01-23 12:28 UTC+0100 Przemyslaw Czerpak] commit, the parameters for this function can be passed utilizing a hash array like this:
hb_Alert( { "TXT" => <cMessage>, ;
"BTN" => <aButtons>, ;
["TIM" => <nTimeOut>] } )
returns an array with the parameters passed to a function. <nLevel>
lets you obtain the parameter list of the caller functions up in the call tree.
Β§ NOTE: returns the current values of parameters, which might have been changed by user code, hence and they may be different than original arguments, that had been passed to the given function upon invocation.
returns the number of command line arguments passed to the application, including the internal arguments;
Note: the number returned doesn't include the hb_argv(0) (i.e. the name of executable).
Check if an internal switch has been set when the program started. Internal switch is a command line argument prefixed with a double slash //
.
Example of starting a program in command line and setting internal switch:
C:\appls\>myprogram.exe //SWITCH1
? hb_argCheck("SWITCH1") // -> .T.
? hb_argCheck("SWITCH2") // -> .F.
updates the parameters list (that are retrieved/utilized by 'hb_arg*()' family functions) by removing the 1-st one and replacing it by others. If <lShift>
is .T.
then first non internal parameter is moved to hb_argv(0) (i.e. hb_progname()) and all next are shifted.
returns the value assigned to <cArg>
internal switch. If the <cArg>
is not set or has not assigned a value to it, the function returns a NULL string.
example command line: myprogram.exe //SWITCH1somevalue //SWITCH2
? hb_argString("SWITCH1") // --> "somevalue"
? hb_argString("SWITCH2") // --> "" (null string, no value assigned to SWITCH2)
? hb_argString("SWITCH3") // --> "" (null string, SWITCH3 is not set)
returns the value of <nArg>
-th argument passed to the application upon startup either from command line or a batch script or a short-cut.
The value returned is always of character type. If <nArg>
is 0
(zero) or omitted (not passed at all), the function will return the name of the executable, as it's been written in the command line (including full path).
If <nArg>
is greater than the number of the arguments actually passed, (i.e., when it refers to a nonexistent argument), this function returns an empty (null) string.
converts array into list of items which can be used as function parameters, array-values or array-indexes in the same way as ...
operator.
Scans the array <aArray>
(left to right) trying to locate the <SearchValue>
, which can be a simple value or a code block.
Scanning starts either from the 1st
or <nStart>
element of the <aArray>
and continues up to the next <nCount>
elements or up to the last element of the array, if no <nCount>
specified. When the logical flag <lExact>
is specified, overrides the _SET_EXACT
setting, which means it directly affects the exactness of comparison.
The function returns the numeric position of the first located element inside the array or 0
(zero), if no matching element found.
returns the position in the string <cIntoString>
where the entire (and exact) string <cSearchFor>
first occurs, or zero if it does not. Search is case sensitive and starts from <nStart>
(default=1) up to <nEnd>
(default=Len(cIntoString)).
Same as above hb_At()
, but, as the I
suffix hints, this one is case-Insensitive.
This function belongs to Harbour Regular Expressions family, found here.
returns an array filled with all individual tokens of given <cString>
string, that is, all the separate sub-strings that are delimited by either <cDelimiter>
or by EOL
(end of line) if (instead of <cDelimiter>
) <lEOL>
has been passed and evaluates to .T.
If neither <cDelimiter>
nor <lEOL>
specified, then as delimiter is used, by default, an empty space (ASCII char 32).
If <lSkipStrings>
is .T. (default=.F.), the quoted sub-strings (if any, inside cString) are not tokenized (i.e. are not searched for <cDelimiter>
).
If <lDoubleQuoteOnly>
is .T. only the double quote "
is considered as a quote sign. This argument is meaningful only when <lSkipStrings>=.T.
-
NOTES:
i. Tokenization is case sensitive, in the (rare) case where<cDelimiter>
is a letter-character.
ii. The delimiters are removed from tokens. -
See also: more tokenization functions