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
Hi Ganesh,
I will try for this. Thank u for sending responce once
again.
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / 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 |
I don't think so Ganesh because, The same i said in the
interview, then the Interviewr said it is wrong we can not
decalre the function directly like function fun(disp).
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / ganesh
Hi Mr. Krishna,
I worked on this code.
its working right ??
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / ramesh
Hi Ganesh/Krishna,
Can you try it out the below one.
function add(out c)
{
c=a+b
add(c)
}
dis=add(c)
function len(dis)
{
count=length(dis)
}
Is This Answer Correct ? | 0 Yes | 1 No |
How can Loading video files in AS3?
What is a Scripting Language?
how can i get two different fonts in a single line
What is URL Loader.?
how do i compose the text message in the yahoomail using descriptive programming in QTP?
'IMP' is not recognized as an internal or external command, operable program or batch file. this is the error message i am getting when i importing dmp for the backup. where is the problem?
what is Eventflow.?
How to Communicate with JavaScript?
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
How can you convert QTP 8.2 scripts to QTP 9.2. Please give some inputs ASAP.
which is best institute for flex and actionscript in hyderabad
If we add regular expressions to a script recorded in QTP, will it effect the performance of the script?