Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / January 2005

Tip: Looking for answers? Try searching our database.

build / design time errors?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nick Stansbury - 06 Jan 2005 18:14 GMT
Hi,

   Is there any way to control the raising of "build" errors? For example -
is there any possible way of, for example, raising a build error if the
object user tries to call method(x) before having set property y ?

Thanks
John Saunders - 06 Jan 2005 19:27 GMT
> Hi,
>
>    Is there any way to control the raising of "build" errors? For
> example -
> is there any possible way of, for example, raising a build error if the
> object user tries to call method(x) before having set property y ?

What do you mean "before"? How could the compiler determine what the runtime
sequence of events would be?

This is the sort of thing you have to do at runtime.

John Saunders
Marcos Stefanakopolus - 06 Jan 2005 19:49 GMT
The compiler can detect code that cannot be reached, and throws warnings
about that; how, particularly, is "require-x-before-y" really any different?

Conceptually, these seem like very similar concepts, and I don't see why the
compiler mechanisms that do dead-code detection could not be adapted for
this purpose as well.  Is it just that nobody has bothered to teach the
compiler that particular trick, or is there something more subtle I'm not
seeing?

>> Hi,
>>
[quoted text clipped - 9 lines]
>
> John Saunders
John Saunders - 06 Jan 2005 22:51 GMT
> The compiler can detect code that cannot be reached, and throws warnings
> about that; how, particularly, is "require-x-before-y" really any
[quoted text clipped - 5 lines]
> the compiler that particular trick, or is there something more subtle I'm
> not seeing?

The compiler knows the code paths within a method and can determine that a
piece of code might not be reached. But if you're talking about a publicly
accessible property, the compiler has no way to determine what piece of code
might ultimately set that property. It might be set by code which is not
even in the same compilation.

John Saunders

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.