![]() ![]() Public double DivideTwoNumbers(var i, var j) ![]() To basically summarize why a switch is awesome, let's rewrite the above code example using if/else: If you are just going to have a true/false evaluation, stick with if/else. This is really only useful if you have more than two possibilities. If it can be evaluated, a switch can evaluate it. It only works for an exact match- a single character difference fails the case.) and anything else you can think of, really. Remember that strings are case-sensitive. ![]() This also works for strings ("case "Hi": do stuff It would work if the string was "Hi". default: /*If all other cases fail, then do this thing.*/ Since i = 10, this is the one that executes*/ You probably shouldn't need that much.) An int is declared as such: I have also tested the limits, and they are accurate. If they don't work in-game, I'm not listing them here. NOTE: This only shows types that are implemented in-game. ![]() The following types of variables (not objects) are available in Space Engineers: This means that each variable has a specific data type assigned to it. They let you store information in your program to be referenced or changed later on. Variables are the bread and butter of programming. If you haven't, please do so.Īs in my prior guide, bold words in the text (not the titles) are found in the glossary at the end of the post. This guide also assumes you have read my first guide prior to this. It is meant for beginners, so there may be concepts here that are not used as often in professional C# code, since those are more advanced topics. This guide will go through C# in the context of its use in Space Engineers. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |