Go Back   Forum Care Forums > Development Reference Area > Visual Basic

Reply
 
LinkBack Thread Tools Display Modes
2 Extreme newbie questions
Old
  (#1)
Hari
Guest
 
Posts: n/a
Default 2 Extreme newbie questions - 06-04-2007, 09:45 AM

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 cl*** 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.


   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Re: 2 Extreme newbie questions
Old
  (#2)
Rick Rothstein
Guest
 
Posts: n/a
Default Re: 2 Extreme newbie questions - 06-04-2007, 09:45 AM

Almost everybody in this newsgroup is using VB6 or lower. While you may
get a stray answer to VB.NET questions here, you should ask them in
newsgroups devoted exclusively to .NET programming. Look for newsgroups
with either the word "dotnet" or "vsnet" in their name.

For the microsoft news server, try these newsgroups...

microsoft.public.dotnet.general
microsoft.public.dotnet.languages.vb
microsoft.public.vsnet.general

There are some others, but these should get you started.

Rick - MVP



"Hari" <EMAIL REMOVED> wrote in message
news:qIidnS8vWaUYZYHcRVn-EMAIL REMOVED...
> 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 cl***

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.
>
>


   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Re: 2 Extreme newbie questions
Old
  (#3)
Hal Rosser
Guest
 
Posts: n/a
Default Re: 2 Extreme newbie questions - 06-04-2007, 09:45 AM

look at the System.Convert.ToInt32( stringToConvert )
method in the System namespace

I'm more familiar java too and still exploring dot-net
- look at .net's 'namespaces' as similar to java 'packages' - at least
that's my impression so far



"Hari" <EMAIL REMOVED> wrote in message
news:qIidnS8vWaUYZYHcRVn-EMAIL REMOVED...
> 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 cl*** 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.
>
>



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.732 / Virus Database: 486 - Release Date: 7/29/2004


   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Re: 2 Extreme newbie questions
Old
  (#4)
Eddie B
Guest
 
Posts: n/a
Default Re: 2 Extreme newbie questions - 06-04-2007, 09:45 AM

>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 cl*** should I
>use?

num=val(str)

>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


do this...

Dim slots(3) As Integer
Try
slots(4) = 3
Catch Except As IndexOutOfRangeException
'catch code here
MsgBox("IndexOutOfRangeException")
Catch Except As Exception
'other catch code here
MsgBox("General Exception")
End Try




On Fri, 13 Aug 2004 13:21:17 -0400, "Hari" <EMAIL REMOVED>
wrote:

>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 cl*** 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.
>


   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Contact Us - Forum Care Forums - Archive - Top