Recently I was asked at an interview like this. When two parameters say a,b with specific values are defined in action1 and in action2 need to use those values in c say c=a+b. How do you do that in scriptting

Questions by indhiroh   answers by indhiroh

Showing Answers 1 - 4 of 4 Answers

sureshkumar

  • Mar 6th, 2007
 

 action1
dim a,b
parameter("a")=10
parameter("b")=20

action 2
dim c
c=parameter("a")+parameter("b")
msgbox c

 action1
After writing this actions in action1 write output parameters a& b
Navigation
step menu->Action properties->declare out put parameters
action 2
write  input parameters a&b
Navigation
step menu->Action properties->declare input  parameters

After that select keyword view
select action1->right click->select action call properties->specify variables in "store in" for a * b
selcect action2->right click->select action call properties->specify same variables in "value" for a & b
press f5
c=30

  Was this answer useful?  Yes

sri

  • Mar 8th, 2007
 

Hi Suresh,

It was really good.
Everythng is clear.
still I am unable to execute this exactly.

when i am executing action1,showing empty boxes(i used msgbox for a n b).
when i am executing action2 it is showing error message like invalid statement c=parameter("a")+parameter("b").

It is asking where are a & b.
could you please clarify this.

Thanks,
Sri.

  Was this answer useful?  Yes

Bharani M

  • Mar 19th, 2007
 

Action1(output parameter a,b with type NUMBER)
dim a,b
parameter("a")=10
parameter("b")=20
call to new action

RunAction "Action2", oneIteration,parameter("a"),parameter("b")

Action2(input parameter a,b with type NUMBER)
dim c
c=parameter("a")+parameter("b")
msgbox c


F5,gives u the output




 

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions