Category : Miscellaneous Language Source Code
Archive   : HF0258.ZIP
Filename : BMAIN.FOR

 
Output of file : BMAIN.FOR contained in archive : HF0258.ZIP
C************ The main program (B) ***************
C This program reads a character, if any, from the keyboard and
C prints the character if a character was entered. If an "x" was
C entered the program terminates, otherwise the program continues
C in the loop.

program test
character*1 char1, Getch

write(*,*) 'Press any key'
write(*,*) 'Press x to terminate'
write(*,*)

do 10 i=1,500000
char1=Getch()
if(char1.ne.char(0)) then
write(*,*) 'Character entered: ',char1,
+ ' at loop number ',i
if (char1.eq.'x') goto 30
write(*,*) 'Press x to terminate'
write(*,*)
endif
10 continue
write(*,*) 'Loop terminated, no character was
+ entered'
stop
30 write(*,*) 'Loop terminated at loop number ',i

end

C***************************************************


  3 Responses to “Category : Miscellaneous Language Source Code
Archive   : HF0258.ZIP
Filename : BMAIN.FOR

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/