detab,entabの拡張2014年11月08日 21:45

detab,entabを拡張します。引数でタブ位置の情報を渡せるようにします。

     detab 1 5 10 15 20
     entab 2 6 11 18 30

さらに、

     detab 1 +5
     entab 5 +6

はじめのは、タブ位置をそのまま引数で渡します。次のは、最初の引数を元に、次の引数で、インクリメンタルにタブ位置を計算します。

最初の版settab2.forを示します。

c settab2.for -- set initial tab stops
      subroutine settab(tabs)
      integer tabs(81)                  ! MAXLINE(81)
      integer*1 argv(81)                ! MAXLINE(81)
      integer argc,junk,t,tpos
      integer ctoi,getarg,mod

      do 10 tpos=1,81
          tabs(tpos) = 0                ! NO(0)
   10     continue
   
      if (getarg(1,argv,81) .eq. -1) then ! MAXLINE(81) EOF(-1)
          tpos = 1
          while (tpos .le. 81) do       ! MAXLINE(81)
              if (mod(i,8) .eq. 1) then
                  tabs(i) = 1           ! YES(1)
              endif
              tpos = tpos + 1
          end while
      else
          junk = 1
          tpos = ctoi(argv,junk)
          if ((tpos .gt. 0) .and. (tpos .le. 81)) then
              tabs(tpos) = 1            ! YES(1)
          end if
          if (getarg(2,argv,81) .ne. -1) then ! MAXLINE(81)
              if (argv(1) .eq. 43) then ! PLUS(43)
                  junk = 1
                  t = ctoi(argv,junk)
                  while (tpos .le. 81) do
                      tabs(tpos) = 1    ! YES(1)
                      tpos = tpos + t
                  end while
              else
                  junk = 1
                  tpos = ctoi(argv,junk)
                  if ((tpos .gt. 0) .and. (tpos .le. 81)) then
                      tabs(tpos) = 1    ! YES(1)
                  end if
                  argc = 3
                  while (getarg(argc,argv,81) .ne. -1) do ! MAXLINE(81) EOF(-1)
                      junk = 1
                      tpos = ctoi(argv,junk)
                      if ((tpos .gt. 0) .and. (tpos .le. 81)) then ! MAXLINE(81)
                          tabs(tpos) = 1 ! YES(1)
                      end if
                      argc = argc + 1
                  end while
              end if
          else
              tabs(tpos) = 1            ! YES(1)
          endif
      end if
      return
      end

見通しが悪く、長ったらしくなってしまいました。

ここで、下請けルーチン、インクリメンタル型の引数を確認するtabincr(),タブ位置が範囲に入っているかを調べるtabbound()を導入します。

tabincr()は以下の通り。

c tabincr.for -- return YES if incrimentsl tab set
      integer function tabincr()
      integer*1 argv(81)                ! MAXLINE(81)
      integer getarg

      if (getarg(2,argv,81) .eq. -1) then ! MAXLINE(81) EOF(-1)
          tabincr = 0                   ! NO(0)
      else
          if (argv(1) .eq. 43) then     ! PLUS(43)
              tabincr = 1               ! YES(1)
          else
              tabincr = 0               ! NO(0)
          end if
      end if
      return
      end

tabbound()は以下の通り。

c tabbound -- check tab position boundary
      integer function tabbound(tab,tabmin,tabmax)
      integer tab,tabmin,tabmax

      if ((tabmin .ge. tab) .and. (tab .le. tabmax)) then
          tabbound = 1                  ! YES(1)
      else
          tabbound = 0                  ! NO(0)
      end if
      return
      end

これらを使ったsettab()は以下の通り。

c settab3.for -- set initial tab stops
      subroutine settab(tabs)
      integer tabs(81)                  ! MAXLINE(81)
      integer*1 argv(81)                ! MAXLINE(81)
      integer argc,junk,tincr,tpos
      integer ctoi,getarg,mod,tabincr

      do 10 tpos=1,81
          tabs(tpos) = 0                ! NO(0)
   10     continue
   
      if (getarg(1,argv,81) .eq. -1) then ! MAXLINE(81) EOF(-1)
          tpos = 1
          while (tpos .le. 81) do       ! MAXLINE(81)
              if (mod(tpos,8) .eq. 1) then
                  tabs(tpos) = 1        ! YES(1)
              endif
              tpos = tpos + 1
          end while
      else
          junk = 1
          tpos = ctoi(argv,junk)
          if (tabbound(tpos,1,81) .eq. 1) then ! YES(1)
              if (tabincr() .eq. 1) then ! YES(1)
                  tabs(tpos) = 1        ! YES(1)
                  junk = getarg(2,argv,81) ! MAXLINE(81)
                  junk = 1
                  tincr = ctoi(argv,junk)
                  tpos = tpos + tincr
                  while (tpos .le. 81) do ! MAXLINE(81)
                      tabs(tpos) = 1    ! YES(1)
                      tpos = tpos + tincr
                  end while
              else
                  argc = 2
                  while (getarg(argc,argv,81) .ne. -1) do ! MAXLINE(81) EOF(-1)
                      junk = 1
                      tpos = ctoi(argv,junk)
                      if (tabbound(tpos,1,81) .eq. 1) then ! MAXLINE(1) YES(1)
                          tabs(tpos) = 1 ! YES(1)
                      end if
                      argc = argc + 1
                  end while
              end if
          end if
      end if
      return
      end

多少は見通しが良くなったでしょうか。

コメント

_ Pof And Sign In ― 2015年10月18日 07:21

Incredible points. Outstanding arguments. Keep up the great effort.

_ quest bars cheapest price ― 2015年10月19日 00:40

I've been surfing online more than 2 hours today, yet I never found any interesting article like yours. It's pretty worth enough for me. Personally, if all website owners and bloggers made good content as you did, the net will be a lot more useful than ever before.

_ Pof ― 2015年10月21日 16:02

After I initially commented I seem to have clicked on 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 a way you are able to remove me from that service? Kudos!

_ 3 days match free trial ― 2015年10月23日 20:47

I was wondering if you ever considered changing the structure of your blog? 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 1 or 2 images. Maybe you could space it out better?

_ http://tinyurl.com ― 2015年10月24日 16:26

Hello there! Do you know if they make any plugins to safeguard against hackers? I'm kinda paranoid about losing everything I've worked hard on. Any tips?

_ quest nutrition bars at walmart ― 2015年10月27日 00:54

Your method of describing all in this paragraph is genuinely nice, all be
capable of without difficulty be aware of it, Thanks a
lot.

_ true match free trial ― 2015年10月28日 17:54

Wonderful article! We are linking to this great article on our website.
Keep up the good writing.

_ match.com free trial offers ― 2015年10月28日 19:22

I am not sure where you're getting your info,
but good topic. I needs to spend some time learning much more or understanding more.
Thanks for great info I was looking for this info for my mission.

_ match.com free search ― 2015年10月29日 14:32

Magnificent web site. Lots of helpful info here.
I am sending it to a few pals ans additionally sharing
in delicious. And of course, thanks on your effort!

_ legit ways to make money online ― 2015年11月04日 05:43

Good post. I learn something totally new and challenging on blogs I stumbleupon on a daily basis.
It will always be exciting to read content from other
authors and use something from other websites.

_ forskolin for weight loss ― 2015年11月05日 11:52

I like the valuable info you provide in your articles.
I will bookmark your blog and check again here regularly.
I am quite certain I'll learn many new stuff right here! Good luck for the next!

_ plenty of fish dating site of free dating ― 2015年11月06日 04:03

I absolutely love your site.. Great colors & theme.
Did you develop this website yourself? Please reply back as I'm trying to create my very own blog and would like
to know where you got this from or exactly what the theme is called.
Thanks!

_ plenty of fish dating site of free dating ― 2015年11月06日 22:26

I blog quite often and I genuinely thank you for your information. This article has really peaked my interest.
I am going to bookmark your website and keep checking for new information about once per week.
I subscribed to your RSS feed too.

_ plenty of fish dating site of free dating ― 2015年11月07日 06:48

I absolutely love your website.. Excellent colors & theme.

Did you develop this website yourself? Please reply back as
I'm planning to create my very own site and would like to know where you
got this from or what the theme is named. Cheers!

_ justin bieber dating ― 2015年11月09日 09:57

This design is wicked! You most certainly know how to keep a reader amused.
Between your wit and your videos, I was almost moved
to start my own blog (well, almost...HaHa!) Excellent job.
I really enjoyed what you had to say, and more than that,
how you presented it. Too cool!

_ justin bieber dating ― 2015年11月09日 14:02

Hello it's me, I am also visiting this web page daily, this site is actually fastidious
and the visitors are truly sharing nice thoughts.

_ kroger feedback ― 2015年11月12日 13:37

Thanks for ones marvelous posting! I genuinely enjoyed reading it, you're a great
author.I will ensure that I bookmark your blog and will eventually come back
sometime soon. I want to encourage you to continue your great job, have a nice weekend!

_ kroger digital coupons paperless ― 2015年11月17日 09:03

After going over a handful of the blog articles on your web page, I seriously appreciate your way of writing a blog.
I saved it to my bookmark site list and will be
checking back soon. Please check out my website
as well and tell me how you feel.

_ www.Krogerfeedback.com ― 2015年12月05日 00:15

Howdy! I realize this is sort of off-topic however I needed to ask.

Does operating a well-established blog such as yours
require a lot of work? I am completely new to running
a blog however I do write in my diary every day.
I'd like to start a blog so I can easily share my own experience and feelings
online. Please let me know if you have any kind of suggestions or tips for brand new aspiring
bloggers. Thankyou!

_ krogerfeedback.com ― 2015年12月09日 18:49

constantly i used to read smaller content which as
well clear their motive, and that is also happening with this paragraph
which I am reading now.

_ Descargar Facebook para PC ― 2015年12月23日 06:38

I have to thank you for the efforts you have put in penning
this website. I really hope to see the same high-grade content from you in the future
as well. In truth, your creative writing abilities has encouraged me to get my very own site now ;
)

_ descargar facebook ― 2015年12月23日 08:08

If you want to grow your knowledge simply keep visiting this site
and be updated with the latest gossip posted here.

_ krogerfeedback.com ! ― 2016年01月01日 02:29

It's going to be finish of mine day, but before end I am reading this impressive post to improve my experience.

_ Descargar Firefox ... ― 2016年01月06日 10:23

Hurrah! After all I got a blog from where
I be capable of in fact obtain useful data regarding my study
and knowledge.

_ quest bars ― 2016年02月08日 20:05

Today, I went to the beach front with my kids.
I found a sea shell and gave it to my 4 year old
daughter and said "You can hear the ocean if you put this to your ear." She placed the shell to her ear
and screamed. There was a hermit crab inside and
it pinched her ear. She never wants to go back!
LoL I know this is totally off topic but I had to tell someone!

_ quest bars ― 2016年02月09日 14:08

I am not sure where you're getting your info, but great topic.
I needs to spend some time learning more or understanding more.
Thanks for fantastic info I was looking for this information for my mission.

_ minecraft.exe ― 2016年02月21日 21:36

Hello, I enjoy reading all of your article. I like to
write a little comment to support you.

_ bernie sanders ― 2016年04月01日 00:28

Hey just wanted to give you a quick heads up. The words
in your post seem to be running off the screen in Chrome.

I'm not sure if this is a formatting issue
or something to do with internet browser compatibility but I figured I'd post to let you know.
The style and design look great though! Hope you get the issue
resolved soon. Thanks

_ www.krogerfeedback.com ― 2016年06月06日 01:55

It's awesome to pay a quick visit this web site and reading the views of all friends regarding this piece of
writing, while I am also eager of getting familiarity.

_ Mincraft ― 2016年07月03日 05:03

Just desire to say your article is as surprising.
The clarity for your submit is just nice and i could think
you're an expert on this subject. Well with your permission let me
to clutch your RSS feed to stay updated with coming near near post.
Thank you one million and please continue the enjoyable work.

_ t.co ― 2016年07月09日 14:22

This is a topic that is close to my heart...

Many thanks! Where are your contact details though?

_ t.co ― 2016年07月09日 14:56

Hello i am kavin, its my first occasion to commenting anyplace, when i read
this paragraph i thought i could also create comment due to this brilliant article.

_ www.krogerfeedback.com ― 2016年07月14日 20:07

You have made some really good points there. I checked on the internet to
find out more about the issue and found most individuals will go along with your views on this
website.

_ www.krogerfeedback.com ― 2016年07月26日 02:49

Hello! This post couldn't be written any better!
Reading this post reminds me of my good old room mate!
He always kept talking about this. I will forward this write-up to him.
Fairly certain he will have a good read. Many thanks for sharing!

_ www.krogerfeedback.com ― 2016年07月30日 17:50

Nice post. I was checking constantly this blog and I am impressed!
Very useful information specially the last part
:) I care for such info a lot. I was seeking this certain information for a
very long time. Thank you and best of luck.

_ Mincraft ― 2016年08月12日 14:36

Terrific post however I was wanting to know if you could write a litte more on this topic?
I'd be very thankful if you could elaborate a little bit further.
Thanks!

_ fix connections to bluetooth audio devices and wireless displays in windows 10 ― 2016年08月19日 06:15

I was wondering if you ever thought of changing the structure of your
blog? 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?

_ fix connections to bluetooth audio devices and wireless displays in windows 10 ― 2016年08月19日 07:00

Hi there to every , since I am truly keen of reading this website's post to be updated regularly.
It includes nice information.

_ Windows 10 Free Upgrade ― 2016年09月14日 10:34

Do you mind if I quote a couple of your posts
as long as I provide credit and sources back to your webpage?
My website is in the very same area of interest as yours
and my users would certainly benefit from some
of the information you provide here. Please let me know if this
alright with you. Thanks a lot!

_ quest bars ― 2016年09月24日 11:32

I do accept as true with all of the ideas you've presented on your post.
They are really convincing and will certainly work.
Nonetheless, the posts are too short for novices. Could you please extend them a little
from next time? Thanks for the post.

_ plenty of fish dating site of free dating ― 2016年10月04日 07:08

After I initially left a comment I seem to have clicked on the -Notify me when new comments are added- checkbox and now every time a comment is added I
recieve four emails with the same comment. There has to be a means you are able
to remove me from that service? Thanks!

_ minecraft ― 2016年10月11日 09:49

I have been exploring for a bit for any high quality
articles or blog posts in this sort of area .
Exploring in Yahoo I finally stumbled upon this website.
Studying this info So i am glad to show that I have an incredibly just right uncanny feeling I found out just what
I needed. I most certainly will make sure to don?t forget this web site and
give it a glance regularly.

_ mini juegos de minecraft ― 2016年10月15日 02:12

Oh my goodness! Incredible article dude! Thank you, However I am going through troubles with
your RSS. I don't understand why I can't join it.
Is there anybody else getting similar RSS problems?

Anybody who knows the solution can you kindly respond?
Thanx!!

_ gamefly 3 month free trial ― 2016年11月16日 10:39

Fabulous, what a website it is! This blog provides useful information to us, keep it up.
Gamefly 3 month free trial

_ quest nutrition quest protein bar ― 2016年11月20日 00:56

There's certainly a great deal to learn about this topic. I really like all the points you have made.

_ free dating sites no fees ― 2016年12月10日 01:26

What's up, I desire to subscribe for this webpage to get most recent updates, thus where can i do it please assist.

_ Gamefly Free Trial ― 2016年12月18日 09:43

Can you tell us more about this? I'd want to find out more details.

_ Gamefly Free Trial ― 2016年12月19日 01:13

I'm very pleased to find this great site. I wanted to thank
you for your time just for this fantastic read!!

I definitely savored every little bit of it and I have you book-marked to
check out new information in your blog.

_ Gamefly Free Trial ― 2016年12月19日 17:23

You should take part in a contest for one of the most useful
websites online. I'm going to recommend this web site!

_ Gamefly Free Trial ― 2016年12月20日 16:54

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's tryiong none the less. I've been using Movable-type on a variety of websites for about a year
and am anxious about switching to another platform.
I have heard great things about blogengine.net.
Is there a way I can import all my wordpress content into it?

Any help would be really appreciated!

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

トラックバック

このエントリのトラックバックURL: http://kida.asablo.jp/blog/2014/11/08/7486361/tb