FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Tlex - does it handle embedded strings?
Posts: 103
Joined: Fri Aug 09, 2013 12:43 AM
Tlex - does it handle embedded strings?
Posted: Sun Aug 18, 2013 10:24 PM

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?

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Tlex - does it handle embedded strings?
Posted: Mon Aug 19, 2013 12:07 AM
You can easily get the string this way:

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

Antonio Linares
www.fivetechsoft.com
Posts: 103
Joined: Fri Aug 09, 2013 12:43 AM
Re: Tlex - does it handle embedded strings?
Posted: Mon Aug 19, 2013 10:27 AM

So we embed everything, including the double-quoted string, in single quotes. Ok, sounds good, thanks Antonio.

Posts: 103
Joined: Fri Aug 09, 2013 12:43 AM
Re: Tlex - does it handle embedded strings?
Posted: Mon Aug 19, 2013 03:56 PM

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!

Continue the discussion