How to return a value from function...?

you should not tell msgbox, print.. etc.,

Answer Posted / bfakruddin

Function MyFunction(Num)

MyFunction=Num+1

End Function

Num=InputBox("Enter a Number")

call MyFunction(Num)
msgbox MyFunction 'It returns Num+1 value calculated in
Function

Just we have to use the Function Name to return a value...
and we can use that value out of that function...

One more question Can we return more than 1 value from
functions?


visit for qtp info http://qtptesters.wordpress.com

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why to use option explicit in vb script?

818


what is the object hyrarchy in QTP for a web based application

2113


Mention what is the difference between vbscript and vba?

753


How do you declare a variable in vbscript?

849


How to write a VBscript for web page performance test i need a code send if any knows the code If any knows VBScript book plz send to me the link to my mail plz

2648


How to declare an array in vbscript?

912


What is vbscript?

815


Which event is triggered when mouse focus comes out of an element in the vbscript language?

730


What are the 2 ways in which a variable can be declared in the vbscript language?

818


Write a Program to add 2 numbers without using operators (+,-) and without using third variable. Note: Use VBScript only Hint: You can use other operators like '/' & '*'(Division & Multiplication)

3430


give me any information abou vb script books learn quckly

1868


Sub link() Dim k As Integer Dim rand As Integer Dim URL As String Dim foldernum As Integer Dim folderstring As String Dim filenum As Integer Dim filestring As String k = 1 'for AC Numbers For i = 11 To 40 foldernum = 0 foldernum = 1000 + i folderstring = CStr(foldernum) folderstring = Mid(folderstring, 2, 3) folder = "ac" & folderstring 'folderstring = Sheets(2).Cells(i, 1) ' for Number of Random files For j = 1 To 10 rand = Int(Rnd * (200 - 1) + 1) filenum = 0 filenum = 1000 + rand filestring = CStr(filenum) filestring = Mid(filestring, 2, 3) 'URL = "http://ceobihar.nic.in/PSCDROM/ac" & folderstring & "/i" & folderstring & "0" & filestring & ".pdf" URL = "http://www.elections.tn.gov.in/pdfs/dt1/" & folder & "/" & folder & filestring & ".pdf" ' URL =http://www.wb.nic.in/wbeco/EROLLS/PDF/English/A001/a0010105 .pdf Cells(k, 1) = folderstring Cells(k, 2) = folder Cells(k, 3) = filestring Cells(k, 3) = URL k = k + 1 Next j Next i End Sub plz define it

2512


Which operator is used to concatenate the 2 values in the vbscript language?

798


Program to use input box and send even numbers into sheet1 and odd numbers into sheet2 and prime numbers into sheet3 using vbscript(QTP)?

2832


What is event handling in vbscript?

832