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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Return Values from a procedure

Status
Not open for further replies.

Rich75

Technical User
Jun 13, 2003
22
0
0
GB
Hi i am trying to use a function and return a value from
but for some reason it doesnt work.

s = ReturnVal(7)
Msgbox s 'This Message Box returns Null
Function ReturnVal(n)
i = n
Do While n < 10
n = n + 1
s = s + 1
Loop
Msgbox s 'This Message Box returns 3
end Function
 
Try this:
Code:
s = ReturnVal(7)
Msgbox s 'This Message Box returns Null
Function ReturnVal(n)
i = n
Do While n < 10
   n = n + 1
   s = s + 1
Loop
Msgbox s 'This Message Box returns 3
ReturnVal=s
end Function


Hope This Help
PH.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top