[RESOLVED] choose smaller number from an array always "0"
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: [RESOLVED] choose smaller number from an array always "0"

  1. #1
    Join Date
    Nov 2013

    [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
                Case "D4"
                    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
                    Next i
                    highDie = CountArrayHigh(0)
                    lowDie = CountArrayLow(0)

  2. #2
    Join Date
    Nov 2013

    Re: choose smaller number from an array always "0"

    Never mind :-) figured it out.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

This a Codeguru.com survey!

On-Demand Webinars (sponsored)