qosaglass.blogg.se

Free download space engineers programmable block
Free download space engineers programmable block











Note: The example I used is definitely not an optimal solution, but this is about casting and not how to overload a method, which comes later, when I talk about methods. 0 being there and would return an error saying, "hey, you know this isn't an int you are saving to an int, right?")

free download space engineers programmable block

Semantics, really, but the computer cares about the. Then the result, which is returned as a double (so in this case, it would come back as 2.0) is cast into an int (now it becomes 2. So what did I do there? I made a single method (DivideTwoNumbers) and asked it to take two var variables (remember, var is context-sensitive- it automatically types the variable as to what is assigned to it), then divide one into the other, while converting the second number explicitly into a double (casting the variable as a double, basically). Public double DivideTwoNumbers(var i, var j)













Free download space engineers programmable block