Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

Is it possible to increment an array?

$
0
0
I have been learning VB at college and for my most recent assignment, I over-estimated my abilities somewhat. Most of the problems, I have been able to overcome however there are a couple I cannot seem to find the solution to.

The task was to create a program that waiters can use to take orders from a pizza shop, I had chosen to use multiple forms and arrays to allow for a better looking interface and for multiple pizzas.

The problem arises when a value is assigned to one of the arrays.

Code:

     
If chkboxCheese.Checked Then
            Class1.arrAdditionalToppings(0) = Class1.arrAdditionalToppings(0) & "Cheese, "
            Class1.varCost = Class1.varCost + 0.5
            Class1.varCurrentCost = Class1.varCurrentCost + 0.5
End If

After the program is nearing the end, it will give the user an options to add another pizza to the order. I then need a way to increment
Class1.arrAdditionalToppings(0) up to,
Class1.arrAdditionalToppings(1)

Is this possible?

Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>