example #1:
IF system.console.readline() = "hello" then
system.console.writeline("hi there")
endif
there are loads of different ways of doing loops. i wouldnt recommend using the LOOP statement unless you want a loop to go on forever.
2006-10-11 00:04:14
·
answer #1
·
answered by Anonymous
·
0⤊
0⤋
I have found the following examples.
Do you not have a help that you can consult?
Sub AlertUser(value as Long)
If value = 0 Then
AlertLabel.ForeColor = "Red"
AlertLabel.Font.Bold = True
AlertLabel.Font.Italic = True
End If
End Sub
Sub AlertUser(value as Long)
If value = 0 Then
AlertLabel.ForeColor = vbRed
AlertLabel.Font.Bold = True
AlertLabel.Font.Italic = True
Else
AlertLabel.Forecolor = vbBlack
AlertLabel.Font.Bold = False
AlertLabel.Font.Italic = False
End If
End Sub
Function Bonus(performance, salary)
If performance = 1 Then
Bonus = salary * 0.1
ElseIf performance = 2 Then
Bonus = salary * 0.09
ElseIf performance = 3 Then
Bonus = salary * 0.07
Else
Bonus = 0
End If
End Function
Dim Found, MyObject, MyCollection
Found = False ' Initialize variable.
For Each MyObject In MyCollection ' Iterate through each element.
If MyObject.Text = "Hello" Then ' If Text equals "Hello".
Found = True ' Set Found to True.
Exit For ' Exit loop.
End If
Next
For I = 1 To 10
For J = 1 To 10
For K = 1 To 10
...
Next K
Next J
Next I
Dim Check, Counter
Check = True: Counter = 0 ' Initialize variables.
Do ' Outer loop.
Do While Counter < 20 ' Inner loop.
Counter = Counter + 1 ' Increment Counter.
If Counter = 10 Then ' If condition is True.
Check = False ' Set value of flag to False.
Exit Do ' Exit inner loop.
End If
Loop
Loop Until Check = False ' Exit outer loop immediately.
Requires indenting to read properly.
2006-10-11 00:14:38
·
answer #2
·
answered by AnalProgrammer 7
·
0⤊
0⤋
A Do... Loop assertion is almost a For... next assertion, yet with a result examine as a replace of a counter. A Do... Loop is a loop that runs till a situation is met; the examine could be completed at the two the initiating or the turnaround of the loop: Do till [situation] ... Loop or: Do ... Loop till [situation] there is not lots of a distinction, different than for the incontrovertible fact that the latter could have one new launch extra suitable than the 1st (by way of fact the examine is on the top, not on the initiating). the same build is finished with a mutually as... Wend loop: mutually as [situation] ... Wend yet those sorts of loops are often in keeping with *exterior* situations, the place Do... Loop loops, like For... next loops are in keeping with situations changing *interior* the recent launch.
2016-11-27 21:08:01
·
answer #3
·
answered by dufrene 4
·
0⤊
0⤋
if i have any hope on programming then
i'd wanna search the internet
if me stupid, end if
else
next
2006-10-11 01:26:13
·
answer #4
·
answered by r3dm0 4
·
0⤊
0⤋