Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How can we return a value from User Defined Function ?
For Eg. we have 2 functions. In Fun1 i am getting 2 values
(a,b) and i am addding those 2 and storing in to another var
(c). Now i want to pass that var(c) to another function
(fun2). What will be the script?

Answers were Sorted based on User's Feedback



How can we return a value from User Defined Function ? For Eg. we have 2 functions. In Fun1 i am ge..

Answer / chivukula.kumar

'Try this Code in Only MS-Excel

'After opened should be press Alt+F11
'select and double click the ThisWoorkbook in VBA Project
leftside of application
' paste this code in that

Private Sub Workbook_Open()
Call add(1000, 20000, c)
Call subb(c, 20000)
End Sub

'Creation of Fun1 and Fun2(add and subb)

Function add(a, b, c)
a = a + b
c = a
MsgBox c
End Function

Function subb(c, d)
sb = c - d
MsgBox sb
End Function

Is This Answer Correct ?    10 Yes 3 No

How can we return a value from User Defined Function ? For Eg. we have 2 functions. In Fun1 i am ge..

Answer / sangee

Call add(40,20,c)
Call subs(c,10)
Function add(a,b,c)
c=a+b
msgbox c
End Function

Function subs(c,d)
e=c*d
msgbox e
End Function

Is This Answer Correct ?    6 Yes 2 No

How can we return a value from User Defined Function ? For Eg. we have 2 functions. In Fun1 i am ge..

Answer / siri

'vbscript
dim a:a=20
dim b:b=30
dim d
d=add(a,b)
call subtract(d)

function add(a,b)
dim c
c=a+b
add=c
end function
function subtract(d)
dim f:f=10
dim e
e=d-f
msgbox e
end function

Is This Answer Correct ?    6 Yes 3 No

How can we return a value from User Defined Function ? For Eg. we have 2 functions. In Fun1 i am ge..

Answer / siri

'vbscript
'create two functions
dim a,b,d
a=20,b=30
dim c
d=add(a,b)
msgbox d
call subtract(d)

function add(a,b)
dim c
c=a+b
add=c 'add is the function name:this statetment can
return c value
end function

function subtract(c)
dim f,e
f=20
e=d-c
msgbox e
End function

Is This Answer Correct ?    6 Yes 5 No

How can we return a value from User Defined Function ? For Eg. we have 2 functions. In Fun1 i am ge..

Answer / varun

dim a,b,c
fun1 a,b,c
fun2 c
msgbox("done")

sub fun1(a,b,c)
a = cint(inputbox("first number"))
b = cint(inputbox("second number"))
c = a + b
End sub

sub fun2(c)
msgbox(c)
end sub

Is This Answer Correct ?    2 Yes 1 No

How can we return a value from User Defined Function ? For Eg. we have 2 functions. In Fun1 i am ge..

Answer / saahasikan

Please tell me how to write and call functions in classic ASP

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More VB Script Interview Questions

Hi I am having one folder with set of text files now i want to read and write that text files data into QTP. Any help plsss.

1 Answers  


write a program to display configuration of a local system with the help of vb script.

0 Answers  


Create a file system object to do the following i. Create a folder ii. Create a text file in the folder iii. Update text file with some tex

2 Answers  


Differentiate javascript and vbscript?

0 Answers  


How to return only alpha bate string from an string str = "bibhu@#$%&das&*)(SUndar"

4 Answers   Cap Gemini,


What is Procedure or Subroutine in VB Script?

0 Answers  


Explain about the extension .hta?

0 Answers  


Write a program to display the numbers in the below format using for loops? 1 2 3 4 5 6 7 8 9 10 11 12 and Write a program to display the numbers in the below format using for loops. 1 2 3 4 5 6 7 8 9 10

2 Answers  


Explain the tristate constants in vbscript?

0 Answers  


How to insert snapshot during manual scripting in QTP?

1 Answers  


How to get the background color of a weblist?

3 Answers   Accenture,


Explain the string concatenation function in vbscript?

0 Answers  


Categories