Error in book

  • Thread starter Thread starter Ganesh J. Acharya
  • Start date Start date
G

Ganesh J. Acharya

|| Shree Ganesha ||

I am reading this book, MCAD/MCSD Tranining - Developing Windows Based
Applications with visual basic .net and visual c# .net-by MSPRESS

The book reades the following

"The code in this example will complile and execute without raising an
error. How ever, when you examine the value aShort, you find that it
contains -31072. Because the maximum value of aShort is smaller that
the value that you attempted to convert, the conversion could be
performed and a different value was returned."

The code example was

Dim anInteger As Integer = 100000
Din aShort As Short
aShort = CType(anInteger, Short)

Here the error is successfully raised saying that "Arithmatic
operation resulted in to a data overflow" the book seems to either a
old version or the software vb.net was later improved please let me
know the details


Ganesh J. Acharya
B.Sc
& Students of karROX Dombivali evening batch Sep 2003
 
Ganesh,

You can email the Editors of the book directly and I am sure they will
look into the issue. You can find the e-mail address on the first few pages
of the book.
I have to admit that at places the text is sightly confusing and we need
to read it over and again to comprehend. May be it is a ploy by the author
to make us learn the concept 'the hard way' :-)
 
Back
Top