easy question for beginner without any docs


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: easy question for beginner without any docs

  1. #1
    jm Guest

    easy question for beginner without any docs


    Hey we have some study for school to do but we can't understand how to declare
    global varial and how to calculate a sum of numbert which are negativ and
    positiv (i mean how to declare signed numbers)
    please help us quickly

  2. #2
    T. Bradley Dean Guest

    Re: easy question for beginner without any docs

    > Hey we have some study for school to do but we can't understand how to
    declare
    > global varial


    Instead of:

    Dim s as String

    Use:

    Global s As String

    >and how to calculate a sum of numbert which are negativ and
    > positiv (i mean how to declare signed numbers)
    > please help us quickly


    Are you asking how to make a variable negative? Just do:
    i = -1

    If you want a sum then:
    Sum = Num1 + Num2 + Num3



  3. #3
    Nick Guest

    Re: easy question for beginner without any docs


    "jm" <eos@hotmail.com> wrote:
    >
    >Hey we have some study for school to do but we can't understand how to declare
    >global varial and how to calculate a sum of numbert which are negativ and
    >positiv (i mean how to declare signed numbers)
    >please help us quickly


    Jm,

    To declare a global variabe use:
    Public x as Integer 'Global for project
    Private x as Integer 'Global for current module only.

    To declare a signed number: There is no such thing as an unsigned number
    in VB. All longs, integers, doubles are signed.
    Dim x as Integer
    x = -5

    To sum numbers just add them: x = a + b + c

    Nick


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center