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
How to assign a date value to a variable?
hi all, i had a question, that how to find out hiding a coloumn in a table i had a table having the following column names NAME DESCRIPTION CREATED TIME CREATED USER if i right clicked on a NAME column it will displays a menu having the same column names in a list like NAME DESCRIPTION CREATED TIME CREATED USER with check boxes.if i unched any check box, that column name should not be appear in the main table column names could anyone please solve this problem?
How to Convert Hex color code to color name in VB Script?
What are subprocedures in vbscript?
What is sql loader? Explain the files used by sql loader to load file?
Can u describe what kind of testing are for OTC derivates by banks.
Mention the environments where vbscript could be run?
Which in-built functions are used to convert the specified expression in the form of date and string in the vbscript language?
What are the naming conventions while declaring a variable in the vbscript language?
Which operator is used to perform the comparison among 2 operands in the vbscript language?
How can you create a file object to work with the files in the vbscript language?
1. How to handle object implementation change in DP for Ex: i have login page with username,pasword (editboxes),login,cancel(buttons). Here i written DP code for login page with the help properties. My questions: 1.If properites are changing dynamically i will do (i want code for that) 2.if objects are changed dynamcally i will do (i wnat code for that)
Mention what is vbscript?
when we use filter funtiom invb script(QTP)
I need to get some data from data base and store this
(retrieved) data in a excel sheet using VB script in QTP9.0
I have created connection for data base
I have created as excels sheet by using
Set XL=CreateObject("Excel.Application")
XLworksheet.cells(1,1).value= rs.fields.item("<