Click here to Skip to main content
16,003,216 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Validation of the date and number Pin
EliottA7-Oct-09 6:08
EliottA7-Oct-09 6:08 
GeneralRe: Validation of the date and number Pin
Frauenarzt7-Oct-09 6:27
Frauenarzt7-Oct-09 6:27 
GeneralRe: Validation of the date and number Pin
Henry Minute7-Oct-09 7:18
Henry Minute7-Oct-09 7:18 
GeneralRe: Validation of the date and number Pin
Frauenarzt7-Oct-09 7:32
Frauenarzt7-Oct-09 7:32 
GeneralRe: Validation of the date and number Pin
Henry Minute7-Oct-09 7:38
Henry Minute7-Oct-09 7:38 
GeneralRe: Validation of the date and number [modified] Pin
Frauenarzt7-Oct-09 7:47
Frauenarzt7-Oct-09 7:47 
GeneralRe: Validation of the date and number Pin
Henry Minute7-Oct-09 8:33
Henry Minute7-Oct-09 8:33 
GeneralRe: Validation of the date and number [modified] Pin
Frauenarzt7-Oct-09 9:18
Frauenarzt7-Oct-09 9:18 
Thank you very much Smile | :)

I tried to make a use of it:
dim cnt_adult as integer
Dim ok As Boolean
Dim result As Integer


System.Console.WriteLine("How many adult tickets required?")
cnt_adult = System.Console.ReadLine()

ok = Integer.TryParse(cnt_adult, result)


The compiler breaks on ReadLine() when I type in any letter, and that's obvious because cnt_adult is declared as integer, instead string.

The things is I need cnt_adult to be an integer, so I can multiply/add that value later on. [If I try add two values [for example 2 and 4] as strings the result will be "24" not "6".

Do you have any suggestions?


added:

I think I found an answer. I can declare cnt_adult as string and then easily validate it and when I will use it as integer just type:
cInt(cnt_adult)

Smile | :)

Thank you once again for help Smile | :)

modified on Wednesday, October 7, 2009 3:25 PM

GeneralRe: Validation of the date and number Pin
EliottA7-Oct-09 9:22
EliottA7-Oct-09 9:22 
GeneralRe: Validation of the date and number Pin
Ian Shlasko7-Oct-09 9:38
Ian Shlasko7-Oct-09 9:38 
GeneralRe: Validation of the date and number Pin
Henry Minute7-Oct-09 10:21
Henry Minute7-Oct-09 10:21 
QuestionConnecting VB2008 Express to SQL Server 2008 Developer Pin
Garth Geoghan7-Oct-09 5:08
Garth Geoghan7-Oct-09 5:08 
AnswerRe: Connecting VB2008 Express to SQL Server 2008 Developer Pin
EliottA7-Oct-09 5:11
EliottA7-Oct-09 5:11 
GeneralRe: Connecting VB2008 Express to SQL Server 2008 Developer Pin
Garth Geoghan7-Oct-09 5:33
Garth Geoghan7-Oct-09 5:33 
GeneralRe: Connecting VB2008 Express to SQL Server 2008 Developer Pin
Garth Geoghan7-Oct-09 7:12
Garth Geoghan7-Oct-09 7:12 
GeneralRe: Connecting VB2008 Express to SQL Server 2008 Developer Pin
EliottA7-Oct-09 7:19
EliottA7-Oct-09 7:19 
GeneralRe: Connecting VB2008 Express to SQL Server 2008 Developer Pin
Garth Geoghan7-Oct-09 7:23
Garth Geoghan7-Oct-09 7:23 
GeneralRe: Connecting VB2008 Express to SQL Server 2008 Developer Pin
Garth Geoghan7-Oct-09 7:27
Garth Geoghan7-Oct-09 7:27 
AnswerRe: Connecting VB2008 Express to SQL Server 2008 Developer Pin
Dave Kreskowiak7-Oct-09 5:15
mveDave Kreskowiak7-Oct-09 5:15 
GeneralRe: Connecting VB2008 Express to SQL Server 2008 Developer Pin
Garth Geoghan7-Oct-09 5:29
Garth Geoghan7-Oct-09 5:29 
GeneralRe: Connecting VB2008 Express to SQL Server 2008 Developer Pin
Dave Kreskowiak7-Oct-09 6:35
mveDave Kreskowiak7-Oct-09 6:35 
GeneralRe: Connecting VB2008 Express to SQL Server 2008 Developer Pin
Garth Geoghan7-Oct-09 6:38
Garth Geoghan7-Oct-09 6:38 
GeneralRe: Connecting VB2008 Express to SQL Server 2008 Developer Pin
Garth Geoghan7-Oct-09 6:42
Garth Geoghan7-Oct-09 6:42 
GeneralRe: Connecting VB2008 Express to SQL Server 2008 Developer Pin
Dave Kreskowiak7-Oct-09 9:08
mveDave Kreskowiak7-Oct-09 9:08 
GeneralRe: Connecting VB2008 Express to SQL Server 2008 Developer Pin
Garth Geoghan7-Oct-09 9:23
Garth Geoghan7-Oct-09 9:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.