Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Stephens' C# Programming with Visual Studio 2010 24-Hour Trainer
This is the forum to discuss the Wrox book Stephens' C# Programming with Visual Studio 2010 24-Hour Trainer by Rod Stephens; ISBN: 9780470596906
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Stephens' C# Programming with Visual Studio 2010 24-Hour Trainer section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 16th, 2011, 10:14 AM
Registered User
Points: 23, Level: 1
Points: 23, Level: 1 Points: 23, Level: 1 Points: 23, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2011
Location: Sweden
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 12 exercise 4 outside US

Hi.
Just some info for other forigen students….
I’m from Sweden and when I download the solution for 12-4 and try to run it I got FormatExeption.

I tried to pase my output in to this message so you could see what it loked like but it was not accepted

I tried to figure out the problem by reding the tips in the exeption but that didn’t help (I still need to learn more I think) so I did som trial and error or like it said in the book… I staired real hard at the code like they did on the old days (I’m a mainframeprogrammer converting to .NET. That’s the reason for me reding this book)

In Sweden we don’t write ammount like $10,000.00
Here propper amounts would be 10 000,00 or 10 000,00kr or 10.000,00kr
So by changing the text in all textboxes I finally got it to work.

Cheers
  #2 (permalink)  
Old December 16th, 2011, 10:31 AM
Rod Stephens's Avatar
Wrox Author
Points: 3,166, Level: 23
Points: 3,166, Level: 23 Points: 3,166, Level: 23 Points: 3,166, Level: 23
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2006
Location: , , .
Posts: 647
Thanks: 2
Thanked 96 Times in 95 Posts
Default

Lesson 34 has more to say about internationalization. I wrote all of the examples on my computer set up for United States English so things like monetary values use that format. So, as you noticed, they probably won't work properly in other countries. Sorry about the confusion.

You found the right solution: change the values to use your local formats. There are ways you can make things like int.Parse read formats from countries other than the one you're in but that would just confuse matters and not be all that helpful.

Note that values inside your code should always be in the United States formats. Not because those are better but to be consistent Microsoft had to pick something and, since they developed C# in the United States, that's the format they decided to use. Hopefully the difference won't be too annoying.
__________________
Rod

Rod Stephens, Microsoft MVP

Essential Algorithms: A Practical Approach to Computer Algorithms

(Please post reviews at Amazon or wherever you shop!)
  #3 (permalink)  
Old December 16th, 2011, 10:42 AM
Registered User
Points: 23, Level: 1
Points: 23, Level: 1 Points: 23, Level: 1 Points: 23, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2011
Location: Sweden
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank’s Rod.
I just wanted to help/inform other students that might have the same problem.
I’ll struggle on. In January I will take a real class and by then I will hopefully have some basic knowledge about Visual Studio and C# in order to get the moste out of the class.
I’m really enyoying your book so far.
  #4 (permalink)  
Old December 16th, 2011, 10:51 AM
Rod Stephens's Avatar
Wrox Author
Points: 3,166, Level: 23
Points: 3,166, Level: 23 Points: 3,166, Level: 23 Points: 3,166, Level: 23
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2006
Location: , , .
Posts: 647
Thanks: 2
Thanked 96 Times in 95 Posts
Default

I agree. It's the sort of issue that can be a real problem if you're new to all this. (I've worked on some big programs (written by other people) where a similar problem made them fail only in specific countries and only on some computers and it was a big hassle.)

If you get stuck like this again, feel free to let me know and I'll try to help. I hate to waste your time on something like this.
__________________
Rod

Rod Stephens, Microsoft MVP

Essential Algorithms: A Practical Approach to Computer Algorithms

(Please post reviews at Amazon or wherever you shop!)
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 12 - Last try it out exercise pgmrbs BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 4 August 13th, 2010 12:04 PM
Chapter 12, Exercise 5 Answer cree8uk BOOK: Beginning Microsoft Visual C# 2008 ISBN: 978-0-470-19135-4 3 June 5th, 2010 02:33 PM
Errors on Chapter 12 example(12.8) sonnie ASP.NET 2.0 Professional 2 June 7th, 2006 10:55 AM



All times are GMT -4. The time now is 09:31 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.