473,503 Members | 2,046 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Parseint in vb.net?

Please tell me how do we use parseint function or its equivalent in
vb.net.
And also tell me how do we hide and display controls during run-time
in vb.net? I need to access the rows of a table for rendering them
during run-time.

Feb 14 '07 #1
2 17626
On Feb 14, 7:49 am, "Garg" <shivaniga...@gmail.comwrote:
Please tell me how do we use parseint function or its equivalent in
vb.net.
There are two functions:
Integer.parse(stringWithNumber) which returns an integer but throws an
exception if the string is not a number.

The other one, which I recommend, is Integer.tryParse, use it like
this:
Dim outNumber as Integer
If not Integer.tryParse(stringWithNumber, outNumber) Then
outNumber = defaultValue
End If
----

If stringWithNumber is not parseable as an Integer outNumber is set to
0.

Feb 14 '07 #2
Thanks a lot Henrik!!
I was kinda stuck there...since am new to vb.net

Feb 14 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
3506
by: Jeff Thies | last post by:
I've noticed that doing: var x=any number between -1 and 1, like 0.5 parsInt(x) yields NaN. I was expecting zero. Is there another way of doing this?
9
54144
by: Henrik | last post by:
In Java you can write something like this. Does anyone know how to do this in javascript? "byte b=Integer.parseInt(int value or String).byteValue;"
14
3267
by: jacster | last post by:
Hi, I'm trying to parse a string of the form 08:00 representing a time so I can calculate the difference between two times. parseInt(time) with a leading zero returns 0. Is there a way around...
6
8752
by: RobG | last post by:
I am writing a script to move an absolutely positioned element on a page by a factor using style.top & style.left. The amount to move by is always some fraction, so I was tossing up between...
25
9540
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - Why does parseInt('09') give an error? ----------------------------------------------------------------------- ...
14
2928
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - Why does K = parseInt('09') set K to 0? ----------------------------------------------------------------------- ...
12
1780
by: kilik3000 | last post by:
Why does parseInt("0000000000000018") return 1, while parseInt("0000000000000018", 10) return 18? My assumption was that the base 10 would be default argument for radix. Wouldn't you want to...
6
1485
by: lorlarz | last post by:
Regarding http://mynichecomputing.com/digitallearning/yourOwn.htm and how to make it fail when it should not with an integer OR parseInt to integer conversion problem. THE real problem IS is...
0
7091
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7282
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7342
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7464
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5018
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3162
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1516
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
741
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
391
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.