Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple question.. (Returning a value)...

Status
Not open for further replies.

klibby

Programmer
May 30, 2001
51
0
0
US
ok, i know i have some code i made with something like this somewhere but i cant seem to find it.....

How do i make a subroutine return a value, like say you send information into it and have it spit out something else without having to take extra memory storing it in an extra variable...

for example, say you have a variable "blah" that equals "something"

so blah = "something"

and you use...

newnumber = system(blah)


and you have a subroutine called system that takes blah and says something like...

if blah = "something" then
(return a value of 5)
end if

so newnumber would equal 5
 
Nevermind, theres that code! hehe answered my own question..

but if by some chance somebody else has the same question.. it would be

Function Some_Stupid_Function(input as string) as integer
Some_Stupid_Function = input + 1
end function


that way if you used...
blah = Some_weird_function(1)

blah would equal 2
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top