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
Mention how to access array data?
How will you compare two strings in vbscript?
Write a function for Instr(). We need to write a function that works as same as Instr(). Code or Even pseudo code is good enough for me.?
What are the data types supported by vbscript?
How to make professional test report using vbscript code in UFT, which gives us complete analysis of the test.
Mention if qtp generates vbscript code as we record actions, can't it possible to directly write using vbscript code when qtp does the same thing too?
write any ttest cases using check points and parameterization
Explain the operator precedence in vb script?
How to identify column in VSFlexgrid? My VSFlexgrid window is identified as 'Active X Control'
what is diff between static and dynaic arrys?
Compare java script and vb script?
Explain vbscript in detail?
How will you release the memory acquired by an array variable in vbscript?
Mention what is select case statement?
When to use function procedures and what are its characteristics?