diff --git a/docs/errata/README.md b/docs/errata/README.md index 3cc4771..c62f31c 100644 --- a/docs/errata/README.md +++ b/docs/errata/README.md @@ -4,7 +4,7 @@ If you find any mistakes in the seventh edition, *C# 11 and .NET 7 - Modern Cros [**Errata** (44 items)](errata.md): Typos, tool user interface changes, or mistakes in code that would cause a compilation error that prevents a successful build. -[**Improvements** (33 items)](improvements.md): Changes to text or code that would improve the content. These are optional. +[**Improvements** (34 items)](improvements.md): Changes to text or code that would improve the content. These are optional. [**Common Errors** (4 items)](common-errors.md): These are some of the most common errors that a reader might encounter when trying to get code in book tasks to work, or when trying to write your own code. diff --git a/docs/errata/images/vsmac-arguments.png b/docs/errata/images/vsmac-arguments.png new file mode 100644 index 0000000..904789a Binary files /dev/null and b/docs/errata/images/vsmac-arguments.png differ diff --git a/docs/errata/improvements.md b/docs/errata/improvements.md index a44a500..0dbaaa5 100644 --- a/docs/errata/improvements.md +++ b/docs/errata/improvements.md @@ -1,4 +1,4 @@ -**Improvements** (33 items) +**Improvements** (34 items) If you have suggestions for improvements, then please [raise an issue in this repository](https://github.com/markjprice/cs11dotnet7/issues) or email me at markjprice (at) gmail.com. @@ -98,6 +98,23 @@ In Step 1, I note that the `ReadLine` method is declared to return `string?`, me In the next edition, I will add a note to explain that this method never actually returns `null` so there is no point in checking for that in functional code. A more useful check is `string.IsNullOrEmpty` so I will add more steps to show how to use that method and `string.IsNullOrWhiteSpace` to validate text input. +# Page 91 - Passing arguments to a console app + +> Thanks to `MINIMA#8536` for raising this issue in the Discord channel for this book. + +I give instructions for Visual Studio 2022 for Windows and Visual Studio Code. A few readers use Visual Studio 2022 for Mac but it is different to Visual Studio 2022 for Windows. + +In the next edition, I will add steps for Visual Studio 2022 for Mac: + +1. In Visual Studio for Mac, right-click the `Arguments` project. +2. In the popup menu, select **Properties**. +3. In the **Project Properties - Arguments** dialog box, in the left-hand navigation section, select **Run** | **Configurations** | **Default**. +4. In the **Arguments** box, enter the arguments: `firstarg second-arg third:arg "fourth arg"`, as shown in the following screenshot. +5. Click **OK**. +6. Run the console app. + +![Passing arguments using Visual Studio 2022 for Mac](images/vsmac-arguments.png) + # Page 128 - Rounding numbers In this section, I wrote about rounding rules as taught in schools and compare them to rounding rules when using C# and .NET. In schools, children are introduced to rounding rules with positive numbers and so learn the term "rounding up" and "rounding down". I did not explicitly say that for negative numbers, those terms would be reversed which can be confusing, so those terms should be avoided. This is why the .NET API uses the enum values `AwayFromZero`, `ToZero`, `ToEven`, `ToPositiveInfinity` and `ToNegativeInfinity` for improved clarity. In the next edition I will add a note about this.