文書整形 -- 出力の右揃えなど2016年12月14日 18:13

現在の出力は、行の右端が不揃いになる。これを解消するのに、 putwrd()を修正する。この中のspread()は、語の間の空白を調整し一行の中に、語を 割り付ける。

RATFORでは

# putwrd.r4 -- put a word in outbuf; include margin justification
      subroutine putwrd(wrdbuf)
      character wrdbuf(INSIZE)
      integer length,width
      integer last,llval,nextra,w
      include cout.fi
      include cparam.fi

      w = width(wrdbuf)
      last = length(wrdbuf) + outp + 1  ! new end of outbuf
      llval = rmval - tival
      if ((outp > 0) & (outw+w > llval | last >= MAXOUT)) { # too big
          last = last - outp            # remember end of wrdbuf
          nextra = llval - outw + 1
          call spread(outbuf,outp,nextra,outwds)
          if ((nextra > 0) & (outwds > 1))
               outp = outp + nextra

          call brk                      # flush previous line
          }
      call scopy(wrdbuf,1,outbuf,outp+1)
      outp = last
      outbuf(outp) = BLANK              # blank between words
      outw = outw + w + 1               # 1 for blank
      outwds = outwds + 1
      return
      end

WATCOM fortran 77では、

c putwrd.f -- put a word in outbuf; include margin justification
      subroutine putwrd(wrdbuf)
      integer*1 wrdbuf(82)              ! INSIZE(82)
      integer length,width
      integer last,llval,nextra,w
      include cout.fi
      include cparam.fi

      w = width(wrdbuf)
      last = length(wrdbuf) + outp + 1  ! new end of outbuf
      llval = rmval - tival
      if ((outp .gt. 0) .and.
     1    ((outw+w .gt. llval) .or. (last .ge. 74))) then ! MAXOUT(74)  too big
          last = last - outp            ! remember end of wrdbuf
          nextra = llval - outw + 1
          call spread(outbuf,outp,nextra,outwds)
          if ((nextra .gt.0) .and. (outwds .gt. 1)) then
               outp = outp + nextra
          end if
          call brk                      ! flush previous line
      end if
      call scopy(wrdbuf,1,outbuf,outp+1)
      outp = last
      outbuf(outp) = 32                 ! BLANK(32)       blank between words
      outw = outw + w + 1               ! 1 for blank
      outwds = outwds + 1
      return
      end

spread()は、以下の通り

RATFORでは

# spread.r4 -- spread words to justify right margin
      subroutine spread(buf,outp,nextra,outwds)
      character buf(MAXOUT)
      integer outp,nextra,outwds
      integer min
      integer dir,i,j,nb,ne,nholes
      data dir/0/

      if ((nextra <= 0) | (outwds <= 1))
          return
      dir = 1 - dir                     # reverce previouse direction
      ne = nextra
      nholes = outwds - 1
      i = outp - 1
      j = min(MAXLINE - 2, i + ne)      # leave room for NEWLINE, EOS
      while (i < j) {
          buf(j) = buf(i)
          if (buf(i) == BLANK) {
              if (dir == 0)
                  nb = (ne - 1) / nholes + 1
              else
                  nb = ne / nholes
              ne = ne - nb
              nholes = nholes - 1
              for ( ; nb > 0; nb = nb - 1) {
                  j = j - 1
                  buf(j) = BLANK
                  }
              }
          i = i - 1
          j = j - 1
          }
      return
      end

WATCOM fortran 77では、

c spread.for -- spread words to justify right margin
      subroutine spread(buf,outp,nextra,outwds)
      integer*1 buf(74)                 ! MAXOUT(74)
      integer outp,nextra,outwds
      integer min
      integer dir,i,j,nb,ne,nholes
      data dir/0/

      if ((nextra .le. 0) .or. (outwds .le. 1)) then
         return
      end if
      dir = 1 - dir                     ! reverce previouse direction
      ne = nextra
      nholes = outwds - 1
      i = outp - 1
      j = min(74-2, i+ne)               ! MAXOUT(74) -2 for leave room for NEWLINE, EOS

      while (i .lt. j) do
          buf(j) = buf(i)
          if (buf(i) .eq. 32) then      ! BLANK(32)
              if (dir .eq. 0) then
                  nb = (ne - 1) / nholes + 1
              else
                  nb = ne / nholes
              end if
              ne = ne - nb
              nholes = nholes - 1
              while (nb .gt. 0) do
                  j = j - 1
                  buf(j) = 32           ! BLANK(32)
                  nb = nb - 1
              end while
          end if
          i = i - 1
          j = j - 1
      end while
      return
      end

中央そろえは、center()で行う。実際は、一時字下げの値を調節する。

RATFORでは

# center.r4 -- center a line by setting tival
      subroutine center(buf)
      character buf(ARB)
      integer width,max
      include cparam.fi

      tival = max((rmval + tival - width(buf)) / 2, 0)
      return
      end

WATCOM fortran 77では、

c center.f -- center a line by setting tival
      subroutine center(buf)
      integer*1 buf(9999)               ! ARB(9999)
      integer width,max
      include cparam.fi

      tival = max((rmval + tival - width(buf)) / 2, 0)
      return
      end

下線は、書き出し文字とBACKSPACE、UNDERLINEを組み合わせ作り出す。 実際は、underl()で書き出し文字列を作り出す。

RATFORでは

# underl.r4 -- underline a line
      subroutine underl(buf,tbuf,size)
      character buf(size),tbuf(size)
      integer size
      integer type
      integer i,j,t

      j = 1
      for (i = 1; buf(i) != NEWLINE & j < size- 1; i = i + 1) {
          tbuf(j) = buf(i)
          j = j + 1
          if (buf(i) != BLANK & buf(i) != TAB & buf(i) != BACKSPACE) {
              tbuf(j) = BACSPACE
              tbuf(j+1) = UNDERLINE
              j = j + 2
              }
          }
      tbuf(j) = NEWLINE
      tbuf(j+1) = EOS
      call scopy(tbuf, 1, buf, 1)          # copy it back to buf
      return
      end

WATCOM fortran 77では、

c underl.for -- underline a line
      subroutine underl(buf,tbuf,size)
      integer*1 buf(size),tbuf(size)
      integer size
      integer i,j,t

      j = 1
      i = 1
      while ((buf(i) .ne. 10) .and. (j .lt. size-1)) do ! NEWLINE(10)
          tbuf(j) = buf(i)
          j = j + 1
          if ((buf(i) .ne. 32)          ! BLANK(32)
     1        .and. (buf(i) .ne. 9)     ! TAB(9)
     2        .and. (buf(i) .ne. 8)) then ! BACKSPACE(8)
              tbuf(j)   = 8             ! BACKSPACE(8)
              tbuf(j+1) = 95            ! UNDERLINE(95)
              j = j + 2
          end if
          i = i + 1
      end while
      tbuf(j)   = 10                    ! NEWLINE(10)
      tbuf(j+1) = -2                    ! EOS(-2)
      call scopy(tbuf,1,buf,1)          ! copy it back to buf
      return
      end

ここまで出てきた新機能を追加するには、text()を修正する必要がある。 text()の最終版は、以下の通り。

RATFORでは

# text.r4 -- process text lines (final version)
      subroutine text(inbuf)
      character inbuf(INSIZE), wrdbuf(INSIZE)
      integer getword
      integer i
      include cparam.ri

      if (inbuf(1) == BLANK | inbuf(1) == NEWLINE)
         call leadbl(inpuf)             # move left, set tival
      if (ulval > 0) {                  # underlining
          call underl(inbuf,wrdbuf,INSIZE)
          ulval = ulval - 1
          }
      if (ceval > 0) {                  # centering
          call center(inbuf)
          call put(inbuf)
          ceval = ceval - 1
          }
      else if (inbuf(1) == NEWLINE)     # all blank line
         call put(inbuf)
      else if (fill == NO)              # unfiled text
         call put(inbuf)
      else                              # filled text
         for (i = 1;getwrd(inbuf,i,wrdbuf)>0; )
             call putwrd(wrdbuf)
      return
      end

WATCOM fortran 77では、

c text.f -- process text lines (final version)
      subroutine text(inbuf)
      integer*1 inbuf(82), wrdbuf(82)   ! INSIZE(82) INSIZE(82)
      integer getwrd
      integer i
      include cparam.fi

      if (inbuf(1) .eq. 32 .or. inbuf(1) .eq. 10) then ! BLANK(32) NEWLINE(10)
         call leadbl(inpuf)             ! move left, set tival
      end if
      if (ulval .gt. 0) then            ! underlining
          call underl(inbuf,wrdbuf,INSIZE)
          ulval = ulval - 1
      end if
      if (ceval .gt. 0) then            ! centering
          call center(inbuf)
          call put(inbuf)
          ceval = ceval - 1
      else if (inbuf(1) .eq. 10) then   ! all blank line
         call put(inbuf)
      else if (fill .eq. 0) then        ! unfiled text NO(0)
         call put(inbuf)
      else                              ! filled text
         i = 1
         while (getwrd(inbuf,i,wrdbuf) .gt. 0 ) do
             call putwrd(wrdbuf)
         end while
      end if
      return
      end

コメント

_ tinder dating site ― 2017年02月25日 19:22

My programmer is trying to convince me to move to .net from PHP.
I have always disliked the idea because of the expenses.
But he&#39;s tryiong none the less. I&#39;ve been using WordPress on several websites for about a year and am worried about switching
to another platform. I have heard good things about blogengine.net.
Is there a way I can transfer all my wordpress posts into it?

Any kind of help would be really appreciated!

_ tinder dating site ― 2017年02月26日 05:01

It&#39;s truly very complicated in this active life to listen news on TV, thus
I just use world wide web for that purpose, and take the newest news.

_ tinder dating site ― 2017年02月27日 18:14

Hi there, I discovered your blog via Google whilst searching for a comparable topic, your
site got here up, it looks good. I have bookmarked it in my google
bookmarks.
Hi there, simply turned into aware of your weblog via Google,
and located that it&#39;s truly informative. I&#39;m gonna be careful for brussels.
I will be grateful in the event you continue this in future.
A lot of other folks will be benefited from your writing.
Cheers!

_ tinder dating site ― 2017年03月01日 02:41

I want to to thank you for this excellent
read!! I certainly enjoyed every bit of it. I have got you book-marked to look at new
things you post…

_ tinder dating site ― 2017年03月02日 00:24

Hello my friend! I want to say that this article is awesome, great written and come with almost all vital
infos. I would like to see more posts like this .

_ minecraft ― 2017年03月02日 23:14

Thanks on your marvelous posting! I actually enjoyed reading it, you could be a great author.

I will be sure to bookmark your blog and will eventually
come back at some point. I want to encourage you to definitely continue
your great posts, have a nice weekend!

_ tinder dating site ― 2017年03月05日 02:54

Hello, all is going fine here and ofcourse every one is sharing information, that&#39;s actually fine,
keep up writing.

_ tinder dating site ― 2017年03月05日 13:47

Wow, wonderful blog layout! How long have you been blogging for?
you make blogging look easy. The overall look of your web
site is great, as well as the content!

_ minecraft ― 2017年03月07日 14:03

If you are going for finest contents like myself, simply go to see this site all the time because it provides quality
contents, thanks

_ manicure ― 2017年03月09日 16:05

Hi, i think that i saw you visited my site thus i came to “return the favor”.I
am trying to find things to improve my website!I suppose its ok to use
a few of your ideas!!

_ http://woodside.mrdrain.com ― 2017年03月10日 03:41

Hi there colleagues, good piece of writing and nice arguments commented here,
I am really enjoying by these.

_ http://tinyurl.com/zo2n84w ― 2017年03月10日 22:48

Hello there! I could have sworn I&#39;ve been to
this site before but after reading through some of the
post I realized it&#39;s new to me. Nonetheless, I&#39;m definitely happy I found it and I&#39;ll be book-marking and checking back frequently!

_ http://tinyurl.com/ ― 2017年03月11日 00:05

Wonderful work! That is the kind of info that are supposed to be shared across the internet.
Shame on the search engines for now not positioning this post higher!
Come on over and talk over with my website . Thank you =)

_ http://tinyurl.com/hl2j2zx ― 2017年03月11日 14:51

Awesome site you have here but I was curious about if you knew of any user discussion forums that cover the same topics discussed
here? I&#39;d really like to be a part of community where I can get
feed-back from other knowledgeable individuals that share the same interest.

If you have any recommendations, please let me
know. Appreciate it!

_ http://tinyurl.com/z399z8e ― 2017年03月11日 14:52

It&#39;s an awesome post in support of all the internet users;
they will take advantage from it I am sure.

_ tinder dating site ― 2017年03月14日 03:04

Great blog you have here but I was wanting to know if you knew of any discussion boards that cover the same topics
discussed in this article? I&#39;d really love to be a part of online
community where I can get feed-back from other knowledgeable individuals that share the same interest.

If you have any recommendations, please let me know. Many thanks!

_ tinder dating site ― 2017年03月14日 10:43

Fine way of explaining, and good article to take information about my
presentation subject, which i am going to deliver in school.

_ tinder dating site ― 2017年03月17日 18:28

Do you mind if I quote a couple of your articles as long as
I provide credit and sources back to your blog? My blog is in the very same niche as yours and my
users would truly benefit from a lot of the information you provide
here. Please let me know if this ok with you. Regards!

_ tinder dating site ― 2017年03月17日 20:25

After I initially left a comment I appear to have
clicked the -Notify me when new comments are added- checkbox and now whenever a comment is
added I get 4 emails with the exact same comment.
Perhaps there is an easy method you can remove me from that service?
Thanks!

_ tinder dating site ― 2017年03月20日 09:30

You have made some decent points there. I looked on the internet for more info about the issue and found most people will go along with your
views on this web site.

_ free dating sites no fees 100% free ― 2017年03月22日 00:56

hey there and thank you for your info – I have certainly picked up something new from right here.
I did however expertise some technical points using this site, as I experienced to reload
the website many times previous to I could get it to load correctly.
I had been wondering if your hosting is OK? Not that I&#39;m complaining, but slow loading instances times
will often affect your placement in google and could
damage your quality score if ads and marketing with Adwords.

Anyway I&#39;m adding this RSS to my e-mail and
can look out for a lot more of your respective exciting content.
Ensure that you update this again soon.

_ free dating sites no fees ― 2017年03月22日 03:59

I used to be recommended this web site by way of my cousin. I&#39;m now not positive
whether or not this submit is written via him as no one else realize such special about my difficulty.
You are amazing! Thank you!

_ browse free dating sites with no sign up ― 2017年03月23日 05:42

What&#39;s Taking place i am new to this, I stumbled upon this I&#39;ve discovered It absolutely
useful and it has aided me out loads. I&#39;m hoping
to contribute &amp; help other customers like its
aided me. Good job.

_ free dating sites no fees ― 2017年03月23日 08:14

I am now not certain the place you are getting your information, however great topic.
I needs to spend a while finding out more or figuring out more.
Thanks for wonderful information I used to be looking for this info for my mission.

_ minecraft games ― 2017年03月26日 02:08

Very descriptive blog, I liked that a lot. Will there
be a part 2?

_ download minecraft ― 2017年03月26日 16:08

all the time i used to read smaller posts which also
clear their motive, and that is also happening with this piece of
writing which I am reading at this place.

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

Everything is very open with a very clear explanation of the issues.
It was definitely informative. Your website is very helpful.
Thanks for sharing!

_ BHW ― 2017年04月12日 19:16

After looking into a few of the articles on your web page, I really appreciate your technique of writing
a blog. I added it to my bookmark webpage list and will be checking back in the near future.
Please visit my website as well and let me know how you feel.

_ BHW ― 2017年04月15日 21:08

Hi to every body, it&#39;s my first pay a quick visit of this website;
this blog consists of remarkable and genuinely fine data
designed for visitors.

_ www.krogerfeedback.com ― 2017年05月01日 08:46

Thanks for one&#39;s marvelous posting! I seriously enjoyed reading it, you
could be a great author.I will make certain to bookmark your blog and will often come back very soon. I want to encourage
yourself to continue your great job, have a nice holiday weekend!

_ smallnurse9117.exteen.com ― 2017年05月02日 09:29

This is the right web site for anybody who wants to find out about this topic.
You realize a whole lot its almost tough to argue with you (not that I actually would
want to?HaHa). You definitely put a new spin on a subject that&#39;s been written about for years.
Great stuff, just great!

_ manicure ― 2017年05月03日 12:22

Way cool! Some very valid points! I appreciate
you penning this article and the rest of the site is really good.

_ cindatiede.jimdo.com ― 2017年05月07日 21:48

Sweet blog! I found it while browsing on Yahoo News. Do you have any tips
on how to get listed in Yahoo News? I&#39;ve been trying for a while but
I never seem to get there! Many thanks

_ Minecraft ― 2017年05月20日 03:09

Fastidious response in return of this matter with real
arguments and telling the whole thing about that.

_ Minecraft ― 2017年05月20日 03:14

Heya i am for the first time here. I came
across this board and I find It truly useful &amp; it helped me out a lot.

I hope to give something back and aid others like
you helped me.

_ Minecraft ― 2017年05月20日 12:50

Hi, this weekend is pleasant for me, as this occasion i am reading this impressive
educational piece of writing here at my home.

_ instacart promo code 2017 ― 2017年08月21日 22:46

constantly i used to read smaller articles which as well clear their motive,
and that is also happening with this post which I am reading at this
time.

_ tinyurl.com ― 2017年08月22日 04:27

I do not even know how I ended up here, but I thought this
post was good. I do not know who you are but certainly you&#39;re going to
a famous blogger if you are not already ;) Cheers!

_ http://tinyurl.com ― 2017年08月22日 17:17

I do agree with all the ideas you&#39;ve presented on your post.

They&#39;re really convincing and will certainly work. Still, the posts are too quick for
starters. May you please prolong them a bit from subsequent
time? Thank you for the post.

_ http://tinyurl.com ― 2017年08月25日 00:04

Asking questions are truly pleasant thing if you are not understanding something completely, but this
paragraph provides pleasant understanding yet.

_ tinyurl.com ― 2017年08月25日 05:04

Have you ever thought about including a little bit more than just your articles?

I mean, what you say is important and all. Nevertheless think about if you added some great graphics or video clips
to give your posts more, &quot;pop&quot;! Your content is excellent but with
images and videos, this blog could certainly be one of the very best in its niche.
Awesome blog!

_ tinyurl.com ― 2017年08月25日 11:48

Wow! After all I got a webpage from where I be
able to really obtain valuable information concerning my study and knowledge.

_ http://tinyurl.com/ ― 2017年08月25日 15:48

Right now it appears like Movable Type is the preferred blogging
platform available right now. (from what I&#39;ve read) Is that what you
are using on your blog?

_ tinyurl.com ― 2017年08月25日 15:57

What&#39;s Taking place i am new to this, I stumbled upon this I have discovered It absolutely useful and it has helped me out loads.
I am hoping to contribute &amp; help different customers like its aided me.
Great job.

_ http://tinyurl.com/ ― 2017年08月26日 02:32

Pretty nice post. I just stumbled upon your blog and wished to say that I have
really enjoyed surfing around your blog posts.

In any case I&#39;ll be subscribing to your feed and I hope you write again very
soon!

_ publix deli online ordering ― 2017年09月28日 06:07

Thanks for any other informative web site.
Where else could I get that type of information written in such an ideal way?

I have a undertaking that I am just now operating on, and I have been on the look out for such information.

_ instacart publix ― 2017年09月29日 03:52

This is really interesting, You&#39;re a very skilled blogger.
I have joined your feed and look forward to seeking more of your magnificent post.
Also, I&#39;ve shared your web site in my social networks!

_ publix delivery ― 2017年09月29日 12:23

Very quickly this web page will be famous among all blogging and site-building
viewers, due to it&#39;s pleasant articles

_ publix delivery ― 2017年09月30日 00:07

Pretty nice post. I simply stumbled upon your weblog and wished to say
that I&#39;ve truly enjoyed surfing around your weblog posts.
In any case I&#39;ll be subscribing for your rss feed and
I am hoping you write once more very soon!

_ publix delivery groceries ― 2017年09月30日 11:56

Its such as you learn my mind! You appear to know so much about this, like you wrote the e-book in it or something.

I think that you just could do with some p.c.
to drive the message home a bit, but other than that, that is great blog.
An excellent read. I&#39;ll certainly be back.

※コメントの受付件数を超えているため、この記事にコメントすることができません。

トラックバック

このエントリのトラックバックURL: http://kida.asablo.jp/blog/2016/12/14/8275537/tb