Handling,Arrays,VBScript,array computer Handling Arrays in VBScript


----------------------------------------------------------Permission is granted for the below article to forward,reprint, distribute, use for ezine, newsletter, website,offer as free bonus or part of a product for sale as longas no changes a Gone are those times when the companies and the organisations didn't need a hi-tech system to handle them. Owing to the considerable increase in the business sector and thus, an enormous increase in the complexity of the organisational struc


An array is a collection of logically related data items, whereeach item can either be accessed in a sequential order, orthrough supplying its index position.Consider this:Here we declare an index of dimension 5, which later on, comes tostore six names, as, an index in an array starts at 0.Then the for loops dumps the entire array onto the HTML page.People familiar with the for() {.} loop of JavaScript will noticethat the for.next loop of VBScript is less cryptic.Since now we have learnt how to create a VBScript array, let ustry to sort this array. We'll sort the array in ascending order,that is, from the lowest to the top most in the alphabeticalarray.So what's the logic?1. Compare the first name with the second name2. If the second name is lower than the first name, then swap3. else4. Compare the first name with the third name5. If the third name is lower than the first name, then swap6. else7. Compare the first name with the fourth name8. If the fourth name is lower than the first name, then swap9. else10. Compare the first name with the fifth name11. If the fifth name is lower than the first name, then swapSo by the time we have reached the 11th step, we have the lowestname at the first position.The second round starts at the second index index, as the firstwe already know is the lowest.1. Compare the second name with the third name2. If the third name is lower than the second name, then swap3. else4. Compare the second name with the fourth nameand so onI hope you've understood the logic now. Let's see how it looksprogrammatically:There is a nested loop here. Study the flow of the for i=0 to 4loop. The outer loop holds the index of the item that will becompared with every other, next item. For instance, when thefirst cycle of the loop begins, i is zero, and when the programends the nested loop, j starts at i+1, that is, 1. So turn byturn, item at index zero is compared with every item in thearray. The outer array goes only till 4 because when the nestedloop begins, the second last item will be compared with the lastitem: j=i+1Save the file, and check it out in your browser.Now we see the use of a dynamically defined array, and how thatarray can be filled using the inputbox() function.strings is an array that is re-dimensioned whenever the usertypes in a new string. When we declare an array, we reserve thememory space for that array, that is, if we saydim arr(20)it means we are reserving the space for twenty data items. Butwhat if the user enters just five items? The rest of the space iswasted. To avoid this, we declare a dynamic array.In the above script, we have a loop whose continuance depends onthe user input. It keeps on loop until the user enters "fin". So,when "fin" is not entered, only then the dimension of the arraystrings is increased.When we are re-dimensioning an array, we have to use the keywordpreserve to preserve the existing content of the array. In itsabsence, the array gets re-dimensioned, but the values are lost.Exit do forces the program to come out of the loop if thecondition that terminates it, occurs. Article Tags: First Name Then, First Name, Second Name, Name Then

Handling,Arrays,VBScript,array

computer

Equipment Rental Software – Features And Cost

Equipment rental management software is an essential thing these days for any equipment rental company.A well-developed equipment rental software provides you with a variety of features that can really help you maintain and organise your cus ...

computer

5 Big Reasons Why I Migrated From Angularjs To React

I have 5 main reasons for my angularjs to react migration. No, it's not a comparison on which is better. A comparison between apples and oranges would make no point. React is a library, and angular is a framework. Both can do stuff in their ...

computer

How to troubleshoot McAfee error 2318?

Security software means McAfee! For many computer users, McAfee antivirus is the only choice for security software as it provides all the features and tools which are necessary for device and data protection. This robust antivirus merely sho ...

computer

Manage Multiple Counter With AlignBooks Point of Sale

Fulfilling your businesss needs which can grow your firm is our aim. AlignBooks is better known for providing a strong pillar to newly started or midway businesss. Those companies who dont want to fall back with irregularity manage the inven ...

computer

How to Autoplay Embedded YouTube Videos

Source: How to Autoplay Embedded YouTube VideosEmbedding a video or audio enables the users to share their videos with any of their preferred sites or any social networking platforms. They can do so by copying the embedded link of the parti ...

computer

3 Major Mistakes to Avoid in Retail Business

Truth be told, nearly half of the retail businesses survive longer than four years and which can be something to ponder for a newbie before stepping into the industry. However, this being said, it is also true that you can excel in the indus ...

computer

Start Your Own Computer Repair Business

1. Know your street value. In the early 90's, running a PC repair business centered around selling parts and products, with service on the side. Today, it's about selling hours. If you run a business, you need to consider the X3 rule. That m ...

computer

How Establishments Show Up in Restaurant Searches

The revolutionary rise of technology has made things easy-peasy for consumers in the restaurant industry. Unlike the old days, the availability of innumerable platforms has made it possible for diners to choose from various searching options ...

computer

GuildWars 2 :

The last expansion pack for Guild Wars 2 was Path of Fire, which was released in 2017 and brings you a new enemy-Balthazar, the evil god of war. Although this doesn't sound like another expansion pack currently in production, some fans ma ...

computer

Customer Support at the time of COVID-19 Pandemic

COVID-19 is the worst crisis of our time as we observe social distancing protocols being imposed all around the world. While these measures are a step in effectively managing the COVID-19 pandemic, Hospitality and Retail businesses are confr ...

computer

How to Choose a Contract Management Solution (CLM)?

Contract life cycle management (CLM) systems can simplify and automate contract creation, negotiation, execution and storage. They are an intelligent alternative to the tedious hand tools formerly used for these tasks, which lacked visibili ...

computer

Contacting Google Live Person to Resolve Your Issues

Users are fond of all the Google supported products and look forward to the best services. Also, Google as a whole has never disappointed its users and helped them at every point with its commendable services. Also, being a customer-oriente ...

computer

how to uninstall discord

How to Uninstall Discord in Windows 10? has supported open source technologies, our tool is secure and safe to use. To uninstall a discord from your windows, you'll use this method which is given below.USING THIRD PARTY TOOLS1. Firstly, you ...