Hello Friends,
In this post, we will see, how to get unique/distinct values from an array.
We will do that using very useful and optimum feature of QTP - Dictionary Object.
Here is the code--
Dim objDict, oldArray, val
oldArray = Array ("11", "21", "11", "31", "21", "41", "31")
Set objDict = CreateObject("Scripting.Dictionary")
objDict.CompareMode = vbTextCompare
For each val in oldArray
objDict(val) = val
Next
newArray = objDict.Items
For i=0 to ubound(newArray)
msgbox newArray(i)
Next
...n done!!!
Plz do post your queries/comments...
In this post, we will see, how to get unique/distinct values from an array.
We will do that using very useful and optimum feature of QTP - Dictionary Object.
Here is the code--
Dim objDict, oldArray, val
oldArray = Array ("11", "21", "11", "31", "21", "41", "31")
Set objDict = CreateObject("Scripting.Dictionary")
objDict.CompareMode = vbTextCompare
For each val in oldArray
objDict(val) = val
Next
newArray = objDict.Items
For i=0 to ubound(newArray)
msgbox newArray(i)
Next
...n done!!!
Plz do post your queries/comments...
Nice Code. It is reaching our expectations without any updates
ReplyDeleteHi,
ReplyDeleteNeed small change in below part of above mentioned code...
Incorrect One :
For i=0 to ubound(newArray)
msgbox newArray(i)
Next
Correct One :
For i=0 to ubound(newArray)-1
msgbox newArray(i)
Next
objDict.CompareMode = vbTextCompare
ReplyDeletewhat did this code ?
ll it run without this?
If you do without the Comparemode = vbTextCompare then the will be VbBinaryCompare. so any time if objDict found "11" & "11" binary values are different it will take as new value and you will get "11" 2 times.
ReplyDeleteSo to avoid that any point of time tell obDict to compare text wise.
How can you get items that only appear once. Meaning "41" only in the above mentioned array?
ReplyDelete@Deepak, you're wrong Ubound returns the highest index of an array. So the code above is correct.
ReplyDeleteFor each val in oldArray
ReplyDeleteobjDict(val) = val
Next
What the above code is doing?
Iot Training in Bangalore
ReplyDeleteArtificial Intelligence Training in Bangalore
Machine Learning Training in Bangalore
Blockchain Training bangalore
Data Science Training in Bangalore
Big Data and Hadoop Training in bangalore
Devops Training in Bangalore
nice blog
ReplyDeletehadoop training in chennai
AWS Training in Bangalore - Live Online & Classroom
ReplyDeletemyTectra Amazon Web Services (AWS) certification training helps you to gain real time hands on experience on AWS. myTectra offers AWS training in Bangalore using classroom and AWS Online Training globally. AWS Training at myTectra delivered by the experienced professional who has atleast 4 years of relavent AWS experince and overall 8-15 years of IT experience. myTectra Offers AWS Training since 2013 and retained the positions of Top AWS Training Company in Bangalore and India.
IOT Training in Bangalore - Live Online & Classroom
IOT Training course observes iot as the platform for networking of different devices on the internet and their inter related communication. Reading data through the sensors and processing it with applications sitting in the cloud and thereafter passing the processed data to generate different kind of output is the motive of the complete curricula. Students are made to understand the type of input devices and communications among the devices in a wireless media.
Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.
ReplyDeleteSelenium Training in Bangalore | Selenium Training in Bangalore | Selenium Training in Bangalore | Selenium Training in Bangalore
Nice post. Thanks for sharing the valuable information. it’s really helpful. Who want to learn this blog most helpful. Keep sharing on updated posts…
ReplyDeleteData Science training in rajaji nagar | Data Science Training in Bangalore | Data Science with Python training in chennai
Data Science training in electronic city | Data Science training in USA
Data science training in pune | Data science training in kalyan nagar
Nice tutorial. Thanks for sharing the valuable information. it’s really helpful. Who want to learn this blog most helpful. Keep sharing on updated tutorials…
ReplyDeleteJava training in Chennai | Java training in Bangalore
Java online training | Java training in Pune
Nice tutorial. Thanks for sharing the valuable information. it’s really helpful. Who want to learn this blog most helpful. Keep sharing on updated tutorials…
ReplyDeleteadvanced excel training in bangalore | Devops Training in Chennai
I believe there are many more pleasurable opportunities ahead for individuals that looked at your site.
ReplyDeletepython course in pune | python course in chennai | python course in Bangalore
I am really happy with your blog because your article is very unique and powerful for new reader.
ReplyDeleteClick here:
selenium training in chennai
selenium training in bangalore
selenium training in Pune
selenium training in pune
Selenium Online Training
ReplyDeleteWhoa! I’m enjoying the template/theme of this website. It’s simple, yet effective. A lot of times it’s very hard to get that “perfect balance” between superb usability and visual appeal. I must say you’ve done a very good job with this.
AWS Training in BTM Layout |Best AWS Training in BTM Layout
AWS Training in Marathahalli | Best AWS Training in Marathahalli
Nice post. By reading your blog, i get inspired and this provides some useful information. Thank you for posting this exclusive post for our vision.
ReplyDeleteangularjs Training in btm
angularjs Training in electronic-city
angularjs online Training
angularjs Training in marathahalli
angularjs interview questions and answers
Thank you so much for posting this. I really appreciate your work. Keep it up. Great work!Best software training company with placement in Hyderabad
ReplyDeleteFor Us i and my friends too finished double degree,but most of the technical experience i have got through your blog only.
ReplyDeleteMobile phone Battery replacement in chennai | Mobile phone unlocking service in chennai | 100% genuine mobile parts | Mobile service center in chennai | Mobile service center in chennai in chennai | Mobile phone glass replacement in chennai
Your topic is very nice and helpful to us … Thank you for the information you wrote.
ReplyDeleteAuthorized ipad service center in Chennai | Authorized ipod service center in Chennai | ipad display replacement service in chennai | ipod service center in chennai | ipad battery replacement service in chennai | iphone Water damage service in chennai |
Thanks for sharing such an informative post with us. I hope you will share more such post. Please keep sharing.
ReplyDeleteApple Service center in Ameerpet, Hyderabad
Best Laptop Service center in Ameerpet, Hyderabad
This comment has been removed by the author.
ReplyDeleteSubtleties, for example, financials, business techniques, ongoing advancements, and other such key data relating to these players has been given as a feature of organization profiling. artificial intelligence training in pune
ReplyDeletethanks for Sharing such an Awesome information with us.
ReplyDeleteI learned World's Trending Technology from certified experts for free of cost.i Got job in decent Top MNC Company with handsome 14 LPA salary, i have learned the World's Trending Technology from Python training in pune experts who know advanced concepts which can helps to solve any type of Real time issues in the field of Python. Really worth trying Freelance seo expert in bangalore
Nice blog! Full of informative ideas. Thank you, keep sharing.
ReplyDeleteweb design company in chennai
Thanks for sharing information with us.This post is very attractive and useful for the users.The content provided is relevant to the topic.One can gain knowledge and have basic understanding by reading this blog.
ReplyDeletedata science training institutes in bangalore
Great Article
ReplyDeleteB.Tech Final Year Projects for CSE in Angular
Angular Training in Chennai
Project Centers in Chennai
JavaScript Training in Chennai
BA Exam Result - BA 1st Year, 2nd Year and 3rd Year Result
ReplyDeleteBsc Exam Result - Bsc 1st Year, 2nd Year and 3rd Year Result
Great Article. Thank you for sharing! Really an awesome post for every one.
ReplyDeleteProject Centers in Chennai
JavaScript Training in Chennai
Final Year Project Domains for IT
JavaScript Training in Chennai
Wow, this is really interesting reading. I am glad I found this and got to read it. Great job on this content. I like it. 111 niche blogcomments
ReplyDeleteUsually I never comment on blogs but your article is so convincing that I never stop myself to say something about it. You’re doing a great job Man, Keep it up.mobile phone repair in Novi
ReplyDeleteiphone repair in Novi
cell phone repair in Novi
phone repair in Novi
tablet repair in Novi
ipad repair in Novi
mobile phone repair Novi
iphone repair Novi
cell phone repair Novi
phone repair Novi
ReplyDeleteReally appreciate this wonderful post that you have provided for us.Great site and a great topic as well I really get amazed to read this. It's really good.
I like viewing web sites which comprehend the price of delivering the excellent useful resource free of charge. I truly adored reading your posting. Thank you!.mobile phone repair in Fredericksburg
mobile phone repair in Fredericksburg
mobile phone repair in Fredericksburg
mobile phone repair in Fredericksburg
mobile phone repair in Fredericksburg
mobile phone repair in Fredericksburg
mobile phone repair in Fredericksburg
mobile phone repair in Fredericksburg
mobile phone repair in Fredericksburg
mobile phone repair in Fredericksburg
mobile phone repair in Auburn Hills
ReplyDeleteiphone repair in Auburn Hills
cell phone repair in Auburn Hills
tablet repair in Auburn Hills
ipad repair in Auburn Hills
mobile phone repair Auburn Hills
iphone repair Auburn Hills
cell phone repair Auburn Hills
phone repair Auburn Hills
tablet repair Auburn Hills
Attend The Artificial Intelligence course From ExcelR. Practical Artificial Intelligence course Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Artificial Intelligence course.
ReplyDeleteArtificial Intelligence Course
It is perfect time to make some plans for the future and it is time to be happy. I've read this post and if I could I desire to suggest you some interesting things or suggestions. Perhaps you could write next articles referring to this article. I want to read more things about it!Your blog has very useful information about this technology which i am searching now, i am eagerly waiting to see your next post as soonI just got to this amazing site not long ago. I was actually captured with the piece of resources you have got here. Big thumbs up for making such wonderful blog page!Java training in Chennai
ReplyDeleteJava Online training in Chennai
Java Course in Chennai
Best JAVA Training Institutes in Chennai
Java training in Bangalore
Java training in Hyderabad
Java Training in Coimbatore
Java Training
Java Online Training
nice
ReplyDeleteSoftware Testing Training in Chennai | Certification | Online
Courses
Software Testing Training in Chennai
Software Testing Online Training in Chennai
Software Testing Courses in Chennai
Software Testing Training in Bangalore
Software Testing Training in Hyderabad
Software Testing Training in Coimbatore
Software Testing Training
Software Testing Online Training
Thanks for sharing information with us.This post is very attractive and useful for the users.The content provided is relevant to the topic.One can gain knowledge and have basic understanding by reading this blog.
ReplyDeleteangular js training in chennai
angular training in chennai
angular js online training in chennai
angular js training in bangalore
angular js training in hyderabad
angular js training in coimbatore
angular js training
angular js online training
ReplyDeletevery nice blogs!!! i have to learning for lot of information for this sites...Sharing for wonderful information.Thanks for sharing this valuable information to our vision. You have posted a trust worthy blog keep sharing.
Azure Training in Chennai
Azure Training in Bangalore
Azure Training in Hyderabad
Azure Training in Pune
Azure Training | microsoft azure certification | Azure Online Training Course
Azure Online Training
Excellent Blog! I would Thanks for sharing this wonderful content.its very useful to us.This is incredible,I feel really happy to have seen your webpage.I gained many unknown information, the way you have clearly explained is really fantastic.keep posting such useful information.
ReplyDeleteFull Stack Training in Chennai | Certification | Online Training Course
Full Stack Training in Bangalore | Certification | Online Training Course
Full Stack Training in Hyderabad | Certification | Online Training Course
Full Stack Developer Training in Chennai | Mean Stack Developer Training in Chennai
Full Stack Training
Full Stack Online Training
I am reading your post from the beginning, it was so interesting to read & I feel thanks to you for posting such a good blog, keep updates regularly.
ReplyDeleteDigital Marketing Training in Chennai
Digital Marketing Course in Chennai
SEO Training in Chennai
Digital Marketing Training in Bangalore
Digital Marketing Training in Hyderabad
Digital Marketing Training in Coimbatore
Digital Marketing Training
Digital Marketing Course
Digital Marketing Online Training
Really it was an awesome article...very interesting to read..You have provided an nice article....Thanks for sharing..
ReplyDeleteWeb Designing Training in Chennai
Web Designing Course in Chennai
Web Designing Training in Bangalore
Web Designing Course in Bangalore
Web Designing Training in Hyderabad
Web Designing Course in Hyderabad
Web Designing Training in Coimbatore
Web Designing Training
Web Designing Online Training
Nice post. Thanks for sharing the valuable information. it’s really helpful. Who want to learn this blog most helpful. Keep sharing on updated posts…
ReplyDeleteAWS Course in Bangalore
AWS Course in Hyderabad
AWS Course in Coimbatore
AWS Course
AWS Certification Course
AWS Certification Training
AWS Online Training
AWS Training
Such a very useful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article.
ReplyDeleteIELTS Coaching in chennai
German Classes in Chennai
GRE Coaching Classes in Chennai
TOEFL Coaching in Chennai
spoken english classes in chennai | Communication training
Am Divya,Am really impressed about this blog because this blog is very easy to learn and understand clearly.This blog is very useful for the college students and researchers to take a good notes in good manner,I gained many unknown information.
ReplyDeleteData Science Training In Chennai
Data Science Online Training In Chennai
Data Science Training In Bangalore
Data Science Training In Hyderabad
Data Science Training In Coimbatore
Data Science Training
Data Science Online Training
Interesting stuff to read. Keep it up.
ReplyDeleteAdidas showroom in madurai | Woodland showroom in madurai
Puma showroom in madurai | Crocs showroom in Madurai
Thanks for sharing such a great blog
ReplyDeleteVermicompost Manufacturers | Vermicompost Suppliers
Vermicompost in chennai | Vermicompost manufacturers in Chennai
Great survey, I'm sure you're getting a great response.
ReplyDeleteGreat post. keep sharing such a worthy information.
ReplyDeleteDOT NET Training in Chennai
Dot Net Training Online
DOT NET Training in Bangalore
Such a good post .thanks for sharing
ReplyDeleteIELTS Coaching in OMR
IELTS Coaching in Chennai
Fast-track your data analytics and machine learning course with guaranteed placement opportunities. Most extensive, industry-approved experiential learning program ideal for future Data Scientists.
ReplyDeleteGreat post. keep sharing such a worthy information.
ReplyDeleteHadoop Training in Chennai
All our top-rated websites supply excellent bonuses for an excellent begin to your online slots expertise. The games themselves all supply excessive payout percentages to provide the greatest return on 카지노사이트 your bet, and cashing out any huge win could be very simple with all popular banking options. If you’re a winner, find a way to|you possibly can} expect any funds to be in your account within hours.
ReplyDelete