コマンドの処理 1 APPEND,DELETE2016年03月14日 08:53

コマンドの処理 1 APPEND,DELETE

個々のコマンドの処理は、コマンドごとの処理ルーチンで行う。 処理にあたって、行番号の省略値の設定を行うルーチンdefalt()を示す。

RATFOR版は、以下の通り。

# defalt.r4 -- set default line numbers
      integer function defalt(def1,def2,status)
      integer def1,def2,status

      include clines.ri

      status = EOF)
      if (nlines == 0) {
          line1 = def1
          line2 = def2
          }

      if (line1 > line2 | line1 <= 0)
          status = ERR
      else
          status = OK
      defalt = status
      return
      end

WATCOM Fortran77版は以下の通り。

c defalt.f -- set default line numbers
      integer function defalt(def1,def2,status)
      integer def1,def2,status

      include clines.fi

      status = -1                       ! EOF(-1)
      if (nlines .eq. 0) then
          line1 = def1
          line2 = def2
      end if

      if ((line1 .gt. line2) .or. (line1 .le. 0)) then
          status = -3                   ! ERR(-3)
      else
          status = -2                   ! OK(-2)
      end if
      defalt = status
      return
      end

doprnt()は、行を印刷する。このルーチンはコマンド処理ルーチンの中から頻繁に呼ばれる。

RATFOR版は、以下の通り。

# doprnt.r4 -- print lines from through to
      integer function doprnt(from,to)
      integer from,to

      integer gettxt
      integer i,junk

      include clines.ri
      include ctxt.ri

      if (from <= 0) then
          doprnt = ERR
      else
          for (i = from; i <= to; i = i + 1) {
              junk = gettxt(i)
              call putlin(txt,6)
              }
          curln = to
          doprnt = OK
      end if
      return
      end

WATCOM Fortran77版は以下の通り。

c doprnt.f -- print lines from through to
      integer function doprnt(from,to)
      integer from,to

      integer gettxt
      integer i,junk

      include clines.fi
      include ctxt.fi

      if (from .le. 0) then
          doprnt = -3 ! ERR(-3)
      else
          i = from
          while (i .le. to) do
              junk = gettxt(i)
              call putlin(txt,6)
              i = i + 1
          end while
          curln = to
          doprnt = -2 ! OK(-2)
      end if
      return
      end

行を追加するAPPENDコマンドを処理するappend()を示す。

RATFOR版は、以下の通り。

# append.r4 -- append lines after "line"
      integer function append(line,glob)
      integer line,glob
      character lin(MAXLINE)
      integer getlin,inject

      include clines.ri

      if (glob == YES)
          append = YES
      else {
          curln = line
          for (append = NOSTATUS; append == NOSTATUS; )
              if (getlin(lin,STDIN) == EOF)
                   append = EOF
              else if (lin(1) == PERIOD & lin(2) == NEWLINE)
                   append = OK
              else if (inject(lin) == ERR
                  append = ERR
          }
      return
      end

WATCOM Fortran77版は以下の通り。

c append.f -- append lines after "line"
      integer function append(line,glob)
      integer line,glob

      integer*1 lin(82)                 ! MAXLINE(82)
      integer*1 getlin
      integer inject

      include clines.fi

      if (glob .eq. 1) then             ! YES(1)
          append = -3                   ! ERR(-3)
      else
          curln = line
          append = 0                    ! NOSTATUS(0)
          while (append .eq. 0) do      ! NOSTATUS(0)
              if (getlin(lin,5) .eq. -1) then ! EOF(-1)
                   append = -1          ! EOF(-1)
              else if ((lin(1) .eq. 46) ! PERIOD(46 '.')
     1             .and. (lin(2) .eq. 10)) then  ! NEWLINE(10)
                   append = -2          ! OK(-2)
              else if (inject(lin) .eq. -3) then ! ERR(-3)
                  append = -3           ! ERR(-3)
              end if
          end while
      end if
      return
      end

行を削除するDELETEコマンドでは、削除の確認のために行を打ち出すp印を 付けることができる。これを処理するckp()を示す。

RATFOR版は、以下の通り。

# ckp.r4 -- check for "p" after command
      integer function ckp(lin,i,pflag,stats)
      character lin(MAXLINE)
      integer i,j,pflag,status

      j = i
      if (lin(j) == PRINT)
          j = j + 1
          pflag = YES
      else
          pflag = NO
      if (lin(j) == NEWLINE)
          status = OK
      else
          status = ERR
      ckp = status
      return
      end

WATCOM Fortran77版は以下の通り。

c ckp.for -- check for "p" after command
      integer function ckp(lin,i,pflag,stats)
      integer*1 lin(82)                 ! MAXLINE(82)
      integer i,j,pflag,status

      j = i
      if (lin(j) .eq. 112) then         ! PRINT(100,'p')
          j = j + 1
          pflag = 1                     ! YES(1)
      else
          pflag = 0                     ! NO(0)
      end if
      if (lin(j) .eq. 10) then          ! NEWLINE(10)
          status = -2                   ! OK(-2)
      else
          status = -3                   ! ERR(-3)
      end if
      ckp = status
      return
      end

DELETEコマンドは、指定された行を削除するわけだが、 実際には行と行のつなぎ情報を操作するだけである。

RATFOR版。

# delcmd.r4 -- delete lines from though to
      integer function delcmd(from,to,status)
      integer from,to,status

      integer getind,nextln,prevln
      integer k1,k2

      include clines.ri

      if (from <= 0)
          status = ERR
      else {
          k1 = getind(prevln(from))
          k2 = getind(nextln(to))
          lastln  = lastln - (to - from + 1)
          curln = prevln(from)
          call relink(k1,k2,k1,k2)
          status = OK
          }
      delcmd = status
      return
      end

WATCOM Fortran77版。

c delcmd.f -- delete lines from though to
      integer function delcmd(from,to,status)
      integer from,to,status

      integer getind,nextln,prevln
      integer k1,k2

      include clines.fi

      if (from .le. 0) then
          status = -3                   ! ERR(-3)
      else
          k1 = getind(prevln(from))
          k2 = getind(nextln(to))
          lastln  = lastln - (to - from + 1)
          curln = prevln(from)
          call relink(k1,k2,k1,k2)
          status = -2                   ! OK(-2)
      end if
      delcmd = status
      return
      end

コメント

_ descargar minecraft para pc completo ― 2016年10月14日 05:25

I&#39;ve been exploring for a little for any high quality articles or blog posts in this kind of space
. Exploring in Yahoo I finally stumbled upon this web site.
Reading this info So i am glad to convey that I
have an incredibly just right uncanny feeling I discovered just what I needed.

I so much indisputably will make sure to do not disregard this site and give it a
glance on a relentless basis.

_ gamefly 3 month free trial ― 2016年11月15日 15:56

Hi there are using Wordpress for your blog platform?
I&#39;m new to the blog world but I&#39;m trying to get started and
create my own. Do you require any html coding expertise to make your
own blog? Any help would be really appreciated! Gamefly 3 month free trial

_ quest bar natural ― 2016年11月20日 02:13

Heya i am for the first time here. I came across this board and I find It truly useful &amp; it helped me out much.
I hope to give something back and help others like you aided me.

_ http://j.mp/2fNl9N1 ― 2016年12月01日 22:14

Wow, this post is pleasant, my younger sister is analyzing such things,
so I am going to let know her.

_ free dating sites no fees ― 2016年12月10日 13:09

This is very interesting, You are an excessively professional blogger.
I have joined your rss feed and look forward to in quest of extra of your
great post. Also, I&#39;ve shared your web site in my social networks

_ Gamefly Free Trial ― 2016年12月18日 14:40

Hello there, You have done an excellent job. I will definitely digg it and personally recommend
to my friends. I am confident they will be benefited from this web site.

_ Gamefly Free Trial ― 2016年12月19日 03:59

Oh my goodness! Impressive article dude! Thanks, However I am having problems
with your RSS. I don&#39;t understand why I cannot join it.

Is there anybody having similar RSS problems? Anyone that knows the solution can you kindly respond?
Thanx!!

_ Gamefly Free Trial ― 2016年12月20日 04:58

Hello just wanted to give you a quick heads up. The words in your
article seem to be running off the screen in Chrome.
I&#39;m not sure if this is a formatting issue or something
to do with web browser compatibility but
I figured I&#39;d post to let you know. The design and style look great though!

Hope you get the issue fixed soon. Many thanks

_ Gamefly ― 2016年12月21日 12:40

Fabulous, what a website it is! This weblog provides helpful information to us, keep
it up.

_ www.krogerfeedback.com ― 2016年12月24日 20:01

Paragraph writing is also a fun, if you be familiar with
afterward you can write or else it is difficult to write.

_ www.krogerfeedback.com ― 2016年12月25日 01:48

Have you ever considered writing an e-book or guest authoring on other blogs?
I have a blog based on the same subjects you discuss and would love to have you share some stories/information. I know my visitors would enjoy your work.
If you&#39;re even remotely interested, feel free to send me an e mail.

_ www.krogerfeedback.com ― 2016年12月26日 02:52

This is my first time visit at here and i am truly pleassant to read all at alone place.

_ www.krogerfeedback.com ― 2016年12月26日 03:32

My coder is trying to convince me to move to .net from PHP.

I have always disliked the idea because of the costs.
But he&#39;s tryiong none the less. I&#39;ve been using Movable-type on several websites
for about a year and am worried about switching to another platform.

I have heard excellent things about blogengine.net.
Is there a way I can transfer all my wordpress content into it?

Any kind of help would be really appreciated!

_ plenty of fish dating site of free dating ― 2016年12月27日 17:16

Wow! At last I got a website from where I can actually obtain useful facts concerning my
study and knowledge.

_ match.com sign in already a member ― 2017年01月04日 03:53

Hello there! I know this is kinda off topic but I&#39;d figured I&#39;d
ask. Would you be interested in trading links or maybe
guest authoring a blog article or vice-versa? My site discusses a lot
of the same topics as yours and I believe we could greatly benefit from each other.
If you happen to be interested feel free to shoot me an e-mail.
I look forward to hearing from you! Excellent
blog by the way!

_ free dating sites no fees ― 2017年01月06日 08:25

Hey There. I discovered your weblog the use of msn. That is a very neatly written article.
I&#39;ll be sure to bookmark it and come back to learn extra
of your helpful information. Thanks for the
post. I will definitely comeback.

_ free dating sites no fees ― 2017年01月07日 06:36

Hello friends, nice piece of writing and pleasant
urging commented here, I am genuinely enjoying by these.

_ free dating sites 2017 ― 2017年01月08日 01:52

I always spent my half an hour to read this website&#39;s posts everyday along with a
cup of coffee.

_ 100 free dating sites ― 2017年01月08日 14:20

Have you ever considered about including a little bit
more than just your articles? I mean, what you say is important and
all. But imagine if you added some great pictures or video clips to
give your posts more, &quot;pop&quot;! Your content is excellent
but with images and video clips, this site could definitely be one of the best in its field.
Wonderful blog!

_ quest bars sale ireland ― 2017年01月10日 09:28

Hello! Do you know if they make any plugins to safeguard against hackers?
I&#39;m kinda paranoid about losing everything I&#39;ve worked hard on. Any recommendations?

_ gamefly free trial ― 2017年01月10日 21:56

Amazing blog! Do you have any recommendations for aspiring writers?
I&#39;m hoping to start my own blog soon but I&#39;m a little lost on everything.
Would you propose starting with a free platform like Wordpress or go for a paid option? There are
so many choices out there that I&#39;m completely overwhelmed ..
Any tips? Thank you!

_ www.krogerfeedback.com ― 2017年01月13日 07:50

My brother suggested I might like this blog. He was totally right.
This post truly made my day. You cann&#39;t imagine just how much time I had spent for
this info! Thanks!

_ www.krogerfeedback.com ― 2017年01月14日 05:39

This website was... how do you say it? Relevant!!
Finally I&#39;ve found something which helped me. Thanks!

_ www.krogerfeedback.com ― 2017年01月14日 11:56

An outstanding share! I&#39;ve just forwarded this onto a
friend who had been conducting a little homework on this.

And he actually ordered me dinner because I found it for him...
lol. So allow me to reword this.... Thank YOU for the meal!!

But yeah, thanx for spending the time to discuss this
matter here on your web page.

_ www.krogerfeedback.com ― 2017年01月15日 07:24

Quality posts is the secret to interest the visitors to go to see the website, that&#39;s
what this web site is providing.

_ www.krogerfeedback.com ― 2017年01月21日 03:20

I have read a few just right stuff here. Certainly worth
bookmarking for revisiting. I wonder how much effort you place to create the sort of wonderful informative website.

_ www.krogerfeedback.com ― 2017年01月21日 17:55

I have been browsing online more than 2 hours today, yet I never found any interesting article like yours.

It is pretty worth enough for me. In my view,
if all webmasters and bloggers made good content as you did, the net
will be a lot more useful than ever before.

_ visit the www.krogerfeedback.com web page ― 2017年01月26日 16:30

I think the admin of this website is truly working hard in support of
his web site, because here every stuff is quality based
stuff.

_ head off to the www.krogerfeedback.com internet site ― 2017年01月27日 02:03

I don&#39;t know if it&#39;s just me or if everybody else
experiencing issues with your website. It appears as though some of the written text within your posts are running off the screen. Can someone else
please provide feedback and let me know if this is happening to them as well?
This may be a issue with my web browser because I&#39;ve had this happen before.
Appreciate it

_ I adore the www.krogerfeedback.com web page ― 2017年01月27日 11:40

I could not refrain from commenting. Well written!

_ http://myseopressor.com/g-and-the-alphabet ― 2017年01月27日 23:19

Hi there to all, it&#39;s genuinely a fastidious
for me to pay a visit this website, it contains helpful Information.

_ http://tottp.com/g-words/ ― 2017年01月29日 04:46

Good day! I could have sworn I&#39;ve been to this blog before but after reading through some of the post I realized it&#39;s new to me.

Anyhow, I&#39;m definitely glad I found it and I&#39;ll be
book-marking and checking back frequently!

_ g ― 2017年01月30日 13:45

I just like the helpful info you supply on your articles.
I will bookmark your weblog and check once more here regularly.
I am relatively sure I will be informed many new stuff right
right here! Best of luck for the next!

_ match.com ― 2017年01月30日 23:03

Hi, I think your blog might be having browser compatibility
issues. When I look at your blog site in Safari, it looks
fine but when opening in Internet Explorer, it has some overlapping.

I just wanted to give you a quick heads up! Other then that, excellent blog!

_ match.com ― 2017年01月31日 04:22

This is my first time visit at here and i am genuinely
impressed to read everthing at alone place.

_ minecraft ― 2017年02月03日 05:35

Pretty! This has been an extremely wonderful article. Many thanks for providing this info.

_ twitter.com ― 2017年02月06日 04:11

Why users still make use of to read news papers when in this technological world all is presented on web?

_ g ― 2017年02月07日 21:41

Informative article, just what I was looking for.

_ madera.mrdrain.com ― 2017年02月12日 02:12

Hey I know this is off topic but I was wondering
if you knew of any widgets I could add to my blog that automatically tweet my
newest twitter updates. I&#39;ve been looking for a plug-in like this for quite some
time and was hoping maybe you would have some experience with something like this.
Please let me know if you run into anything. I truly enjoy reading your blog and I look forward
to your new updates.

_ http://sangabriel.mrdrain.com/ ― 2017年02月12日 21:01

Ahaa, its pleasant dialogue on the topic of this post at this place at this web site, I have read all that, so
at this time me also commenting here.

_ clearlake.mrdrain.com ― 2017年02月13日 13:40

Excellent goods from you, man. I&#39;ve understand your stuff previous to and you are just too great.
I really like what you have acquired here, certainly
like what you are saying and the way in which you say it.
You make it enjoyable and you still take care of to keep
it sensible. I can&#39;t wait to read much more from you.
This is actually a great website.

_ grassvalley.mrdrain.com ― 2017年02月15日 00:48

My brother recommended I might like this blog. He used to be entirely right.
This put up truly made my day. You cann&#39;t believe
simply how so much time I had spent for this info! Thanks!

_ minecraft ― 2017年02月16日 12:59

It&#39;s in fact very difficult in this busy life to listen news on TV, so I only use internet
for that reason, and obtain the most recent news.

_ tinder dating site ― 2017年02月17日 04:17

Hi there to all, how is everything, I think every one
is getting more from this web page, and your
views are pleasant in support of new people.

_ minecraft ― 2017年02月17日 06:40

I read this paragraph completely regarding the difference of hottest and
previous technologies, it&#39;s remarkable article.

_ minecraft ― 2017年02月18日 09:17

It&#39;s very straightforward to find out any matter on net as compared to books, as I found this post at this web site.

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

Wow, this post is pleasant, my sister is analyzing such things, thus I am going to convey her.

_ minecraft ― 2017年02月19日 01:38

Excellent beat ! I would like to apprentice while you amend
your web site, how could i subscribe for a blog website?
The account aided me a acceptable deal. I had been tiny bit acquainted of this your broadcast offered
bright clear idea

_ minecraft ― 2017年02月24日 12:27

I am now not sure the place you are getting your
information, however good topic. I needs to spend some
time learning more or working out more. Thank you for fantastic information I used to be
in search of this info for my mission.

_ minecraft ― 2017年02月24日 22:27

I was wondering if you ever thought of changing the
page layout of your website? Its very well written; I love
what youve got to say. But maybe you could a little more in the way of content so
people could connect with it better. Youve got an awful lot of text for only having one or two pictures.
Maybe you could space it out better?

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

トラックバック

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