terça-feira, 16 de abril de 2013


Estrutura de repetição - For... Next


For contador = v_inicial to v_final [Step p]
   <bloco de instruções>
Next

Estrutura de repetição - While


While <condição>
   <instruções>
End While


Estrutura de repetição - Do... Loop

Do 
   <instruções>
Loop While / Until <condição>

ou 

Do While / Until <condição>
   <instruções>
Loop



Estrutura de decisão - Select Case

Select Case <expressão>

Case <lista_de_valores_1>
   <bloco_de_instruções_1>
[Case <lista_de_valores_2>
   <bloco_de_instruções_2>]
...

[Case Else
   <bloco_de_instruções_N>]
End Select

Por Exemplo:

Select Case i
            Case 1, 3, 5, 7, 8, 10, 12
                MsgBox("Esse mês tem 31 dias", vbOKOnly, "ficha01")
            Case 2
                MsgBox("Ano Bissexto", vbQuestion + vbYesNo, "ficha01")
                If   i = vbYes Then
                    MsgBox("Esse mês tem 29 dias", vbOKOnly, "ficha01")
                Else
                    MsgBox("Esse mês tem 28 dias", vbOKOnly, "ficha01")
                End If
            Case Else
                MsgBox("Esse mês tem 30 dias", vbOKOnly, "ficha01")
        End Select


Estrutura de decisão - if ...then ..


If <condição> then
     <instruções>
[Else lf <Condição> then
     <condição>]
[Else
     <Intrudoção>
End if

Por Exemplo: 

if Nota < 10 Then
    MsgBox(“Reprovado”)
Else
    MsgBox(“Aprovado”)
End if

sexta-feira, 5 de abril de 2013

Modulo 10 -> Programação orientada a objectos

Neste módulo no que diz respeito as estruturas de decisão, como por exemplo as estrutura "If...Then...[Else]" e também e estrutura "Select Case...[Else]".Achei interessante a matéria porque eu acho que as estruturas estavam esquecidas.