help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

fortran example "fortsub" in the manual


From: Stefan Pofahl
Subject: fortran example "fortsub" in the manual
Date: Mon, 14 Dec 2009 14:09:07 +0100

Hello,

I have problems to compile the fortran example "fortsub" in the manual.
--
      subroutine fortsub (n, a, s)
      implicit none
      character*(*) s
      real*8 a(*)
      integer*4 i, n, ioerr
      do i = 1, n
        if (a(i) .eq. 0d0) then
          call xstopx ('fortsub: divide by zero')
        else
          a(i) = 1d0 / a(i)
        endif
      enddo
      write(unit = s, fmt = '(A,I3,A,A)', iostat = ioerr)
     $ ’'There are '’, n,
     $ ’' values in the input vector'’, char(0)
      if (ioerr .ne. 0) then
        call xstopx ('fortsub: error writing string')
      endif
      return
      END
--
If I give the command:
> mkoctfile -v --mex "e:\\oct\\fortsub.f"
on the octave prompt.

The error message is:
--
      write(unit = s, fmt = '(A,I3,A,A)', iostat = ioerr)
                                                        1
Error: Expected expression in WRITE statement at (1)
--

Ans suggestions? Where can I find more information
regarding the topic: Fortran Routines in Octave?

Regards,

Stefan


-- 
Tel.: 0731-3805149
Ochsensteige 48
89075 Ulm



reply via email to

[Prev in Thread] Current Thread [Next in Thread]