English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

In Visual Basic, how would you change the following For statement to make it a Do statement??

MaxVal = 0
For SearchPos = MaxNum To 0 step -1
If Num(SearchPos) > MaxVal Then MaxVal = Num(SearchPos)
Next SearchPos

2006-12-11 03:20:39 · 3 answers · asked by bhs00 2 in Computers & Internet Programming & Design

3 answers

MaxVal = 0
SearchPos = MaxNum
do While SearchPos >= 0
If Num(SearchPos) > MaxVal Then MaxVal = Num(SearchPos)
SearchPos = SearchPos -1
end while

2006-12-11 04:09:49 · answer #1 · answered by Ahmad Nasser 2 · 0 0

Do While SearchPos >= 0
MaxVal = Num(SearchPos)
SearchPos = SearchPos - 1
End While

I seriously don't understand why you would use this loop, however, since it will always resilt in MaxVal being 0.

2006-12-11 03:30:54 · answer #2 · answered by Anonymous · 0 0

in simple terms say If (Checkbox.fee <> Checkbox2.fee) Then Text1.fee = "Incomplete" Text1.ForeColor = 255 'pink else Text1.ForeColor = 16711680 'blue Text1.fee= "finished" end if

2016-12-13 06:47:13 · answer #3 · answered by Anonymous · 0 0

fedest.com, questions and answers