can a Function return more than one value..??? if so please
give me the code for that.
Answers were Sorted based on User's Feedback
Answer / bantanahal haribabu
function exmp(a,b)
dim myarray(2)
myarray(0)=a+b
myarray(1)=a*b
exmp=myarray
end function
val=exmp(2,3)
msgbox isarray(val)
for i=o to ubound(val)
msgbox val(i)
next
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / prasad
Function alway returns one value. only action in QTP
returns more than one values.
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / siqtp
Logically Function can return pnly one value.But we can
achieve rturning multiple values using any of the following
1)Concatenate all the values to be returned to a string and
retuen it
2)Use arrays
3)Use dictionay object
4)use ByRef
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / uday kumar _ anem
Another way to handle more than one return value is using
arrays and also use global variables.
| Is This Answer Correct ? | 2 Yes | 1 No |
Answer / nath t
Function doesn't return more than one value.
if you want to get more than one result, we can write
function for that. After u will get the value u have to
split the value.
Example:
Function AddSub(a, b)
som = a + b
subt = a - b
AddSub = som&"/"&subt
End Function
this function returns only one value. But it's having two
results(i.e Addition and subtraction of two no.s).
After u will get this value. u have to split that one for
two results by using split function here delimeter is "/".
like this we can add more than one result to the return
variable(in this example AddSub is the return variable).
| Is This Answer Correct ? | 2 Yes | 5 No |
Hoe to generate all numbers in between to numbers suppose all numbers in between 1 to 100 using vbscript give me code
What is keyword driven testing..what is the use of this in Automated testing
3 differences between QTP & Winrunner?
write a script to verify the image path(src property) of the images which are in web pages.(do it by Descriptive method by creating a description object)
How to load a object repository in QTP during runtime?
2 Answers BNP Paribas, Virtusa,
What exactly a frame Work means?what are the different type of frameworks done in QTP?why the caption for QTP given as advanced keyword driven?
hi friends can anyone tell me where can i find descriptive programming material please send me the link also,from which i can download the material
How the objecs properties are identified?Tell me in Hierarchical order?
Will down time for server and content maintenance/upgrades be allowed? how much?
What is a recovery scenario?
after click on compose mail how can we attached a file in qtp with vbscript code
Now it appears to be more than enough... I have learn entire QTP, I did whatever I could do but still facing lots of problem and those problems could be removed only after working in professional atmosphere. But still unable to expose myself as professionaly. It is becoming panic, It has been two years I am in manual testing and looking for the change but all the recruiters ask for QTP, but my problem is I don't have working experience with QTP. Kindly suggest me I really need effective suggestions. I dont have more caliber to work with present organization cause of salary reasons...boo.. hooo...hooo. My email address is alkaa.dugaal@gmail.com