Can a function return a dictionary object?

Answers were Sorted based on User's Feedback



Can a function return a dictionary object?..

Answer / uday kumar _ anem

Yes.

Functions can return a dictonary object.

Dim dicObj
Set dicObj = CreateObject("Scripting.Dictionary")

Set obj=getname
MsgBox(obj.item("name"))


Public Function getname()
dicObj.add "name","Uday Kumar"
Set getname=dicObj
End function

Is This Answer Correct ?    17 Yes 3 No

Can a function return a dictionary object?..

Answer / parag barjatiya

Public Sub GetValue()
Set obj = getname
MsgBox (obj.Item("name"))
End Sub

Public Function getname()
Dim dicObj
Set dicObj = CreateObject("Scripting.Dictionary")
dicObj.Add "name", "Uday Kumar"
Set getname = dicObj
End Function

Is This Answer Correct ?    6 Yes 0 No

Post New Answer

More QTP Interview Questions

Hi All, I am a beginner in QTP and have understood the basics of QTP by going through tutorial. I am trying to Automate a HRMIS application, What is the right approach to Automate this application. Kindly answer. Thanks in advance

1 Answers  


w is configaration management

3 Answers   TCS,


Hi, When iam trying to import sheet to the QTP Global data table at the run time using the Importsheet method.It is able to import the sheet but no data is present after the import due to which the test is failing.Could anyone suggest what should be done. When I open the actual excel sheet data is present and is not corrupted.

2 Answers  


What is the difference between CVS and VSS? Are you store QTP SCRIPT In VSS OR CVS? Where you store QTP Script?

1 Answers   Brain Roots, Ordain Solutions,


Inserting a Call to Action is not importing all columns in Datatable of globalsheet. Why?

1 Answers   Crea,


What are the different attributes used with regular expression?

0 Answers  


Hi, is it possible for recording shortcut key during record session? The application on which I am working is web based application. This application has several shortcut key associated with menu option. I have succesfully recorded all menu option but unable to record shortcut key.

1 Answers  


what are the challenges do we face while testing webbased applcations using the automation tool QTP or any?

4 Answers   BirlaSoft,


How is the Bitmap checkpoint different from Image checkpoint?

0 Answers  


A web Page has 2 frames. Find out the number of weblist items in the second frame of the page.

2 Answers   Virtusa,


HOW TO DO THE BATCH TESTING USING QTP?

8 Answers   CTS,


How to add synchronisation points in qtp?

0 Answers  


Categories