Friday, September 30, 2011

Input/Out put Parameters:

Input/Out put Parameters:

One can pass number of values in to the function while calling and a function can return only one value.

Example:

Function add(a,b) Main program
Res= a+b Add(10,20)
Add= res Msg box var
End function



Input/Output parameters concept is used for passing some values in to the action to return some values once the execution is finish
To do the same one has to declare the desired number of input parameters and out put parameters at the action, which is about to be called

Navigation:
• Activate the menu item test
• Select the option action properties
• Select the parameters tab
• Declare the desired number of input/output parameters
• Using the corresponding add buttons
• Click on OK

Exmaple:
vbwindow("Form1").VbEdit ("val1").set parameter ("a")
vbwindow("Form1").VbEdit("val2").Set parameter ("b")
vbwindow("Form1").VbButton("ADD").Click
var= vbwindow("Form1").VbEdit("res").GetROProperty "text"
parameter ("c")= var
vbwindow("Form1").Vbbutton("SUB").Click
var1=vbwindow("Form1").VbEdit("res").GetROProperty "textA"
parameter ("d")=var1
vbwindow("Form1").VbButton("CLEAR").Click

At the calling point one need to specify the input values in a sequence separated by commas and the variable names in a sequence in order to catch the return value

Example:Take the new test

Run action "action1[inout122]", one iteration,20,30,r1,r2
msg box r1
msg box r2

No comments:

Post a Comment