Jump to content

Função 'For Each Letter04 In "ABCDEFGHIJKLMNOPQRSTUVWXYZ".ToCharArray()


BlitzMX
 Share

Recommended Posts

Boa noite

Estou a tentar criar um loop para que a cada letras de cada posição o programa me faça depois uma outra coisa, mas por agora para ver se funciona correctamente apenas pretendo que me faça um loop por cada caractere em cada letra com 4 caracteres.

Tenho este código mas, se correr linha a linha aparece a variavel associada correctamente até ao quarto caractere, quando chega o momento de mostrar... nada. Buga sem qualquer erro de compilação.

        Dim Letter04 As Char
        Dim Letter03 As Char
        Dim Letter02 As Char
        Dim Letter01 As Char



        For Each Letter04 In "ABCDEFGHIJKLMNOPQRSTUVWXYZ".ToCharArray()
            For Each Letter03 In "ABCDEFGHIJKLMNOPQRSTUVWXYZ".ToCharArray()
                For Each Letter02 In "ABCDEFGHIJKLMNOPQRSTUVWXYZ".ToCharArray()
                    For Each Letter01 In "ABCDEFGHIJKLMNOPQRSTUVWXYZ".ToCharArray()
                        lblLetter01.Text = Letter01
                        System.Threading.Thread.Sleep(5000)
                    Next
                    lblLetter02.Text = Letter02
                    System.Threading.Thread.Sleep(5000)
                Next
                lblLetter03.Text = Letter03
                System.Threading.Thread.Sleep(5000)
            Next
            lblLetter04.Text = Letter04
            System.Threading.Thread.Sleep(5000)
        Next
Link to comment
Share on other sites

Outra ideia mas as letras não mudam nada, fica parado e BUG.

        Dim Letter04 As Char
        Dim Letter03 As Char
        Dim Letter02 As Char
        Dim Letter01 As Char

        lblLetter01.Text = ""
        lblLetter02.Text = ""
        lblLetter03.Text = ""
        lblLetter04.Text = ""



        Do Until Letter01 = "Z" And Letter02 = "Z" And Letter03 = "Z" And Letter04 = "Z"
            For Each Letter04 In "ABCDEFGHIJKLMNOPQRSTUVWXYZ".ToCharArray()
                For Each Letter03 In "ABCDEFGHIJKLMNOPQRSTUVWXYZ".ToCharArray()
                    For Each Letter02 In "ABCDEFGHIJKLMNOPQRSTUVWXYZ".ToCharArray()
                        For Each Letter01 In "ABCDEFGHIJKLMNOPQRSTUVWXYZ".ToCharArray()
                            lblLetter01.Text = Letter01
                            lblLetter02.Text = Letter02
                            lblLetter03.Text = Letter03
                            lblLetter04.Text = Letter04
                            System.Threading.Thread.Sleep(5000)
                        Next
                    Next
                Next
            Next

        Loop
        MsgBox("Finished")
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.