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?
Answer Posted / ganesh
<script language="javascript">
function add()
{
var a=parseInt(document.getElementById('x').value);
var b=parseInt(document.getElementById('y').value);
var c= a + b;
fun(c);
}
function fun(disp)
{
alert(disp);
}
</script>
</head>
<body>
Enter First Number:<input type="text" id="x" /><br />
Enter Second Number:<input type="text" id="y" /><br />
<input type="button" value="Add" onclick="add()" />
</body>
Am i right ??
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
I have deducted tds on pay slip for employees ist month tell me how to deposit this amt to govt. by bank or any form is available fill the same and deposit the govt. department. Pls explain me which form to be used for deposit the same with due date.
How do you insert record into scripting using siebel crm
what is the Structure of an ANT file?
What is the procedure for installing USP-35 on my compure?
How applet differ from Swings in java ?
how can we move to the next column in excel sheet in file operation using descriptive programming inQTP?
Would you tell me that what is test script? and how to write it? are there some templates?
why script is client dependant.
How can you convert QTP 8.2 scripts to QTP 9.2. Please give some inputs ASAP.
If we add regular expressions to a script recorded in QTP, will it effect the performance of the script?
can I name the build.xml with any name? if so how can I invoke ?
how do invoke OS task through ANT?
why do u need an ANT?
how do u define in ur build.xml If I need to execute a task before executing my task?
In sap script, created 1 form but when its went to production system , client want some changes in 1 (ex - addrss) window, what we will do?