Quote:
1) How does script diffrenciate from value typed "before" choosing an operator and "after"?
I noticed 2 vars - currentValue and newValue but completely don't get the logic how it's done...
So your app is a calculator. If you understand how classes/objects work you'll see that currentValue is initialized to 0. Then once the mathematical operation is performed, the current value then becomes the result of that operation.
Example:
Current value = 0;
What i type into txtOut textbox is 1.
My operation is .Add
So then 1 + 0 = 1. Therefore based on the code you provided, current value is now 1.
It looks as though you have a button called clear which then resets the value of currentValue to 0 in your code.
Quote:
2) The operation Calculate method with Operation argument:
Don't understand that one at all...
The operation calculate method uses an enum to decide what mathematical operation it is performing. I am assuming you know basic calculator functions so you should be able to understand what something like Operation.Add means.
This parameter is used in a switch statement to execute conditionally what operation to perform.
Quote:
3) Multi (nested) "if statments"
What exactly does the return keyword do?
The return keyword exits execution of the code. If it is simply return; that is being used, it is because your method has a return type of void which means nothing is returned. If it was something like return 1;, then your method likely has a return type of int and you are returning 1 which is an integer