TLex question

Login to reply to this topic.
Tue, 2007-02-13 09:38
Joined: 2005-11-16
Forum posts: 63
Hi,

I have a descriptor which contains the following:

Code:
_LIT8(KDescriptor, "$value=12");

I want to extract the value with the following code:

Code:
TLex8 lexer(KDescriptor);

do
{
lexer.Inc();
}
while((lexer.Peek() != lexer.Eos()) && (lexer.Peek() != '='));


TInt value = 0;

lexer.Val(value);
But this does not work. value stays 0 after the last statement. Can anyone tell me what's wrong?

regards
Martin

Tue, 2007-02-13 11:00
Joined: 2003-12-05
Forum posts: 683
Re: TLex question
The lexer is "pointing" to the '=' character. Skip() that and then use Val.

Edit: This might also help you out.
Fri, 2007-02-16 16:49
Joined: 2005-11-16
Forum posts: 63
Re: TLex question
Thank you that was helpfull
  • Login to reply to this topic.