Murt, you haven't ever assigned a value to inputString - testing the string
for "end" is therefore wasted effort.
If you really must keep the code construct the way you have written it, the
minimal changes required to get your code going have been amended to your
original posting below. I would think of alternative logic such as adding a
new farmer name to an ArrayList until an "end" is detected, then converting
to a String array of farmer.
This is all looks very similiar to a question asked by "portroe" on 02
Friday 2004 ;)
Regards
Hexathioorthooxalate
Dim inputString As String
For i = 0 To n + 1
inputString = InputBox("enter a farmer's name", , "<farmer>")
If inputstring = "end" Then
Exit For
Else farmers(i)=inputstring
End If
Next
"Murt" <mu**@itsschmee.com> wrote in message
news:uj**************@TK2MSFTNGP09.phx.gbl...
on my inbox below i want the loop to quit if the user enters End,
It does not function as written,
any ideas?
thanks
----------------------
Dim inputString As String
Dim i As Integer
For i = 0 To n + 1
farmers(i) = InputBox("enter a farmer's name", , "<farmer>")
If inputString = "end" Then
Exit For
End If
Next
----------------------