How to Write user defined functions?

Answers were Sorted based on User's Feedback



How to Write user defined functions?..

Answer / jinsha

First we have to define the function and then we have to
call the function.
Eg:
to define a function
integer biger(integer a,integer b)
if (a>b)
return a
else
return b
save the file with .inc extension as x.inc
Now to call a function
Use x.inc
test case userfn1()
int a=10
int b=5
int c=biger(a,b)
print("{c}is greater")

Is This Answer Correct ?    2 Yes 0 No

How to Write user defined functions?..

Answer / kkamalay

Hi Padmaja,
with silktest you can write user defined functions as same
as c, c++

<returntype> <functionName> (Arguments list)
--------------
------------
statements
return

eg:1
Integer simpleAdd(Integer a, Integer b)
Integer c=0
c=a+b
return c

eg: 2

Void PrintStatement(String msg)
Print(msg)

Is This Answer Correct ?    1 Yes 0 No

How to Write user defined functions?..

Answer / suresh

USER defined function can be written as we write them in C/
the syntax:
return type functionname(list of arguments)
]//@@@@@@@@
simple example
//@@@@@@@@@@

int sum(int a ,int b)
int sum
sum=a+b
return sum

Is This Answer Correct ?    3 Yes 3 No

Post New Answer

More Silk Test Interview Questions

what is silk testing?

1 Answers  


How to Write user defined functions?

3 Answers  


Want to lear from basic about silktest and how to write scripts. Please let me know if you know any website

0 Answers  


How to run all test cases in a testplan?

0 Answers  


What is defaultbasestate?

0 Answers  


What is the advantage of using do except instead of other error logging functions?

2 Answers   IBM,


what is the operator for carriage return(Enter) in Silk Test for File.

3 Answers  


What are the problems you faced while identifying an object in silk?

0 Answers  


why silk test sees each objects as custom windows?

1 Answers   BMC,


Is there any way to retrieve content of the image i.e If image contains text... how to retrieve in silk test In QTP there is GetVisibleText is there any function similar to this in silktest...

3 Answers   AppLabs, HCL,


Any tools to test the performance of SQL Quarries and SP? If any one are using them please provide the site names or software names...

1 Answers   IBM,


What statement in for test is used to transfer control of the script out of the innermost nested for, for each, while switch or selected statement?

1 Answers   IBM,


Categories