
                    ERCC. Imp80 Compiler Release 1 Version 27 May 81

           255  765
             1      %include "ECSLIB.EDWIN_SPECS"
             2      { EDWIN routine specs added }                   %end %of %list
            57      %external %routine %spec PROMPT (%string (15) S)
            58      %begin
            59      
            60      ! EDWIN test program 1
            61      ! This program tests the ability to draw lines and to read the cursor.
            62      ! The program reads four cursor locations, and then joins these by
            63      ! a mesh of lines.
            64      ! This is repeated until 'S' is the key hit in response to the cursor.
            65      
            66      %const %integer NUM = 10
            67      %integer I,CVAL,TYPE
            68      %integer %array X,Y (1:4)
            69      
            70      PROMPT ("Device Type:")
            71      READ (TYPE)
            72      INITIALISE FOR (TYPE)
            73      
            74      NEW FRAME;    ! This clears the screen
            75      
            76      %cycle
            77         %for I=1,1,4 %cycle
            78            ! This cycle reads the 4 points defining the two primary lines.
            79            REQUEST INPUT (CVAL, X(I) , Y(I))
            80            %exit %if CVAL = 'S' %or CVAL = 's'   ;! This stops the program.
            81            %if I&1=1 %then MOVE ABS(X(I),Y(I)) %else LINE ABS (X(I),Y(I))
            82         %repeat
            83       
            84         %exit %if CVAL = 'S' %or CVAL = 's'
            85      
            86         ! Now the points on these lines are joined up.
            87      
            88         %for I=0,1,NUM %cycle
            89            MOVEABS (X(1) + I*(X(2)-X(1))//NUM, Y(1) + I*(Y(2)-Y(1))//NUM)
            90            LINEABS (X(3) + I*(X(4)-X(3))//NUM, Y(3) + I*(Y(4)-Y(3))//NUM)
            91         %repeat
            92      %repeat
            93      
            94      TERMINATE EDWIN
            95      
            96      %end %of %program

              96 LINES ANALYSED IN   458 MSECS  -  SIZE=  2288

          CODE   1096 BYTES      GLAP 376+ 0 BYTES      DIAG TABLES 104 BYTES
          TOTAL  1576 BYTES
                80 STATEMENTS COMPILED IN  1047 MSECS
