i made a program that let a user enter a five-digit Integer and it is supost to print how many integers are 7's. I can do this but i am supost to use a loop and im not good with them at all. Mine never seem to stop :( any suggestions...
Printable View
i made a program that let a user enter a five-digit Integer and it is supost to print how many integers are 7's. I can do this but i am supost to use a loop and im not good with them at all. Mine never seem to stop :( any suggestions...
Post your code, maybe someone can help.
make a form with a textbox and a commandbutton. Then use following code:
Code:Private Sub Command1_Click()
Dim lPos As Long
Dim iCount As Integer
Const strToFind = "7"
'start searching
lPos = InStr(1, Text1.Text, strToFind)
Do While lPos > 0
iCount = iCount + 1
'change start position of find function to 'lPos'
lPos = InStr(lPos + 1, Text1.Text, strToFind)
Loop
MsgBox "I found " & iCount & " times digit " & strToFind & " in " & Text1.Text & "."
End Sub
wouldnt have a clue
but could u help us out with the phone thing?