Page 1 of 1

Tlex - does it handle embedded strings?

Posted: Sun Aug 18, 2013 10:24 pm
by FWExplorer
Hi,

Does the TLex object handle things like embedded strings? E.g. with the proper delimiters/tokens/ids, can it understand the 5 terminals from


cWelcomeMessage := "Hi, Welcome to Fivewin, friend!"


as

cWelcomeMessage
:=
"Hi"
"Welcome to Fivewin"
"friend!"


or

?? 5, "six", "seven and eight"

as

??
5
"six"
"seven and eight"

? Can it do that?

Re: Tlex - does it handle embedded strings?

Posted: Mon Aug 19, 2013 12:07 am
by Antonio Linares
You can easily get the string this way:

hb_tokenGet( 'cWelcomeMessage := "Hi, Welcome to Fivewin, friend!"', 2, '"' ) // ' " '

Re: Tlex - does it handle embedded strings?

Posted: Mon Aug 19, 2013 10:27 am
by FWExplorer
So we embed everything, including the double-quoted string, in single quotes. Ok, sounds good, thanks Antonio.

Re: Tlex - does it handle embedded strings?

Posted: Mon Aug 19, 2013 3:56 pm
by FWExplorer
Oops, I made a mistake, in posting this as the desired result:

cWelcomeMessage
:=
"Hi"
"Welcome to Fivewin"
"friend!"


Should be

cWelcomeMessage
:=
"Hi"
"Welcome to Fivewin, friend!"


, and

aTokens := hb_ATokens( sParseString, " ", .T. )

does indeed produce this. Similar behavior for the function that you mentioned, Antonio. Thanks!