editメインルーチンdocmd() ― 2016年06月12日 11:09
編集機能は、一部の指令を除いて、基本的に個々の下請けルーチンで行う。 ここのルーチンに分岐するメインインルーチンがdocmd()である。長いけれど、コマンドを調べて 分岐するcase分けである。
挿入指令(.)i、変更指令(.,.)c、行番号打ち出し指令(.)=は、これまでのルーチンで実現できる。
挿入指令(.)iは、以下の通り。
else if (lin(i) == INSERT) { status = append(prevln(line2),glob) }
変更指令(.,.)cは、以下の通り。
else if (lin(i) == CHANGE) { if (lin(i+1) == NEWLINE) if (defalt(curln,curln,status) == OK) if (delete(line1,line2,status) == OK) status = append(prevln(line1),glob) } S行番号打ち出し指令(.)=は、以下の通り。
else if (lin(i) == PRINTCUR) { if (ckp(lin,i+1,pflag,status) == OK) { call putdec(line2,1) call putc(NEWLINE) } }
docmd()のRATFOR版を以下に示す。
# docmd.r4 -- handle all commands except globals integer function docmd(lin,i,glob,status) character lin(MAXLINE) integer i,glob,status integer append,doprnt,defalt,nextln,prevln,move,ckp,getone integer dodel,getrhs,subst,getfn,doread,dowrit integer line3 character file(MAXLINE) integer pflag,gflag,optpat include clines.ri include cfile.ri include cpat.ri pflag = NO status = ERR if (lin(i) == APPENDCOM) { if (lin(i+1) == NEWLINE) status = append(line2,glob) } else if (lin(i) == CHANGE) { if (lin(i+1) == NEWLINE) if (defalt(curln,curln,status) == OK) if (delete(line1,line2,status) == OK) status = append(prevln(line1),glob) } else if (lin(i) == DELETE) { if (ckp(lin,i+1,pflag,status) == OK) if (defalt(curln,curln,status) == OK) if (dodel(line1,line2,status) == OK) if (nextln(curln) == 0) curln = nextln(curln) } else if (lin(i) == INSERT) { if (lin(i+1) == NEWLINE) status = append(prevln(line2),glob) } else if (lin(i) == PRINTCUR) { if (ckp(lin,i+1,pflag,status) == OK) { call putdec(line2,1) call putc(NEWLINE) } } else if (lin(i) MOVECOM) { i = i + 1 if (getone(lin,i,line3,status) == EOF) status = ERR if (status == OK) if (ckp(lin,i,pflag,status) == OK) if (defalt(curln,curln,status) ==OK) status = move(line3) } else if (lin(i) == SUBSTITUTE) { i = i + 1 if (optpat(lin,i) == OK) if (getrhs(lin,i,sub,gflag) == OK) if (ckp(lin,i+1,pflag,status) == OK) if (defalt(curln,curln,status) == OK) status = subst(sub,gflag) } else if (lin(i) == ENTER) { if (nlines == 0) then if (getfn(lin,i,file) == OK) { call scopy(file,1,savfil,1) call clrbuf call setbuf status = doread(0,file) } } else if (lin(i) == PRINTFIL) { if (nlines == 0) if (getfn(lin,i,file) == OK) { call scopy(file,1,savfil,1) call putlin(savfil,STDOUT) call putc(NEWLINE) status = OK } } else if (lin(i) == READCOM) { if (getfn(lin,i,file) == OK) status = doread(line2,file) } else if (lin(i) ==WRITECOM) { if (getfn(lin,i,file) == OK) if (defalt(1,lastln,status) == OK) status = dowrit(line1,line2,file) end if } else if (lin(i) == PRINT) { if (lin(i+1) == NEWLINE) if (defalt(curln,curln,status) == OK) status = doprnt(line1,line2) } else if (lin(i) == QUIT) { if (lin(i+1) == NEWLINE & nlines == 0 & glob == NO) status = EOF } # else status is ERR end if if (status == OK & pflag == YES) status = doprnt(curln,curln) docmd = status return end
WATCOM Fortran77版は以下の通り。
c docmd.f -- handle all commands except globals integer function docmd(lin,i,glob,status) integer*1 lin(82) ! MAXLINE(82) integer i,glob,status integer append,doprnt,defalt,nextln,prevln,move,ckp,getone integer dodel,getrhs,subst,getfn,doread,dowrit integer line3 integer*1 file(82) ! MAXLINE(82) integer pflag,gflag,optpat include clines.fi include cfile.fi include cpat.fi pflag = 0 ! NO(0) status = -3 ! ERR(-3) if (lin(i) .eq. 97) then ! APPENDCOM(97 'a') if (lin(i+1) .eq. 10) then ! NEWLINE(10) status = append(line2,glob) end if else if (lin(i) .eq. 99) then ! CHANGE(99,'c') if (lin(i+1) .eq. 10) then ! NEWLINE(10) if (defalt(curln,curln,status) .eq. -2) then ! OK(-2) if (delete(line1,line2,status) .eq. -2) then ! OK(-2) status = append(prevln(line1),glob) end if end if end if else if (lin(i) .eq. 100) then ! DELETE(100,'d') if (ckp(lin,i+1,pflag,status) .eq. -2) then ! OK(-2) if (defalt(curln,curln,status) .eq. -2) then ! OK(-2) if (dodel(line1,line2,status) .eq. -2) then ! OK(-2) if (nextln(curln) .ne. 0) then curln = nextln(curln) end if end if end if end if else if (lin(i) .eq. 105) then ! INSERT(105,'i') if (lin(i+1) .eq. 10) then ! NEWLINE(10) status = append(prevln(line2),glob) end if else if (lin(i) .eq. 61) then ! PRINTCUR(61,'=') if (ckp(lin,i+1,pflag,status) .eq. -2) then ! OK(-2) call putdec(line2,1) call putc(10) ! NEWLINE(10) end if else if (lin(i) .eq. 109) then ! MOVECOM(109,'m') i = i + 1 if (getone(lin,i,line3,status) .eq. -1) then ! EOF(-1) status = -3 ! ERR(-3) end if if (status .eq. -2) then ! OK(-2) if (ckp(lin,i,pflag,status) .eq. -2) then ! OK(-2) if (defalt(curln,curln,status) .eq. -2) then ! OK(-2) status = move(line3) end if end if end if else if (lin(i) .eq. 115) then ! SUBSTITUTE(115,'s') i = i + 1 if (optpat(lin,i)) then if (getrhs(lin,i,sub,gflag) .eq. -2) then ! OK(-2) if (ckp(lin,i+1,pflag,status) .eq. -2) then ! OK(-2) if (defalt(curln,curln,status) .eq. -2) then ! OK(-2) status = subst(sub,gflag) end if end if end if end if else if (lin(i) .eq. 101) then ! ENTER(101,'e') if (nlines .eq. 0) then if (getfn(lin,i,file) .eq. -2) then ! OK(-2) call scopy(file,1,savfil,1) call clrbuf call setbuf status = doread(0,file) end if end if else if (lin(i) .eq. 102) then ! PRINTFIL(102,'f') if (nlines .eq. 0) then if (getfn(lin,i,file) .eq. -2) then ! OK(-2) call scopy(file,1,savfil,1) call putlin(savfil,6) ! STDOUT(6) call putc(10) ! NEWLINE(10) status = -2 ! OK(-2) end if end if else if (lin(i) .eq. 114) then ! READCOM(114,'r') if (getfn(lin,i,file) .eq. -2) then ! OK(-2) status = doread(line2,file) end if else if (lin(i) .eq. 119) then ! WRITECOM(119'w') if (getfn(lin,i,file) .eq. -2) then ! OK(-2) if (defalt(1,lastln,status) .eq. -2) then status = dowrit(line1,line2,file) end if end if else if (lin(i) .eq. 112) then ! PRINT(112 'p') if (lin(i+1) .eq. 10) then ! NEWLINE(10) if (defalt(curln,curln,status) .eq. -2) then ! OK(-2) status = doprnt(line1,line2) end if end if else if (lin(i) .eq. 113) then ! QUIT(113 'q') if ((lin(i+1) .eq. 10) .and. ! NEWLINE(10) 1 (nlines .eq. 0) .and. (glob .eq. 0)) then ! NO(0) status = -1 ! EOF(-1) end if ! else status is ERR end if if ((status .eq. -2) .and. (pflag .eq. 1)) then ! OK(-2) YES(1) status = doprnt(curln,curln) end if docmd = status return end
コメント
_ descargar minecraft ― 2016年10月12日 02:23
_ minecraft ― 2016年10月12日 18:05
Hello! This is my first visit to your blog! We are a
collection of volunteers and starting a new project in a community in the same niche.
Your blog provided us useful information to work on. You have done a outstanding job!
collection of volunteers and starting a new project in a community in the same niche.
Your blog provided us useful information to work on. You have done a outstanding job!
_ minecraft ― 2016年10月13日 19:07
Very nice post. I just stumbled upon your blog and wanted to say that I have truly enjoyed surfing
around your blog posts. After all I will be
subscribing to your feed and I hope you write again very soon!
around your blog posts. After all I will be
subscribing to your feed and I hope you write again very soon!
_ gamefly 3 month free trial ― 2016年11月15日 22:32
This is a topic that's near to my heart... Thank you! Exactly
where are your contact details though? Gamefly 3 month free trial
where are your contact details though? Gamefly 3 month free trial
_ gamefly 3 month free trial ― 2016年11月16日 07:46
Hey! This is my first visit to your blog! We are a team of volunteers and starting
a new project in a community in the same niche. Your blog provided us
useful information to work on. You have done a outstanding job!
Gamefly 3 month free trial
a new project in a community in the same niche. Your blog provided us
useful information to work on. You have done a outstanding job!
Gamefly 3 month free trial
_ http://t.co/a63MxfVM9Q ― 2016年12月01日 18:43
I know this web page provides quality depending posts and other data,
is there any other site which provides such
things in quality?
is there any other site which provides such
things in quality?
_ free dating sites no fees ― 2016年12月10日 08:35
Quality articles or reviews is the key to interest
the visitors to go to see the site, that's what this website is providing.
the visitors to go to see the site, that's what this website is providing.
_ Gamefly Free Trial ― 2016年12月18日 09:13
Hello! Do you use Twitter? I'd like to follow you if that would be
ok. I'm definitely enjoying your blog and look forward to new updates.
ok. I'm definitely enjoying your blog and look forward to new updates.
_ Gamefly Free Trial ― 2016年12月18日 21:32
We're a group of volunteers and starting a new scheme in our community.
Your site provided us with valuable information to work
on. You've done an impressive job and our whole community will be grateful to you.
Your site provided us with valuable information to work
on. You've done an impressive job and our whole community will be grateful to you.
_ Gamefly Free Trial ― 2016年12月21日 10:56
Just wish to say your article is as amazing. The clarity for
your post is just spectacular and that i could suppose you are a professional in this subject.
Well along with your permission let me to grab
your feed to stay up to date with impending post. Thank you 1,000,000
and please carry on the rewarding work.
your post is just spectacular and that i could suppose you are a professional in this subject.
Well along with your permission let me to grab
your feed to stay up to date with impending post. Thank you 1,000,000
and please carry on the rewarding work.
_ www.krogerfeedback.com ― 2016年12月24日 20:20
Hi! I know this is kind of off topic but I was wondering if you knew where I could locate a captcha plugin for my comment form?
I'm using the same blog platform as yours and I'm having trouble finding
one? Thanks a lot!
I'm using the same blog platform as yours and I'm having trouble finding
one? Thanks a lot!
_ www.krogerfeedback.com ― 2016年12月25日 01:12
This piece of writing provides clear idea in support
of the new viewers of blogging, that in fact how to do running a blog.
of the new viewers of blogging, that in fact how to do running a blog.
_ www.krogerfeedback.com ― 2016年12月26日 02:56
Currently it sounds like BlogEngine is the top blogging platform out there right now.
(from what I've read) Is that what you are using on your
blog?
(from what I've read) Is that what you are using on your
blog?
_ www.krogerfeedback.com ― 2016年12月26日 03:13
Hi! This is my first visit to your blog! We are a
group of volunteers and starting a new initiative in a community in the same niche.
Your blog provided us valuable information to work on. You
have done a outstanding job!
group of volunteers and starting a new initiative in a community in the same niche.
Your blog provided us valuable information to work on. You
have done a outstanding job!
_ plenty of fish dating site of free dating ― 2016年12月27日 19:01
Hi! I just would like to give you a huge thumbs up for the
excellent information you've got right here on this post. I am coming back to your site for more
soon.
excellent information you've got right here on this post. I am coming back to your site for more
soon.
_ match.com search for free ― 2017年01月04日 08:30
naturally like your website but you need to take a look at the spelling on quite a
few of your posts. Many of them are rife with spelling issues
and I find it very troublesome to inform the reality however I will definitely come back again.
few of your posts. Many of them are rife with spelling issues
and I find it very troublesome to inform the reality however I will definitely come back again.
_ free dating sites no fees ― 2017年01月06日 09:11
Hi there, I read your new stuff like every week. Your writing style is awesome, keep up the good work!
_ free dating sites no fees ― 2017年01月07日 06:37
Hmm is anyone else experiencing problems with the images on this blog loading?
I'm trying to determine if its a problem on my end or if
it's the blog. Any feedback would be greatly appreciated.
I'm trying to determine if its a problem on my end or if
it's the blog. Any feedback would be greatly appreciated.
_ free dating sites over 50 ― 2017年01月07日 15:33
Good day! Do you use Twitter? I'd like to
follow you if that would be okay. I'm definitely enjoying your
blog and look forward to new updates.
follow you if that would be okay. I'm definitely enjoying your
blog and look forward to new updates.
_ free dating sites online ― 2017年01月08日 15:35
Hi, Neat post. There is an issue with your website in web explorer,
could check this? IE nonetheless is the marketplace leader and a large portion of people will omit your fantastic writing due to this problem.
could check this? IE nonetheless is the marketplace leader and a large portion of people will omit your fantastic writing due to this problem.
_ cheapest quest bars online australia ― 2017年01月10日 03:20
Howdy just wanted to give you a quick heads up. The words in your
post seem to be running off the screen in Safari.
I'm not sure if this is a format issue or something
to do with browser compatibility but I figured I'd post to let you know.
The style and design look great though! Hope you
get the problem solved soon. Cheers
post seem to be running off the screen in Safari.
I'm not sure if this is a format issue or something
to do with browser compatibility but I figured I'd post to let you know.
The style and design look great though! Hope you
get the problem solved soon. Cheers
_ www.krogerfeedback.com ― 2017年01月12日 11:45
What's up, its fastidious article concerning media print, we all be familiar with media is a great source of
data.
data.
_ www.krogerfeedback.com ― 2017年01月13日 01:35
Write more, thats all I have to say. Literally, it seems as though you relied on the video to make your point.
You clearly know what youre talking about, why waste your intelligence on just posting videos
to your weblog when you could be giving us something enlightening to read?
You clearly know what youre talking about, why waste your intelligence on just posting videos
to your weblog when you could be giving us something enlightening to read?
_ www.krogerfeedback.com ― 2017年01月14日 03:38
What i do not realize is in truth how you are not really a lot more smartly-favored than you might be now.
You're very intelligent. You realize therefore considerably
in relation to this subject, produced me in my opinion believe it
from numerous numerous angles. Its like women and men are not involved unless it's
one thing to do with Girl gaga! Your individual stuffs
great. Always deal with it up!
You're very intelligent. You realize therefore considerably
in relation to this subject, produced me in my opinion believe it
from numerous numerous angles. Its like women and men are not involved unless it's
one thing to do with Girl gaga! Your individual stuffs
great. Always deal with it up!
_ www.krogerfeedback.com ― 2017年01月14日 16:54
If you wish for to grow your knowledge only keep visiting this
web site and be updated with the hottest information posted here.
web site and be updated with the hottest information posted here.
_ www.krogerfeedback.com ― 2017年01月15日 09:34
The other day, while I was at work, my cousin stole my
iphone and tested to see if it can survive
a 40 foot drop, just so she can be a youtube sensation.
My apple ipad is now broken and she has 83 views.
I know this is totally off topic but I had to share it with someone!
iphone and tested to see if it can survive
a 40 foot drop, just so she can be a youtube sensation.
My apple ipad is now broken and she has 83 views.
I know this is totally off topic but I had to share it with someone!
_ www.krogerfeedback.com ― 2017年01月21日 03:29
Very nice post. I just stumbled upon your weblog and wanted to say that
I've truly enjoyed browsing your blog posts.
After all I'll be subscribing to your feed and I hope you write again very soon!
I've truly enjoyed browsing your blog posts.
After all I'll be subscribing to your feed and I hope you write again very soon!
_ you can visit www.krogerfeedback.com webpage ― 2017年01月26日 16:15
If some one needs to be updated with hottest technologies after that he must be pay a quick visit this web page and
be up to date every day.
be up to date every day.
_ i love the www.krogerfeedback.com online site ― 2017年01月27日 13:13
What a stuff of un-ambiguity and preserveness of valuable knowledge regarding unexpected feelings.
_ tinyurl.com ― 2017年01月28日 09:02
Hey! This is my first visit to your blog! We are a group of volunteers and starting a new project in a community
in the same niche. Your blog provided us beneficial information to work on. You have done a extraordinary job!
in the same niche. Your blog provided us beneficial information to work on. You have done a extraordinary job!
_ http://tinyurl.com ― 2017年01月29日 05:22
Hey there! Do you use Twitter? I'd like to follow you if that would be
okay. I'm undoubtedly enjoying your blog and look forward to new updates.
okay. I'm undoubtedly enjoying your blog and look forward to new updates.
_ match.com ― 2017年01月31日 07:01
I could not refrain from commenting. Very well
written!
written!
_ match.com ― 2017年01月31日 07:27
I've been surfing online more than 3 hours today, yet
I never found any interesting article like yours. It's pretty worth enough for me.
In my opinion, if all site owners and bloggers made good content as you did,
the net will be a lot more useful than ever before.
I never found any interesting article like yours. It's pretty worth enough for me.
In my opinion, if all site owners and bloggers made good content as you did,
the net will be a lot more useful than ever before.
_ match.com ― 2017年02月01日 01:50
This article is in fact a good one it assists new net viewers,
who are wishing for blogging.
who are wishing for blogging.
_ match.com ― 2017年02月01日 16:32
Your means of describing everything in this article is really fastidious, all can easily understand it, Thanks a lot.
_ minecraft ― 2017年02月03日 04:49
My brother suggested I might like this blog. He used to be totally right.
This put up actually made my day. You can not consider simply how so much
time I had spent for this info! Thank you!
This put up actually made my day. You can not consider simply how so much
time I had spent for this info! Thank you!
_ minecraft ― 2017年02月04日 06:05
It's really very complex in this active life to listen news on Television, thus I only
use internet for that reason, and get the most recent news.
use internet for that reason, and get the most recent news.
_ minecraft ― 2017年02月05日 07:49
I love it when people come together and share views.
Great website, keep it up!
Great website, keep it up!
_ http://j.mp/1UdpKFE ― 2017年02月06日 15:54
Somebody necessarily assist to make severely posts I would
state. This is the first time I frequented your web page and thus far?
I surprised with the research you made to create this actual put up extraordinary.
Excellent task!
state. This is the first time I frequented your web page and thus far?
I surprised with the research you made to create this actual put up extraordinary.
Excellent task!
_ g ― 2017年02月07日 14:12
It's actually a great and helpful piece of info.
I am satisfied that you shared this helpful info with
us. Please stay us up to date like this. Thanks for
sharing.
I am satisfied that you shared this helpful info with
us. Please stay us up to date like this. Thanks for
sharing.
_ twitter.com ― 2017年02月07日 19:11
Hi there I am so excited I found your blog page, I really found you by mistake, while
I was looking on Yahoo for something else, Nonetheless I
am here now and would just like to say many thanks for a tremendous post and a all round thrilling blog (I also love the theme/design),
I don’t have time to read through it all at the minute but
I have saved it and also added your RSS feeds, so when I have
time I will be back to read much more, Please do keep up the awesome jo.
I was looking on Yahoo for something else, Nonetheless I
am here now and would just like to say many thanks for a tremendous post and a all round thrilling blog (I also love the theme/design),
I don’t have time to read through it all at the minute but
I have saved it and also added your RSS feeds, so when I have
time I will be back to read much more, Please do keep up the awesome jo.
_ anderson.mrdrain.com ― 2017年02月12日 04:37
Good post. I learn something totally new and challenging on blogs I stumbleupon everyday.
It will always be exciting to read through content from other
writers and practice a little something from their sites.
It will always be exciting to read through content from other
writers and practice a little something from their sites.
_ http://bell.mrdrain.com/ ― 2017年02月14日 14:57
Wonderful blog! I found it while searching on Yahoo News.
Do you have any suggestions on how to get listed in Yahoo
News? I've been trying for a while but I never seem to
get there! Many thanks
Do you have any suggestions on how to get listed in Yahoo
News? I've been trying for a while but I never seem to
get there! Many thanks
_ minecraft ― 2017年02月16日 00:29
Ridiculous quest there. What happened after? Take care!
_ tinder dating site ― 2017年02月16日 23:36
Write more, thats all I have to say. Literally, it seems as though you
relied on the video to make your point. You clearly know what youre talking about, why throw away your intelligence
on just posting videos to your weblog when you could be
giving us something informative to read?
relied on the video to make your point. You clearly know what youre talking about, why throw away your intelligence
on just posting videos to your weblog when you could be
giving us something informative to read?
_ minecraft ― 2017年02月17日 01:57
What a information of un-ambiguity and preserveness of precious knowledge
about unexpected feelings.
about unexpected feelings.
_ tinder dating site ― 2017年02月17日 13:13
Hey there would you mind letting me know which webhost you're using?
I've loaded your blog in 3 different browsers and I
must say this blog loads a lot quicker then most.
Can you recommend a good hosting provider at a reasonable price?
Cheers, I appreciate it!
I've loaded your blog in 3 different browsers and I
must say this blog loads a lot quicker then most.
Can you recommend a good hosting provider at a reasonable price?
Cheers, I appreciate it!
_ tinder dating site free ― 2017年02月18日 03:45
whoah this weblog is wonderful i like reading your articles.
Keep up the good work! You already know, many individuals are looking around for this info, you can help them greatly.
Keep up the good work! You already know, many individuals are looking around for this info, you can help them greatly.
_ minecraft ― 2017年02月18日 08:52
I visited many blogs however the audio feature for audio songs
present at this web site is truly fabulous.
present at this web site is truly fabulous.
_ minecraft ― 2017年02月19日 03:24
Wow, this paragraph is nice, my younger sister is analyzing these kinds of things, thus I am going
to inform her.
to inform her.
※コメントの受付件数を超えているため、この記事にコメントすることができません。
トラックバック
このエントリのトラックバックURL: http://kida.asablo.jp/blog/2016/06/12/8109684/tb
using? I'm looking to start my own blog soon but
I'm having a tough time making a decision between BlogEngine/Wordpress/B2evolution and Drupal.
The reason I ask is because your design and
style seems different then most blogs and I'm looking for
something completely unique. P.S Sorry for getting off-topic but I
had to ask!