* bin/commit.hb
* config/detect.mk
* config/detfun.mk
* config/detplat.mk
* config/dir.mk
* config/dirsh.mk
* config/global.mk
* config/globsh.mk
* config/instsh.mk
* config/lang.hb
* config/lang2po.hb
* config/po2lang.hb
* config/postinst.hb
* contrib/hbexpat/tests/tohash.prg
* contrib/hbformat/utils/hbformat.ini
* contrib/hbmisc/hbedit.prg
* contrib/hbmxml/tests/testmxml.prg
* contrib/hbnetio/utils/hbnetio/_console.prg
* contrib/hbnetio/utils/hbnetio/_winsvc.prg
* contrib/hbnetio/utils/hbnetio/hbnetio.prg
* contrib/hbnetio/utils/hbnetio/netiomgm.hb
* contrib/hbwin/tests/ole.prg
* contrib/hbwin/tests/oletst2.js
* contrib/hbwin/tests/oletst2.vbs
* contrib/hbxpp/doc/en/binnumx.txt
* contrib/hbxpp/doc/en/dbcmdx.txt
* contrib/xhb/htmutil.prg
* contrib/xhb/tfile.prg
* contrib/xhb/tframe.prg
* contrib/xhb/thtm.prg
* ChangeLog.txt
* debian/copyright
* doc/class_tp.txt
* doc/hdr_tpl.txt
* doc/xhb-diff.txt
* LICENSE.txt
* package/harbour-wce.spec.in
* package/harbour-win.spec.in
* package/harbour.spec
* package/mpkg_rpm_wce.sh
* package/mpkg_rpm_win.sh
* package/mpkg_rpm.sh
* package/mpkg_src.sh
* package/mpkg_ver.sh
* src/rtl/achoice.prg
* src/rtl/getsys53.prg
* src/rtl/tgetlist.prg
* src/rtl/tlabel.prg
* src/rtl/tmenusys.prg
* tests/hbdoc.prg
* tests/langmsg.prg
* tests/rto_get.prg
* tests/rto_tb.prg
+ doc/en/ati.txt
+ doc/en/dirdrive.txt
+ doc/en/hashfunc.txt
+ doc/en/hbtoken.txt
+ doc/en/left.txt
+ doc/en/proc.txt
+ doc/en/strtran.txt
+ doc/en/transfrm.txt
+ doc/en/typefile.txt
* doc/en/*
* more partial sync with 3.4 fork
69 lines
2.3 KiB
Plaintext
69 lines
2.3 KiB
Plaintext
/* $DOC$
|
|
$AUTHOR$
|
|
2016 Pete D. <pete_westg@yahoo.gr>
|
|
$TEMPLATE$
|
|
Function
|
|
$NAME$
|
|
hb_ATokens()
|
|
$CATEGORY$
|
|
API
|
|
$SUBCATEGORY$
|
|
Strings
|
|
$ONELINER$
|
|
Parses a complex string (e.g. a sentence or multi-line text) into individual
|
|
tokens (words or other string chunks depending on delimiter used).
|
|
$SYNTAX$
|
|
hb_ATokens( <cString>, [<cDelim>|<lEOL>], [<lSkipStrings>], ;
|
|
[<lDoubleQuoteOnly>] ) --> aTokens
|
|
$ARGUMENTS$
|
|
<cString> Complex string to be parsed.
|
|
|
|
<cDelim>|<lEOL Character(s) used as delimiter of separate tokens.
|
|
If <lEOL> flag defined instead of <cDelim>,
|
|
then end of line marker(s) will be used as delimiter.
|
|
|
|
<lSkipStrings> Boolean flag indicating if quoted substrings
|
|
will be tokenized or not.
|
|
|
|
<lDoubleQuoteOnly> Boolean flag indicating that only double-quoted
|
|
substrings will be tokenized.
|
|
$RETURNS$
|
|
<aTokens> A character array, filled with the individual tokens found.
|
|
$DESCRIPTION$
|
|
This function analyses the complex string <cString> and splits it
|
|
into separate sub-strings (tokens) that are delimited by <cDelim>
|
|
or by space character, if no <cDelim> delimiter is passed, or by EOL marker
|
|
if <lEOL> instead of <cDelim> is specified.
|
|
|
|
The located tokens, are stored in an array which is returned by the function.
|
|
|
|
If <lSkipStrings> is .T. (default: .F.), the quoted sub-strings (if any)
|
|
within <cString> are not tokenized. If <lDoubleQuoteOnly> is .T.
|
|
only the double quote `"` is recognized as a quote sign.
|
|
This argument is meaningful only when <lSkipStrings> is .T.
|
|
|
|
$NOTES$
|
|
1) the tokenization process is case sensitive, in the (rare) case
|
|
where <cDelim> is an alphabetic character.
|
|
|
|
2) The delimiters are removed (trimmed) from tokens.
|
|
$EXAMPLES$
|
|
LOCAL cString := "Harbour is proven to be stable, robust and efficient."
|
|
LOCAL aTokens := hb_ATokens( cString )
|
|
AEval( aTokens, {| token, n | QOut( hb_ntos(n), token ) } )
|
|
?
|
|
aTokens := hb_ATokens( cString, "," )
|
|
AEval( aTokens, {| token, n | QOut( hb_ntos(n), token ) } )
|
|
$STATUS$
|
|
R
|
|
$COMPLIANCE$
|
|
H
|
|
$PLATFORMS$
|
|
All
|
|
$FILES$
|
|
Library is core
|
|
$SEEALSO$
|
|
SubStr()
|
|
$END$
|
|
*/
|