DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  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


Bookmarks

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


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links