| Liste des Groupes | Revenir à cl c |
bart <bc@freeuk.com> writes:Any step other than 1 is unusual. So Basic and Fortran would typically be:On 15/04/2025 14:19, Kaz Kylheku wrote:Thats's fine. But it means a real 'for' loop doesn't exist in C; youReal for loops _are_ a three-way construct.
have to emulate it using that 3-way construct, which is naff, and also
error prone.
135 FOR I=1 TO 10 STEP 2 [BASIC]
for(i = 1; i < 11; i += 2) [C/C++]
do 1 = 1, 10, 2 [FORTRAN]
SPRITE also had:That's pretty weird, but whatever it does, it's nothing to do with iterating a variable over a range.
UNTIL done, notfound
DO
...
IF token = "this"
THEN LOOP_EXIT done
FI;
...
IF i = upb(table)
THEN LOOP_EXIT notfound
FI;
...
OD
CASE
IS done: write("i=", i);
OR notfound write("not found", upb(table));
Les messages affichés proviennent d'usenet.