Novità

Aiuto x uno script

bonalele

Junior Member
Buonasera a tutti avrei bisogno di qualche bravo programmatore per un quesito legato a un mio script. Io sono molto scarso a programmare e voorei se possibile un consiglio da Voi.
Come faccio in un listato a dire di eseguire una condizione If oppure un'altra condizione if:

Condizione 1
If Distanza(b,c) = 30 And Decina(b) = Decina(d) Then
e = Fuori90(d + 30)
If Fuori90(c + 30) = b Then
f = Fuori90(c + 60)
Else
f = Fuori90(c + 30)
End If
End If

Condizione 2
If Distanza(b,c) = 30 And Decina(c) = Decina(a) Then
e = Fuori90(a + 30)
If Fuori90(c + 30) = b Then
f = Fuori90(c + 60)
Else
f = Fuori90(c + 30)
End If
End If

Come faccio a far fare al programma entrambe le condizioni, perchè così come scritto non ne fa neanche una
Spero di essermi spiegato, grazie mille x le Vs risposte o suggerimenti

Raffaele
 
Buonasera a tutti avrei bisogno di qualche bravo programmatore per un quesito legato a un mio script. Io sono molto scarso a programmare e voorei se possibile un consiglio da Voi.
Come faccio in un listato a dire di eseguire una condizione If oppure un'altra condizione if:

Condizione 1
If Distanza(b,c) = 30 And Decina(b) = Decina(d) Then
e = Fuori90(d + 30)
If Fuori90(c + 30) = b Then
f = Fuori90(c + 60)
Else
f = Fuori90(c + 30)
End If
End If

Condizione 2
If Distanza(b,c) = 30 And Decina(c) = Decina(a) Then
e = Fuori90(a + 30)
If Fuori90(c + 30) = b Then
f = Fuori90(c + 60)
Else
f = Fuori90(c + 30)
End If
End If

Come faccio a far fare al programma entrambe le condizioni, perchè così come scritto non ne fa neanche una
Spero di essermi spiegato, grazie mille x le Vs risposte o suggerimenti

Raffaele
Ciao a Tutti

Le condizioni sono uguali per tutti e due gli esempi, quindi mi sembra inutili ripeterli
Ho modificato un mio script, ho tolto tutti i calcoli e ho messo le tue 2 condizioni
naturalmente come ho già detto togliendo una parte delle condizioni, perché doppi
però ho cambiato nome alle variabili della tua seconda condizione di esempio,
naturalmente solo le variabili di risposta.
Ho segnalato dove ho messo le tue condizioni
poi ho aggiunto SCRIVI, anche per vedere cosa restituisce

Codice:
Option Explicit
Sub Main
   Dim FIn,Ini,A,B,C,D,E,F,G,H,Es,Z
   Dim R1,R2,P1,P2,P3,P4,P5,P6,E1,E2,Caso,Casi
   FIn = EstrazioneFin
   Ini = CInt(InputBox("Inserisci l'estrazione che vuoi iniziare",,10690))
   Call ScegliRange(Ini,FIn,Ini,FIn)
   For Es = Ini To FIn
      Messaggio Es
      AvanzamentoElab Ini,FIn,Es
      Caso = 0
      For R1 = 1 To 9
         For P1 = 1 To 4
            For P2 = P1 + 1 To 5
               A = Estratto(Es,R1,P1)
               B = Estratto(Es,R1,P2)
               For R2 = R1 + 1 To 10
                  For P3 = 1 To 4
                     For P4 = P3 + 1 To 5
                        C = Estratto(Es,R2,P3)
                        D = Estratto(Es,R2,P4)
                        If A > 0 And C > 0 Then
                           If A <> C And A <> D And B <> C And B <> D Then
                              'A--B
                              '|  |
                              'C--D
                              'LE TUE CONDIZIONI ****************************************
                              If Distanza(B,C) = 30 And Decina(B) = Decina(D) Then
                                 E = Fuori90(D + 30)
                                 G = Fuori90(A + 30)
                                 If Fuori90(C + 30) = B Then
                                    F = Fuori90(C + 60)
                                    H = Fuori90(C + 30)
                                 Else
                                    F = Fuori90(C + 30)
                                    H = Fuori90(C + 30)
                                 End If
                                 'FINE DELLE CONDIZIONI ***********************************
                                 '----------------------------------
                                 Caso = Caso + 1
                                 Casi = Casi + 1
                                 Scrivi String(89,"*") & " Casi Totali " & FormattaStringa(Casi,"0000"),1,,,2
                                 Scrivi String(80,"*") & " Estrazione " &(Es) & " caso " & FormattaStringa(Caso,"0000"),1,,,1
                                 Scrivi(" Estrazione n." & Format2(Es) & " del " & DataEstrazione(Es)),1,0
                                 Scrivi "  " & SiglaRuota(R1) & " ",1,0
                                 For P5 = 1 To 5
                                    E1 = Estratto(Es,R1,P5)
                                    If E1 = A Or E1 = B Then
                                       ColoreTesto 2
                                    Else
                                       ColoreTesto 0
                                    End If
                                    Scrivi Format2(E1) & " ",1,0
                                    ColoreTesto 0
                                 Next
                                 Scrivi
                                 Scrivi(" Estrazione n." & Format2(Es) & " del " & DataEstrazione(Es)),1,0
                                 Scrivi "  " & SiglaRuota(R2) & " ",1,0
                                 For P6 = 1 To 5
                                    E2 = Estratto(Es,R2,P6)
                                    If E2 = C Or E2 = D Then
                                       ColoreTesto 2
                                    Else
                                       ColoreTesto 0
                                    End If
                                    Scrivi Format2(E2) & " ",1,0
                                    ColoreTesto 0
                                 Next
                                 Scrivi
                                 Scrivi Format2(E) & " " & Format2(F)
                                 Scrivi Format2(G) & " " & Format2(H)
                              End If 'PER LE CONDIZIONI AGGIUNTE
                           End If
                        End If
                     Next
                  Next
               Next
            Next
         Next
      Next
      If ScriptInterrotto Then Exit Sub
   Next
   ScriviResoconto
End Sub
 

Ultima estrazione Lotto

  • Estrazione del lotto
    venerdì 08 agosto 2025
    Bari
    90
    36
    15
    60
    32
    Cagliari
    59
    07
    56
    33
    06
    Firenze
    72
    37
    25
    10
    18
    Genova
    08
    87
    41
    48
    71
    Milano
    86
    33
    82
    27
    34
    Napoli
    86
    09
    60
    05
    57
    Palermo
    53
    63
    81
    88
    13
    Roma
    56
    51
    65
    35
    90
    Torino
    10
    84
    77
    28
    18
    Venezia
    26
    33
    67
    35
    81
    Nazionale
    07
    54
    46
    08
    34
    Estrazione Simbolotto
    Nazionale
    37
    28
    42
    02
    26
Indietro
Alto