Tlex - does it handle embedded strings?

Post Reply
FWExplorer
Posts: 83
Joined: Fri Aug 09, 2013 12:43 am

Tlex - does it handle embedded strings?

Post 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?
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Tlex - does it handle embedded strings?

Post by Antonio Linares »

You can easily get the string this way:

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

Antonio Linares
www.fivetechsoft.com
FWExplorer
Posts: 83
Joined: Fri Aug 09, 2013 12:43 am

Re: Tlex - does it handle embedded strings?

Post by FWExplorer »

So we embed everything, including the double-quoted string, in single quotes. Ok, sounds good, thanks Antonio.
FWExplorer
Posts: 83
Joined: Fri Aug 09, 2013 12:43 am

Re: Tlex - does it handle embedded strings?

Post 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!
Post Reply