DevX Home Today's Headlines   Articles Archive   Tip Bank   Forums

Thread: easy question for beginner without any docs

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)

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

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)

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

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

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)

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
•

 FAQ Latest Articles Java .NET XML Database Enterprise