×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Nov 2008
    Posts
    1

    Need help with calculator

    Ok I need to do a calculator that calculates sum of two numbers. I have three fixedpoint editors, two of them is for numbers and one is for the answer. I can enter numbers for those boxes but i can't get the answer, it's always 0,00. Could this be somekind of decimal problem or maybe it's the code, i don't know...

    is this ok:

    Code:
    void CLaskinContainer::CalculateSum()
    {
    iFocusControl->SetFocus(EFalse);
    iFixedPointEditor3->SetFocus(ETrue);
    
    const TInt iTulos = (  iFixedPointEditor1->Value() + iFixedPointEditor2->Value()   ) ;
    iFixedPointEditor3->SetValueL(&iTulos);
    iFixedPointEditor3->DrawNow();
    
    iFixedPointEditor3->SetFocus(EFalse);
    iFocusControl->SetFocus(ETrue);
    
    }
    Hope someone can help...I can post more info if needed
    Thanks

  2. #2
    Nokia Developer Champion
    Join Date
    Jul 2004
    Posts
    2,015

    Re: Need help with calculator

    Have you made any attempt to debug this yet?


    First step, what value does iFixedPointEditor1->Value() return?, What value does iFixedPointEditor2->Value() return?
    Are these values as you expected, if not then look into why not. If yes then what happens if you add them together and assign them into a variable? Does soemthing go wrong, if so what happens if you change the type of the variable etc. etc. etc.

    Its elementary debugging to pinpoint or at least narrow down the origin of the issue. Once its narrowed down it you can't figure out what the issue is then post on here.

Similar Threads

  1. developing gui based calculator
    By amrish20 in forum Symbian User Interface
    Replies: 6
    Last Post: 2008-06-24, 11:00
  2. Simple calculator
    By remesh in forum Symbian User Interface
    Replies: 4
    Last Post: 2008-06-24, 07:43
  3. memory in calculator
    By amrish20 in forum Symbian User Interface
    Replies: 1
    Last Post: 2008-06-19, 13:20
  4. Python in a calculator??
    By halimi in forum Python
    Replies: 7
    Last Post: 2007-12-01, 18:00
  5. 6131 wheres the calculator???
    By srivatsanhari in forum General Development Questions
    Replies: 1
    Last Post: 2007-06-28, 18:31

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •