Re: how to stop late binding



"Boni" <oilia@nospam> schrieb:
Enable 'Option Strict On'. However, this will require explicit conversion of double to integer too (i = CInt(d)').
I hate this. Even in C++ it is possible to convert double to int implicitely.

'Option Strict On' enforces explicit casts everywhere where a type incompatibility could occur or where information would get lost when casting.


Is it absolutely unflexible? I need only to switch off late binding. I have a huge project and I would like to avoid unnessesory changes.Or at lease go thru project and look myself. But compiler stops complainig after 100-th bug. Can I switch this off?

I do not think it's unflexible. You can turn on 'Option Strict On' on per-file basis and add the necessary cast operators to the source code.


--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>


.



Relevant Pages

  • Re: Collections
    ... cast an abstract class into a derived class ... First remember that DirectCast is the Cast operator, while CType is the ... Conversion operator that will do a Cast if the cast is allowed. ... remember that Casting & Converting are separate ...
    (microsoft.public.dotnet.languages.vb)
  • Re: srand(time(NULL))
    ... NULL can be assigned to any pointer type without casting (also the conversion of void * to whatever_type * is implicit). ... I think the casting of the return value of timeto unsigned int is unnecessary, since the return value is implicitly converted to the unsigned int argument. ...
    (comp.lang.c)
  • Re: Type Casting
    ... Nice Chap & Tom, ... Casting a class from a base class or to a derived class is NOT a conversion! ... So it can be neither Widening nor Narrowing! ...
    (microsoft.public.dotnet.languages.vb)
  • Re: casting vs. using the "Convert" methods?
    ... When I was talking of casting I was of course only talking about casting ... because it was a conversion and not a cast. ... > cast operator that converted a string to an int. ...
    (microsoft.public.dotnet.languages.csharp)
  • [SLE] Re: Re: OT: Editing PDF files
    ... > lost in plain text conversion. ... Ah - pdftohtml is almost useful. ...
    (SuSE)