Groups | Blog | Home
all groups > dotnet academic > august 2004 >

dotnet academic : 2 extreme newbie ?s


Hari
8/13/2004 2:43:23 PM
I just started programming in Visual Basic.NET about a month ago, so I am
completely oblivious as to which libraries to look in. However, I have good
experience with Java and C. Below are ten extremely simple questions which I
couldn't seem to find the answers to after looking in some text and
searching through the libraries:

I looked many places for the library that parses Strings into different
number formats, but couldn't find one.
Ex:
Dim str As String = "8.93"
Dim num As Double
num = ???
If I want num to be set to 8.93, which method of the String class should I
use?


When I implement the Try... Catch... Finally set, I can't quite get the
clause to function the way I want it to. Take the following piece of code:
____ 'Start
Dim slots(3) As Integer
Try
slots(4) = 3
Catch Except As IndexOutOfBounds 'or something
'catch code here
Catch Except As Exception
'other catch code here
___ 'End
if I want to have a certain exception handled one way and any other
exception all handled in one general way, what do I need to do. If I type in
the above code, I always get the the general code executed, even if the
IndexOutOfBounds exception was thrown.


Peter van der Goes
8/14/2004 11:17:11 AM

[quoted text, click to view]
Look into the System.Convert class and its methods for your conversions.
For generalized exception handling, look into the Exception class. In the
help, look for articles on "exception handling", "structured exception
handling" and "Exception handling changes in Visual Basic".

--
Peter [MVP Visual Developer]
Jack of all trades, master of none.
Look up the Exception class

Opher Shachar
8/15/2004 12:01:53 PM
"Hari" <harixseshadri@yahoo.com> ëúá
áäåãòä:GbGdnc45su5ZloDcRVn-vA@adelphia.com...
[quoted text, click to view]
Q: Why are'nt you coding in C#?

[quoted text, click to view]
try:
num = Double.Parse(str)
hint: put it in a try...cath clause

[quoted text, click to view]
Before .Net I coded in VB6. Intuitively your code should work...

AddThis Social Bookmark Button