How to Write user defined functions?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
How to create and edit a testplan?
How to define an object verification in a test case?
What is 4test?
Where is a testplan stored?
How can i used If Else statement in Silk Test. And my table name is login how can i get rowcount in the table having
how to pass TDS intery in tally?
Why should we use Silk test .we can use QTP or other tool .What is the difference.
Define Silk Testing.
what is DON in SILK?
What is the perpose of user-defined base state method?
How can you get the moving contents of flash image using silktest.
Which tag in silk is the most reliable in a scenario where content and order of object change frequently?