Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
Rime - Rime.frm

Rime.frm

Caricato da: Antometal
Scarica il programma completo

  1. Option Explicit
  2.  
  3. Private Sub chkNumero_Click()
  4. txtNumero.Enabled = CBool(chkNumero.Value)
  5. End Sub
  6.  
  7. Private Sub cmdCambia_Click()
  8. On Error GoTo Errore
  9. CDialog.ShowOpen
  10. txtXCorso.Text = CDialog.FileName
  11.  
  12. Exit Sub
  13. Errore:
  14. MsgBox "Errore numero: " & Err.Number & vbCrLf & Err.Description, vbCritical
  15. txtXCorso.Text = ""
  16. End Sub
  17.  
  18. Private Sub cmdCerca_Click()
  19. On Error GoTo Errore
  20. Dim File As Integer
  21. Dim Parola As String
  22. txtRima = Replace(LCase(txtRima), " ", "")
  23.     If txtRima.Text <> "" Then
  24.         lstRime.Clear
  25.         File = FreeFile
  26.         Open txtXCorso.Text For Input As File
  27.             Do While EOF(File) = 0
  28.                 Input #File, Parola
  29.                     If CBool(chkNumero.Value) = False Then
  30.                             If optFine.Value = True And Right(Parola, Len(txtRima)) = txtRima Then lstRime.AddItem Parola
  31.                             If optFine.Value = False And Left(Parola, Len(txtRima)) = txtRima Then lstRime.AddItem Parola
  32.                     ElseIf CBool(chkNumero.Value) = True Then
  33.                             If optFine.Value = True And Right(Parola, txtNumero) = Right(txtRima, txtNumero) Then lstRime.AddItem Parola
  34.                             If optFine.Value = False And Left(Parola, txtNumero) = Left(txtRima, txtNumero) Then lstRime.AddItem Parola
  35.                     End If
  36.             Loop
  37.         Close #File
  38.         lblStato.Caption = "Risultati trovati: " & lstRime.ListCount
  39.     End If
  40.  
  41. Exit Sub
  42. Errore:
  43. MsgBox "Errore numero: " & Err.Number & vbCrLf & Err.Description, vbCritical
  44. End Sub
  45.  
  46. Private Sub Form_Load()
  47. txtXCorso.Text = App.Path & "\italiano.txt"
  48. CDialog.FileName = txtXCorso
  49. chkNumero_Click
  50. End Sub