November 29th, 2013, 12:15 PM
[RESOLVED] choose smaller number from an array always "0"
I am writing a dice roller program with VB 2010 express that rolls many different types of dice and up to 15 of each type. I currently have 4 options on for the program. Choose how many dice, Choose how many sides on dice, Choose only the highest roll and choose only the lowest roll. Everything seems to be working as intended with the exception of the "Use lowest Die" code. If anyone can please point me into the right direction or give me an example of how to do it better. Thanks in advance for any help
Dim DiceArray(frmRoller.cmbNumberofdice.Text) As Long
Dim iTemp As Integer
Dim i As Integer
Dim numofDice As Integer
Dim CountArrayHigh(100) As Integer
Dim CountArrayLow(100) As Integer
numofDice = frmRoller.cmbNumberofdice.Text
Select Case frmRoller.cmbChooseDie.Text
For i = 1 To numofDice
iTemp = D4()
DiceArray(i) = iTemp
If iTemp > CountArrayHigh(0) Then CountArrayHigh(0) = iTemp
If iTemp < CountArrayLow(0) Then CountArrayLow(0) = iTemp
highDie = CountArrayHigh(0)
lowDie = CountArrayLow(0)
November 29th, 2013, 01:10 PM
Re: choose smaller number from an array always "0"
Never mind :-) figured it out.
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!