Navigation: thinBasic language > Program Flow > ITERATE |
|
Description
Exit current loop iteration and start another one.
Syntax
ITERATE { FOR | WHILE | DO }
Returns
Parameters
Remarks
Restrictions
See also
Examples
Thanks to Petr Schreiber for the following script example
Type tAgenda
age As Byte ' Years
payment As Long ' Money
drivingLicense As Byte ' 0 = no, 1 = yes
End Type
%ITEMS = 3
Dim Person(%ITEMS) As tAgenda
Person(1).age = 24
Person(1).payment = 1000
Person(1).drivingLicense = 1
Person(2).age = 32
Person(2).payment = 1000
Person(2).drivingLicense = 0
Person(3).age = 64
Person(3).payment = 1000
Person(3).drivingLicense = 1
' -- Raise payment for people older and equall to 32, and in case they
' -- have driving license too then some money extra
For index = 1 To %ITEMS
If Person(index).age < 32 Then ITERATE For ' -- Too young, quickly jump to NEXT person index
Person(index).payment = Person(index).payment + 1000
If Person(index).drivingLicense = 0 Then ITERATE For ' -- No driving license, quickly jump to NEXT person index
Person(index).payment = Person(index).payment + 500
Next
© 2004-2008 thinBasic. All rights reserved. | Version 1.7.0.0 | Web Site: http://www.thinbasic.com |