begin process at 2008 09 05 21:02:18
1 237 505 membres
445 nouveaux aujourd'hui
14 313 membres club

Vous ne trouvez pas de réponse à votre problème ? Alors posez la question dans le forum.
Souvenez-vous qu'il n'y a jamais de question bête, mais rester dans l'ignorance parce que l'on n'ose pas poser une question, ça c'est une erreur !

Sujet : Besoin d'aide pour un programme simple... [ Archives Visual Basic / J'AI BESOIN D'AIDE !!!! :) ] (Ghis)

Besoin d'aide pour un programme simple... le 11/05/2002 20:12:33

Ghis
Je doit faire un petit programme en Visual Basic et j'ai vraiment de la difficuleté. Voici le problème:

Write a program... that inputs lines of text and uses function InStr to determine the total number of occurences of each letter of the alphabet in the text. Uppercase (Majuscule) and lowercase (Minuscule) should be countered together. Store the totals for each letter in an array (Tableau), and display the values in tabular format after the totals have been deternined.

Sortie: Les statistiques provenant du tableau sont imprimées sur papier (Imprimante).

Voici le code que j'ai présentement:

Option Explicit
Dim mNbreLettreRetrouve(25) As Long
Dim mLettreRecherche(25) As String

Private Sub cmdQuitter_Click()
End
End Sub

Private Sub cmdRecherche_Click()
Dim intCompteur As Integer
Dim intIndice As Integer
Dim intRecherche As Integer
Dim intDebutRecherche As Integer
Dim strLettreRecherche As String
Dim intNombreRecherche As Integer

intDebutRecherche = 1

For intNombreRecherche = 0 To 25
Do Until intIndice = Len(txtTexte.Text)
intRecherche = InStr(intDebutRecherche, txtTexte.Text, mLettreRecherche(intNombreRecherche), vbTextCompare)

If intRecherche <> 0 Then
intDebutRecherche = intRecherche + 1
intCompteur = intCompteur + 1
End If

intIndice = intIndice + 1
Loop
mNbreLettreRetrouve(intIndice - 1) = intCompteur
Next intNombreRecherche
End Sub

Private Sub Form_Load()
mLettreRecherche(0) = "A"
mLettreRecherche(1) = "B"
mLettreRecherche(2) = "C"
mLettreRecherche(3) = "D"
mLettreRecherche(4) = "E"
mLettreRecherche(5) = "F"
mLettreRecherche(6) = "G"
mLettreRecherche(7) = "H"
mLettreRecherche(8) = "I"
mLettreRecherche(9) = "J"
mLettreRecherche(10) = "K"
mLettreRecherche(11) = "L"
mLettreRecherche(12) = "M"
mLettreRecherche(13) = "N"
mLettreRecherche(14) = "O"
mLettreRecherche(15) = "P"
mLettreRecherche(16) = "Q"
mLettreRecherche(17) = "R"
mLettreRecherche(18) = "S"
mLettreRecherche(19) = "T"
mLettreRecherche(20) = "U"
mLettreRecherche(21) = "V"
mLettreRecherche(22) = "W"
mLettreRecherche(23) = "X"
mLettreRecherche(24) = "Y"
mLettreRecherche(25) = "Z"

End Sub

Private Sub txtTexte_Change()
If Not txtTexte.Text = "" Then
cmdRecherche.Enabled = True
End If
End Sub


Que dois-je faire pour répondre aux exigences???

Merci d'Avance!!!


Classé sous : text, end, integer, mlettrerecherche, intindice

Participer à cet échange

Pub



Appels d'offres

CalendriCode

Septembre 2008
LMMJVSD
1234567
891011121314
15161718192021
22232425262728
2930     

VS Express FR Gratuit !

VS Express en français et 100% gratuit !

Téléchargements

Boutique

Boutique de goodies CodeS-SourceS