C# Essentials by Ben Albahari, Peter Drayton & Brad Merrill This errata page lists errors outstanding in the most recent printing. If you have any error reports or technical questions, you can send them to booktech@oreilly.com. (Please specify the printing date of your copy.) This page was last updated on June 14, 2001. Here's a key to the markup: [page-number]: serious technical mistake {page-number}: minor technical mistake : important language/formatting problem (page-number): language change or minor formatting problem ?page-number?: reader question or request for clarification CONFIRMED errors: {5} last paragraph: The first sentence claims that to compile Test.cs one should run "cs Test.cs". The compiler is csc, not cs, so this text should be "csc Test.cs". (9) bottom of page; there is an unnecessary space before "int" (12) bool type, last sentence: s/a array/an array/ (18) definite assignment: The ast sentence reads, "a warning is generated if the line v = a is commented out". This is true, but it is not because a default value is assigned to a field that was never explicitly assigned. The warning is because the field is never used. We should remove this last sentence. (22) 2nd paragraph, 2nd-to-last sentence: s of statement font is different. {25} do-while loops syntax: s/statement o -statement-block/statement-or-statement-block/ {25} while loops syntax: s/statement or statement-block/statement-or-statement-block/ (Also make sure this is all in italics; the or currently isn't.) (35) 1st sentence: s/base class must explicitly/base class should explicitly/ {35} replace code fragment: public class Base { // written by the library people public virtual void Foo() {...} // added in latest update } public class Derived : Base { // written by you public void Foo() {...} // not intended as an override } (38) first paragraph; The first sentence should read: "Includes fields, constants, and events. (38) Differences between Classes and Structs: Words for first bullet s/structs typically simple types, whereas value-type semantics/structs are typically simple types were value semantics/ (39) last paragraph: s/A read-only field is always evaluated/Assignment to a read-only field is always evaluated/ s/To compile, a nonread-only field/To compile, a read-only field/ {41} properties syntax: The [ before virtual is in italics. Also, the last "attributes? set statement-block" line should not have a | on the end of it. {46} Operators: missing ==, please add. {57} s/type [*]+ /type[*]+ array-name /. array-name should be in italics. {60} code fragment: s/Toggle tog = (Switch)Enum.FromString/Toggle tog = (Toggle)Enum.FromString/ {74} The #define statement is effectively equivalent to #define true (drop the =). (86) 3rd paragraph: The last sentence reads: (see the laster section "Strings"). It should read: (see the latter section "Strings"). (95) last sentence: s/returns if/returns false if/ (109) s/First, execution may leave the lock statement blocked/First, execution may leave the scope of the lock statement block (127) bullet 4: s/attribute, may/attribute may/ (131) 3rd paragraph, last sentence: s/object/objects/ {139} code fragment: This no longer compiles because Microsoft updated MSN Instant Messenger - replace with this code frag: // SetFN.cs - compile with /r:Messenger.dll // Run SetFN.exe to set the FriendlyName for // the currently logged-in user // Run TlbImp.exe "C:\Program Files\Messenger\msmsgs.exe" // to create Messenger.dll using Messenger; // COM API for MSN Instant Messenger public class MyApp { public static void Main(string[] args) { MsgrObject mo = new MsgrObject(); IMsgrService im = mo.Services.PrimaryService; im.FriendlyName = args[0]; } } Also, update the leadin sentence as follows: s/example demonstrates adding a contact to MSN/example demonstrates changing the friendly name of the user with MSN/. (142) 1st sentence: s/to one/to use one/ (144) s/ILAsm.exe/ILDasm.exe/ (144) s/see the String namespace/see the String class/ (146) s/System. Activator/System.Activator/ (161) for definition: s/stopping-condition/continuation-condition/ (163) return definition: s/nonvoid/non-void/ (163) sealed definition: s/derived-from/derived from/