equal
deleted
inserted
replaced
3426 Complete(env.GetAsDesL(*iVar1) == *iArg); |
3426 Complete(env.GetAsDesL(*iVar1) == *iArg); |
3427 } |
3427 } |
3428 break; |
3428 break; |
3429 case EAdd: |
3429 case EAdd: |
3430 case ESubtract: |
3430 case ESubtract: |
3431 { |
3431 case EMultiply: |
3432 if (iArg == NULL) LeaveIfErr(KErrArgument, _L("Argument must be specified for add and subtract operations")); |
3432 { |
|
3433 if (iArg == NULL) LeaveIfErr(KErrArgument, _L("Argument must be specified for add, subtract and multiply operations")); |
3433 TLex lex(*iArg); |
3434 TLex lex(*iArg); |
3434 TInt operand; |
3435 TInt operand; |
3435 TInt err = lex.Val(operand); |
3436 TInt err = lex.Val(operand); |
3436 LeaveIfErr(err, _L("Couldn't parse an integer from argument '%S'"), iArg); |
3437 LeaveIfErr(err, _L("Couldn't parse an integer from argument '%S'"), iArg); |
3437 if (iOperation == ESubtract) operand = -operand; |
3438 TInt value = 0; |
3438 TInt current = 0; |
3439 TRAP_IGNORE(value = env.GetAsIntL(*iVar1)); // If it doesn't yet exist or isn't an int, we'll treat it as if it was zero |
3439 TRAP_IGNORE(current = env.GetAsIntL(*iVar1)); // If it doesn't yet exist or isn't an int, we'll treat it as if it was zero |
3440 if (iOperation == ESubtract) value = value - operand; |
3440 env.SetL(*iVar1, current + operand); |
3441 else if (iOperation == EMultiply) value = value * operand; |
|
3442 else value = value + operand; |
|
3443 env.SetL(*iVar1, value); |
3441 break; |
3444 break; |
3442 } |
3445 } |
3443 default: |
3446 default: |
3444 User::Leave(KErrNotSupported); |
3447 User::Leave(KErrNotSupported); |
3445 } |
3448 } |