|
Subject:
|
Problem with first exercize in the book
|
|
Posted By:
|
steve234
|
Post Date:
|
9/27/2003 4:02:14 PM
|
I just installed VS.NET Ent Architect 2003. I have successfully created a couple simple VB Apps, and I am trying C#. The first exercise in "Beginning Visual C#" (p21) is trivial; you only write one line of code: Console.WriteLine("Some text"); The wrapper code for this class is autogenerated. I noticed as I typed in lowercase that 'Intellisense' was not converting the statement to mixed case, and as I expected, I got an error when I tried to run it. It's as if it was missing a "Using..." statement. The auto-generated code had Using System; at the top. I have no such problems when I write VB apps. Is there something else I should be including in the "Using..." section? Or is there some basic configuration of VS.NET 2003 that is not properly set? Thanks.
|
|
Reply By:
|
Chris Beach
|
Reply Date:
|
9/27/2003 5:07:56 PM
|
Thats because C# and pretty much everything cept VB is case sensitive, so iInt, iint and Iint are all different variable names.
So VS can't autocorrect capitilization for you, I'm not sure why you can't have an option to assume 'if it 'xxx' exists already in the language or defined, then captilize the same as before'...because for beginners it is harder to remember and it must slow down the typing of the code.
One tip though, CTRL+SPACE will autocomplete (or bring up a list if VS is unsure) the word, so typing 'using S' then pressing ctrl+space will put in 'ystem' for you.
Also watch the intellisense that does come up, esp on lines like 'xxx var=new' as intellsense will automattically pick the right bit after the new so you can just type '('
|
|
Reply By:
|
steve234
|
Reply Date:
|
9/28/2003 6:47:19 PM
|
That was it! With all of Microsoft's hype about how unified Visual Studio is, it didn't occur to me that their 'intellisense' didn't correct the casing on text as you type, the way it does with VB. Live and learn!
|
|
Reply By:
|
Marit
|
Reply Date:
|
12/18/2003 2:20:32 PM
|
Thanks for the post. It was pretty frustrating when I couldn't even do the first one! I also come from a VB background.
|
|
Reply By:
|
steve053
|
Reply Date:
|
12/21/2003 5:32:20 PM
|
FYI - the first exercise is included in the download material from wrox for this book. I haven't gotten to the next chapter but I'm assuming that all/most/many of the exercises are included.
|