|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Strict On/OffI generally like to be very tight with my type casting and matching, so I like the use Option Strict On. However, I am coming across some needs where I would to turn it off. As far as I can see, the compiler doesn't support turning it off/on between code lines. If this possible? I guess I can break up the code and put these parts in a new module where I know the type casting is safe and use Option Strict off but is it possible with some other method? Thanks -- Mike,
The partial class can be your friend in this, although I have never that I cannot cast. Cor "Mike" <unkn***@unknown.tv> schrieb: Unfortunately no. You can only turn it on/off on a member basis by using a > I generally like to be very tight with my type casting and matching, so I > like the use Option Strict On. > > However, I am coming across some needs where I would to turn it off. > > As far as I can see, the compiler doesn't support turning it off/on > between code lines. > > If this possible? partial class and setting 'Option Strict On'/'Option Strict Off' for each of the partial type declarations. I tend to use this approach when dealing with COM Interop scenarios such as in Office programming. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://dotnet.mvps.org/dotnet/faqs/> Herfried K. Wagner [MVP] wrote:
Show quoteHide quote > "Mike" <unkn***@unknown.tv> schrieb: Ok, thanks Herfried and Cor for the tip.>> I generally like to be very tight with my type casting and matching, >> so I like the use Option Strict On. >> >> However, I am coming across some needs where I would to turn it off. >> >> As far as I can see, the compiler doesn't support turning it off/on >> between code lines. >> >> If this possible? > > Unfortunately no. You can only turn it on/off on a member basis by > using a partial class and setting 'Option Strict On'/'Option Strict Off' > for each of the partial type declarations. > > I tend to use this approach when dealing with COM Interop scenarios such > as in Office programming. --
Visual Studio 2008 and Classes Inheriting From System.Web.UI.WebControls.Style
Problem with embedded carriage returns trouble reading word documents Good tutorial for working with XML Using function with PChar data type problem reading array data from structure still problems reading word documents... how to know if to close sqlreader Build Number - how to auto increment? Question on system.mail.net and formatting mail body |
|||||||||||||||||||||||