Ask Experts Questions for FREE Help !
Ask
    Y_Nessi's Avatar
    Y_Nessi Posts: 9, Reputation: 1
    New Member
     
    #1

    Sep 21, 2011, 07:24 AM
    Please, help me to edit my code
    Option Explicit
    Dim lbl1, lbl2, lbl3
    Private Sub cmdStart_Click()
    Static I, ii, iii, win
    Static f As Integer
    Dim rd As Integer
    Static Pos As Integer
    If cmdStart.Caption = "Start" Then
    cmdStart.Caption = "Stop"
    Randomize
    Do
    rd = Int(Rnd * 10)
    lblDigit.Caption = rd
    lblDigit.Refresh
    DoEvents
    If f = 1 Then
    f = 0
    Exit Do
    End If
    Loop While True
    Else
    f = 1
    cmdStart.Caption = "Start"
    If Pos = 0 Then
    cmdStart.Left = txtPII.Left
    txtPI.Text = lblDigit.Caption
    I = txtPI.Text
    Pos = 1
    ElseIf Pos = 1 Then
    cmdStart.Left = txtPIII.Left
    txtPII.Text = lblDigit.Caption
    ii = txtPII.Text
    Pos = 2
    Else
    cmdStart.Left = txtPI.Left
    txtPIII.Text = lblDigit.Caption
    iii = txtPIII.Text
    lbl1 = lblplayerI
    lbl2 = lblplayerII
    lbl3 = lblplayerIII
    If I > ii Then
    If I > iii Then
    win = I
    MsgBox " The winner is " & lbl1 & " = " & win, vbInformation, "Information"
    ElseIf I < iii Then
    win = iii
    MsgBox " The winner is " & lbl3 & " = " & win, vbInformation, "Information"
    Else
    win = I
    MsgBox " The winner is " & lbl1 & " and " & lbl3 & " = " & win & " are the winners" & vbInformation, "Information"
    End If
    ElseIf I < ii Then
    If ii > iii Then
    win = ii
    MsgBox " The winner is " & lbl2 & " = " & win, vbInformation, "Information"
    ElseIf ii < iii Then
    win = iii
    MsgBox " The winner is " & lbl3 & " = " & win, vbInformation, "Information"
    Else
    win = ii
    MsgBox " The winner is " & lbl2 & " and " & lbl3 & " = " & win & " are the winners" & vbInformation, "Information"
    End If
    ElseIf I = ii Then
    If I > iii Then
    win = I
    MsgBox " The winner is " & lbl1 & " = " & win, vbInformation, "Information"
    ElseIf I < iii Then
    win = iii
    MsgBox " The winner is " & lbl3 & " = " & win, vbInformation, "Information"
    Else
    win = I
    MsgBox " The winner is " & lbl1 & lbl2 & "," & " and " & lbl3 & " = " & win & " are the winners " & vbInformation, "Information"
    End If
    End If
    Pos = 0
    End If
    End If
    End Sub
    Curlyben's Avatar
    Curlyben Posts: 18,514, Reputation: 1860
    BossMan
     
    #2

    Sep 21, 2011, 07:31 AM
    It would help if you could explain what you are trying to achieve here.
    Y_Nessi's Avatar
    Y_Nessi Posts: 9, Reputation: 1
    New Member
     
    #3

    Sep 21, 2011, 07:41 AM
    It will be error if I run and result for 2 numbers are equal.

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

Need code to unlock radio 2000 mitibushi galant es showing code on face [ 0 Answers ]

Can anyone help need code to unlock radio 2000 mitisubishi galant es face just reads code

My carrier furnace LED light is flashing a code. How do I tell what code it is? [ 1 Answers ]

The error code is flashing and I know certain lengths, long and short indicate a code but how do I tell which one it is?

Write pseudo code reads in course information that includes class code, three digit s [ 1 Answers ]

Design a flowchart or pseudocode for a program that accepts rental contract data and displays a completed rental contract ready for a customer’s signature. Accept the following as input: Contract number Customer’s first and last names Automobile’s vehicle identification number Starting date...

Does the Uniform Commercial Code supersede Maryland Annotated Code? [ 1 Answers ]

If the Uniform Commercial Code, ection 2-725 states there is a 4-year statute of limitations and the Annotated Code of Maryland, Courts and Judicial Proceedings Article, Section 5-101 states there is a 3 year statute of limitations, which was has precidence?


View more questions Search