Where do i store output data from module?

As the title says.

Lets say i have this module:

public sub answer(byval number as integer)
number = number + 1
end sub

I want to make something as

if answer = 5 then
'do something
end if

Hope i was clear and you can help

(This is Visual basic.net, dont know if that category exist, so i put it in vbs category)
XabdullahXAsked:
Who is Participating?
 
srikanthreddyn143Connect With a Mentor Commented:
Make 'thing' Public variable and keep it as global variable

Now you can access 'think'
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
> Zones:
>Visual Basic Programming, Microsoft Visual Basic.Net

so, all is right...


in regards to the question, where is the problem:

public sub answer(byval number as integer)
  number = number + 1
 
 if answer = 5 then
  'do something
 end if
 
end sub

Open in new window

0
 
XabdullahXAuthor Commented:
This code should be in the module1.vb
public sub answer(byval number as integer)
  number = number + 1


My question is, how do i use this:

 if answer = 5 then
  'do something
 end if

on my form1 ?
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
>on my form1 ?
hmmm, can you explain that?

0
 
XabdullahXAuthor Commented:
I made a simple example:

Here is the picture:

http://i.arcadeskillz.com/pics/Unavngivet417.JPG
0
 
XabdullahXAuthor Commented:
Nice thx
0
 
srikanthreddyn143Commented:
XabdullahX, why B Grade?
0
 
XabdullahXAuthor Commented:
Because you dont tell me the exact code, only what to do, so i googled public variables a bit and found the solution :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.