文書整形 -- 指令の解読2016年10月04日 17:49

指令は行頭から始まるので、とりあえず一文字目がなんであるかで、 その行が指令なのか、其れ以外なのか判断できる。そこで、メインルーチンは、 とりあえず、下記のように書ける。

RATFORでは、

# xformat -- text formater main program
      program xformat
      character inbuf(INSIZE)
      character getlin

      include cpage.ri

      call initfile
      call init

      while (getlin(inbuf,STDIN) != EOF)
          if (inbuf(1) == COMMAND)
              call comand(inbuf)        # it's a command
          else
              call text(inbuf)          # it's a text
      stop
      end

WATCOM fortran 77では、

c xformat -- text formater main program
      program xformat
      integer*1 inbuf(82)               ! INSIZE(82)
      integer*1 getlin

      include cpage.fi

      call initfile
      call init

      while (getlin(inbuf,5) .ne. -1) do ! STDIN(5) EOF(-1)
          if (inbuf(1) .eq. 46) then    ! COMMAND('.',46)
              call comand(inbuf)        ! it's a command
          else
              call text(inbuf)          ! it's a text
          end if
      end while
      stop
      end

ここで,サブルーチンinitは、大域変数を初期化するルーチンである。

RATFORでは、以下の通り。

# init.r4 -- set initial value
      subroutine init

      include cparam.ri
      include cpage.ri
      include cout.ri

# cparam
      fill  = YES
      lsval = 1
      inval = 0
      rmval = PAGEWIDTH
      tival = 0
      ceval = 0
      ulval = 0
# cpage
      curpag = 0
      newpag = 1
      lineno = 0
      plval  = PAGELEN
      m1val  = 4
      m2val  = 1
      m3val  = 4
      m4val  = 1
      bottom = plval - m3val - m4val
      header(1) = EOS
      footer(1) = EOS
# cout
      outp   = 0
      outw   = 0
      outwds = 0
      outbuf(1) = EOS
#
      return
      end

WATCOM fortran77では、以下の通り。

c init.f -- set initial value
      subroutine init

      include cparam.fi
      include cpage.fi
      include cout.fi

c cparam
      fill  = 1                         ! YES(1)
      lsval = 1
      inval = 0
      rmval = 60                        ! PAGEWIDTH(60)
      tival = 0
      ceval = 0
      ulval = 0
c cpage
      curpag = 0
      newpag = 1
      lineno = 0
      
      plval  = 66                       ! PAGELEN(66)
      m1val  = 4
      m2val  = 1
      m3val  = 4
      m4val  = 1
      bottom = plval - m3val - m4val
      header(1) = -2                    ! EOS(-2)
      footer(1) = -2                    ! EOS(-2)
c cout
      outp   = 0
      outw   = 0
      outwds = 0
      outbuf(1) = -2                    ! EOS(-2)
c
      return
      end

コメント

_ manicure ― 2017年03月30日 19:58

Hello, this weekend is nice in support of me, because this point in time i am reading this impressive educational
piece of writing here at my house.

_ manicure ― 2017年03月30日 20:00

Have you ever considered publishing an ebook or guest authoring on other sites?
I have a blog centered on the same information you discuss
and would love to have you share some stories/information. I know
my viewers would enjoy your work. If you're even remotely interested, feel free to send me an e
mail.

_ manicure ― 2017年03月30日 20:02

I think this is one of the most important info for me.
And i am glad reading your article. But should remark on some
general things, The site style is ideal, the articles is really
nice : D. Good job, cheers

_ manicure ― 2017年04月03日 11:46

After checking out a few of the blog posts on your web site, I really like your technique of writing a blog.

I book marked it to my bookmark site list and will be
checking back in the near future. Take a look at my website too and let me know how you feel.

_ BHW ― 2017年04月12日 18:53

My spouse and I stumbled over here coming from a different web address and thought I might check things out.
I like what I see so now i am following you. Look forward to exploring your web page for a
second time.

_ BHW ― 2017年04月16日 18:20

Thanks for any other informative website. The place else
may I get that kind of info written in such a perfect
means? I've a project that I'm simply now running
on, and I have been at the look out for such info.

_ foamyflaw3212.soup.io ― 2017年05月09日 09:45

Just what I was searching for, thank you for putting up.

_ chocolate ― 2018年05月04日 06:00

Ahaa, its nice discussion on the topic of this post at this place at
this weblog, I have read all that, so at this time me also commenting
here.

_ https://nhathuoclanphuong.net/home1 ― 2019年07月30日 06:36

I gotta bookmark this website it seems extremely helpful very helpful.

_ https://nhathuoclanphuong.net/daday1 ― 2019年08月12日 18:40

Hello! I could have sworn I?ve visited this site before
but after browsing through a few of the posts I realized it?s new to me.

Anyhow, I?m certainly pleased I came across it and
I?ll be book-marking it and checking back regularly!

_ https://nhathuoclanphuong.net/tong-quan-ve-can-benh-ung-thu-phoi/ ― 2019年08月19日 05:38

I am glad to be a visitor of this arrant web site, regards for this rare information!

コメントをどうぞ

※メールアドレスとURLの入力は必須ではありません。 入力されたメールアドレスは記事に反映されず、ブログの管理者のみが参照できます。

名前:
メールアドレス:
URL:
コメント:

トラックバック

このエントリのトラックバックURL: http://kida.asablo.jp/blog/2016/10/04/8211358/tb