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
a="10.20.30.1" replace 1 with 45 in python using reg ex
How can you convert QTP 8.2 scripts to QTP 9.2. Please give some inputs ASAP.
how do invoke OS task through ANT?
how do u define in ur build.xml If I need to execute a task before executing my task?
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.
why script is client dependant.
How do you insert record into scripting using siebel crm
Need a batch file or VB script to delete old (more than 90datys) roaming profiles
Hi Guys, I am very new to QTP tool , In real time environment how to test the application with this tool, 1. How to load application in QTP tool 2. How to write test script in QTP. 3. In manual testing we test login box (user id , password) how can we test this kind of testing with QTP tool with examples . Please guys put some focus on my questions , real time ecperienced answers would be appreciate, advance thanks ,please guys i am expecting ur answers as soon as posible
can I name the build.xml with any name? if so how can I invoke ?
Someone who protect my excel file, m using ms office 2007 and windows 7 operating system, pls help me, how can i unprotect sheet
Difference between the SAP MDM vs IBM MDM in approach, the tools used , ease in handling/implementing.
why do u need an ANT?
what is the Structure of an ANT file?
how can we move to the next column in excel sheet in file operation using descriptive programming inQTP?