Hi,

I have a scenario where in I had to sort an array, find duplicates and increment one or the other by 1.
So, Eg: An array has 22, 23, 21, 21, 24 within it then, an array should be able to find 21 and increment it by 1 i.e. 22. Also, on the other hand, it should now go scanning from the start and find 22 already present and increment that by 1. So, far had managed to sort an array which is just a part of the entire project.
Anyone too good in VBscript, please?

Recommended Answers

VBscript to find duplicates within an array and increment it by 1

I am not familiar with VB.

I think you should have post this in VB section.

Unless you want Javascript being part of VB?

I don't feel you need to Javasript to do this.

You can …

Jump to Post

All 2 Replies

Hi,

I have a scenario where in I had to sort an array, find duplicates and increment one or the other by 1.
So, Eg: An array has 22, 23, 21, 21, 24 within it then, an array should be able to find 21 and increment it by 1 i.e. 22. Also, on the other hand, it should now go scanning from the start and find 22 already present and increment that by 1. So, far had managed to sort an array which is just a part of the entire project.
Anyone too good in VBscript, please?

Will you excuse my french,
if I say that your algorithm/"scenario" is very dumb - regardless of the language you'll victimize with it?

That's a 'clever' never-ending task you've come up with.
The programming world calls it an infinite loop!
And an infinite loop is "bad for ya"...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.