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 .inc file consists in silk?

3 Answers  


How record a test case into a testplan automatically?

0 Answers  


Is there any way of passing values at runtime? Like scanf does in C.

0 Answers  


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

0 Answers  


hai iam not working.iam try to job.on practice i have dout .HOW TO TEST THE CALCULATOR BY USING DATA DRIVEN.PLS REPLY WITH CODE.I HAVE NO IDEA ON DATA DRIVEN.

2 Answers   Aricent, Cincom,






What is the dom browser extension?

0 Answers  


What is custom object .what it contains. Difference between custom & standard objects.

3 Answers  


How to define new testplan attributes?

0 Answers  


What is silktest project?

0 Answers  


What is the segue testing methodology?

0 Answers  


What is Silktest?

4 Answers  


What is stored in a test frame?

0 Answers  


Categories