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

In how many ways we can perform datadriven test in silk test, throgh flatfiles can we perform?

3 Answers  


what is DON in SILK?

1 Answers  


What is the dom browser extension?

0 Answers  


How to assign attribute values to test cases?

0 Answers  


what is the base class for all the classes in silk?

1 Answers   GE,






What is the syntax of ui object identifier used by dom extension?

0 Answers  


What is the Real time process for testing please tell in detain 7it is very urgent.

2 Answers  


What is stored in a test frame?

0 Answers  


Need information on how the scripts (test cases) are written for any application in silktest.

1 Answers  


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

3 Answers  


I have Silk Test 7.5 installed to my machine. My silk recoginizes all the windows applications.But its not recoginizing the web application.When i try to ENABLE EXTENSION for any web application i am not getting the window with the two radio button namely DOM and VO. What could be the problem? I also tried using browsers like IE,FF and also uninstalled the silk n reinstalled it again.But it works out with my neighbours system....Wht could be the problem?????

3 Answers   Borland, Genpact,


Can u Tell me why we use Advanced tool like Silk Test other than QTP, Or WIN RUNNER And others what is the advantage of these compared o others

4 Answers   Wipro,


Categories