Minhajul Shaoun replied to san san
23-Sep-08 05:25 PM
Hello,
I am writing a code so that you can understand. Through this code we will determine whether a number is greater that 5 or not. We will pass number into the function. The function will return "Successfull" if our passed number is greater than 5.
'Code begins here
sub determine()
Dim str as string
str = determineresult(7)
msgbox (str)
end sub
Function determineresult (num1 as integer)
dim returnresult as string
if num1>5 then
returnresult="Successfull"
else
returnresult="Unsuccessfull"
End if
Retrun returnresult
End Function
'Code ends here
So, if the provided number is greater than 5 then the function will return a string value "Successfull". That value is not a function. That is only string variable. But it is rate to return string value from a function. The most common return value is Boolean.