Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.basic.visual.misc > #2237

Re: how do you read in an integer in a console application?

From Deanna Earley <dee@earlsoft.co.uk>
Newsgroups comp.lang.basic.visual.misc
Subject Re: how do you read in an integer in a console application?
Date 2015-02-11 15:24 +0000
Organization Aioe.org NNTP Server
Message-ID <mbfsbo$jh8$1@speranza.aioe.org> (permalink)
References <b7f784f4-00a0-47ce-8874-72e236ec1735@googlegroups.com>

Show all headers | View raw


On 11/02/2015 14:13, gdotone@gmail.com wrote:
> i don't know the syntax for visual basic:
>
> prompt user to enter number1
> read in number1
> prompt user to enter number2
> read in number2
>
> so.
>
> Dim number1 As Integer
> Dim number2 As Integer
>
> Dim Sum As Integer
>
> Console.WriteLine("Enter first number: ")
> 'what is the command to read in a number for console application
>
>   Console.WriteLine("Enter second number: ")
> 'what is the command to read in a number for console application
>
> sum = number1 + number2
>
> 'what is the command to display the sum for console application
> Console.WriteLine( sum )
>
> thanks, i trying to learn vb

Assuming you mean VB.NET, try Console.ReadLine() and Integer.Parse()

-- 
Deanna Earley (dee@earlsoft.co.uk, dee@doesnotcompute.co.uk)

(Replies direct to my email address will be printed, shredded then fed 
to the rats. Please reply to the group.)

Back to comp.lang.basic.visual.misc | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

how do you read in an integer in a console application? gdotone@gmail.com - 2015-02-11 06:13 -0800
  Re: how do you read in an integer in a console application? G G <gdotone@gmail.com> - 2015-02-11 07:13 -0800
  Re: how do you read in an integer in a console application? Deanna Earley <dee@earlsoft.co.uk> - 2015-02-11 15:24 +0000
    Re: how do you read in an integer in a console application? G G <gdotone@gmail.com> - 2015-02-11 19:23 -0800
      Re: how do you read in an integer in a console application? G G <gdotone@gmail.com> - 2015-02-11 19:28 -0800

csiph-web