Wrox Programmer Forums
|
VS.NET 2002/2003 Discussions about the Visual Studio.NET programming environment, the 2002 (1.0) and 2003 (1.1). ** Please don't post code questions here ** For issues specific to a particular language in .NET, please see the other forum categories.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VS.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 15th, 2006, 12:22 PM
Registered User
 
Join Date: Jan 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Overloading Overriding

Hi There,

I downloaded a code from net. I analysed the code.

<a href="http://www.only4gurus.com/v3/download.asp?resource=3281" rel="nofollow">http://www.only4gurus.com/v3/download.asp?resource=3281</a>[<a href="http://www.only4gurus.com/v3/download.asp?resource=3281" target="_blank" rel="nofollow" title="New Window">^</a>]

The file is <i>ScopingOverloadingOverriding.zip</i>
But it doesn't works the way I thought. I belive it should give a error when Employees Salary as every employee sal should be in a particular range like for full time employee the range should be between 30000 & 50000. But it doesn't happens. Can anyone please tell me that am I correct will it show error. If not then what is the effect of line

<b>if value<30000 and value >50000 then
throw new argumentoutofrangeexception ("Salary", Full Time salary should be between 30000 and 500000")</b>

How should one diagnose the code that is given in a class file. Usually F10 mode is used but it skips code given in class file and directly returns answer to the actual code. I want to check each line of the class file.

Please Help.

Thanking you and waiting for some kind replies.

Amit

 
Old January 15th, 2006, 03:10 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

You need to use Or instead of And. A number cannot be less than 30000 and larger than 50000 at the same time, so the code in the If statement will never fire.

Using F11 takes you into a function call, instead of stepping over it.

HtH,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old January 22nd, 2006, 12:55 AM
Registered User
 
Join Date: Jan 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hey Thanks Imar... Thanks a lot. I will Try it.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Overloading nayeem69 .NET Framework 2.0 1 July 17th, 2007 12:30 AM
Overriding arv1980 VS.NET 2002/2003 0 January 21st, 2006 09:58 PM
enum toString() overloading kramis8 C# 0 November 21st, 2004 07:55 PM
Overloading & Overriding The Same Property DoorHandle Pro VB.NET 2002/2003 7 August 25th, 2004 07:34 AM
Overloading Initialize_Class sg48 Excel VBA 1 July 11th, 2003 07:47 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.