Very nice code, thanks to José M.C. Quintas:
aList := hb_RegExSplit( hb_Eol(), cText )
Extracting the lines from a text
- Antonio Linares
- Site Admin
- Posts: 42519
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 31 times
- Been thanked: 75 times
- Contact:
- Antonio Linares
- Site Admin
- Posts: 42519
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 31 times
- Been thanked: 75 times
- Contact:
Re: Extracting the lines from a text
Thanks for the tip of using hb_regexSplit().
However hb_atokens() only accepts a single character for the delimiter.
So can't pass CRLF to it
However hb_atokens() only accepts a single character for the delimiter.
So can't pass CRLF to it
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
BCC5.82/BCC7.3
xHarbour/Harbour
Re: Extracting the lines from a text
hi,
https://github.com/Petewg/harbour-core/wiki/hb_A#hb_atokenscstring-cdelimiterleol-lskipstrings-ldoublequoteonly--atokens
hua wrote:However hb_atokens() only accepts a single character for the delimiter.
So can't pass CRLF to it
https://github.com/Petewg/harbour-core/wiki/hb_A#hb_atokenscstring-cdelimiterleol-lskipstrings-ldoublequoteonly--atokens
hb_ATokens(<cString>, [<cDelimiter>|lEOL], [<lSkipStrings>], [<lDoubleQuoteOnly>]) ➜ aTokens
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).
greeting,
Jimmy
Jimmy
Re: Extracting the lines from a text
Thanks Jimmy.
Seems Harbour's documentation is a bit different than what I got from xHarbour Language Reference 1.1
Seems Harbour's documentation is a bit different than what I got from xHarbour Language Reference 1.1
HB_ATokens( <cString> , ;
[<cDelimiter>] , ;
[<lSkipQuotes>] , ;
[<lDoubleQuotesOnly>] ) --> aTokens
<cDelimiter>
A single character can be specified as delimiter used to tokenize the string <cString>. It defaults to a blank space (Chr(32)).
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
BCC5.82/BCC7.3
xHarbour/Harbour