Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

Error on expression

Hi, I'm got a code on internet that make otimization but my compiler is setting the following fragment with a error. Someone know how can I fix it? 

Sorry for my english.

 

      do i=1,nlin
          if (barra_f(i) .gt. barra_i(i)) then
              A(nger+1+cont1,nger+barra_i(i)+1) = lineX(barra_i(i), barra_f(i))
              A(nger+1+cont1,nger+barra_f(i)+1) = -lineX(barra_i(i), barra_f(i))
          else
              A(nger+1+cont1,nger+barra_i(i)+1) = -lineX(barra_i(i), barra_f(i))
              A(nger+1+cont1,nger+barra_f(i)+1) = lineX(barra_i(i), barra_f(i))
          end if
          A(nger+1+cont1,1) = carregamento(i)
          cont1=cont1+1
      end do

 

The compiler sets the expessions with the following error
Erro error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: = .EQV. .NEQV. .XOR. .OR. .AND. .LT. < .LE. <= .EQ. == .NE. /= .GT. > ... C:\Users\Tamiris\Documents\Visual Studio 2017\Projects\FPO\Console4\Simplex.for 123
0 Kudos
3 Replies
Highlighted
Valued Contributor II

Which line is the offending

Which line is the offending line? The error message indicates line 123, but there is no such line of course in the above fragment.

And without declarations it is a trifle difficult to diagnose errors that might come from a wrong use/declaration.

 

0 Kudos
Highlighted
Valued Contributor II

The compiler thinks the

The compiler thinks the source code is fixed format, so it's ignoring characters after the first 72. One of your lines is 74 characters long.

Either change the name of the file to Simplex.f90 or compile it with the /FREE compiler switch in effect. Either choice will let the compiler know it's free format.

 

0 Kudos
Highlighted

or change the indentation

or change the indentation such that your source lines do not extend past column 72 (and do not use tab characters).

If you are using MS Visual Studio, columns 73 and later are highlighted with the comment color (usually green).

Jim Dempsey

0 Kudos