Download code

Jump to: navigation, search

Back to Basic_constructs_(AmigaE)

Download for Windows: zip

Download for UNIX: zip, tar.gz, tar.bz2

basic_constructs.e

1 
2 PROC main()
3 
4   loops()
5 
6 ENDPROC


loops

PROC loops()
  	FOR n:=0 TO 9
            WriteF('For loop alternative 1: \d\n",n)
  	ENDFOR
          
          FOR n:=0 TO 9 STEP 1 DO WriteF('For loop alternative 2: \d\n",n)

  	n:=0
  	WHILE n<10
            WriteF('While loop alternative 1: \d\n",n)
            n:=n+1
  	ENDWHILE
          
          n:=0
          WHILE n<10 DO n:=n+1 BUT WriteF('While loop alternative 2: \d\n",n)
  	n:=0;
          REPEAT
            n:=n+1
            WriteF("'REPEAT .. UNTIL loop \d\n",n)
          UNTIL n=9
  	n:=0;
          DO
            n:=n+1
            WtiteF("'REPEAT .. UNTIL loop \d\n",n)
            IF n=9 JUMP exit
          LOOP
  exit:
ENDFOR


hijacker
hijacker
hijacker
hijacker