Hi
I am working on symbian os...m trying to validate email written in textbox.
For first two times that gives expected result but 3rd time application closes..
my code for tat is like below:
Code:
TBool CformappDialog::ValidateInput()
{
// emailEdwin = static_cast<CEikEdwin*>(ControlOrNull(EformappEmail));
// emailEdwin->GetText(iEmail);
CEikEdwin* tmp = (CEikEdwin*)Control(EformappEmail);
tmp->GetText(iEmail);
_LIT( KAt, "@" );
_LIT(MAt,".");
TBool isValid = EFalse;
TInt index = iEmail.Find( KAt );
if( KErrNotFound != index )
{
if ( iEmail.Length() > ++index )
{
// iEmailEnd contains email address from @ to end.
iEmailEnd = iEmail.MidTPtr( index );
// Search for @ is performed again.
if ( iEmailEnd.Find(KAt) == KErrNotFound )
{
TInt index1 = iEmailEnd.Find(MAt);
if(KErrNotFound != index1)
{
if(iEmailEnd.Length() > ++index1 )
{
if ( iEmailEnd1.Find(MAt) == KErrNotFound )
isValid = ETrue;
}
}
}
}
else
{
isValid = EFalse;
}
}
return isValid;
}
Regards,
Symbee