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 |
'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?
can I name the build.xml with any name? if so how can I invoke ?
Difference between the SAP MDM vs IBM MDM in approach, the tools used , ease in handling/implementing.
how do invoke OS task through ANT?
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?
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 can you convert QTP 8.2 scripts to QTP 9.2. Please give some inputs ASAP.
what will this do? function show_alert value="Show User" eval("x=10; y=20; document.write(x*y)");
a="10.20.30.1" replace 1 with 45 in python using reg ex
why script is client dependant.
what we will test in functionality testing
which is best institute for flex and actionscript in hyderabad