How to return a value from function...?
you should not tell msgbox, print.. etc.,
Answer Posted / vgr
Dim StrFunVal
StrFunVal = fn_MyFunction(7)
Function fn_MyFunction(Num)
fn_MyFunction=Num+8
End Function
During the execution the "StrFunVal" variable will contain
the value 15. If you don't want to use 'Msgbox' or 'Print'
then declaring a variable is prefered.
For your other question I haven't come across returning
more than 1 value from functions. Probably we have to use a
ARRAY kind of stuff...but not sure. Need to work on it.
Cheers,
VGR
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
create a form to accept username and password validate the username and password with using message box, display the corresponding user message
I have an excel sheet with multiple ID's in a column. Now i need fetch those ID's in an application and check whether if it already exist in the DB. If not then i have to go with the process of inserting them in the DB. If it exists then i need to skip that ID and move to the next ID and check the same and proceed. How can i do that with for loop and if condition?
Explain a few date functions in vbscript
Anyone have qtp11.0 crack?
What is the event handling in vbscript?
Why is the use of exit do or exit for statements within loops discouraged?
what is resorceallocation
What is dictionary object in vbscript? Explain?
Explain the string concatenation function in vbscript?
Write a code to print numbers from 5 to 0?
where can i learn VB scripint ?
Explain about adodb.stream class?
How are values assigned to string type and numeric type variables?
Which event is triggered when mouse focus comes out of an element in the vbscript language?
Please let me Know regarding any material regarding VB Scripting which should be easily understandable for Beginners.