;Here we use devices and files to›;view a text file from disk.››;Every 21 lines it stops and›;asks if you want to see more.›;Press Q or q to stop and any other›;for the next 21 lines›››MODULE› ›CHAR ARRAY filename(30)›››PROC get_file()›› PrintE("What file do you want to view?")› Print("-> ")› InputS(filename)››RETURN›››BYTE FUNC more()››;more() returns 1 to see more of the›;file and 0 if the user want to quit›› BYTE key,› rval,› i›› Print("more...")› Close(2)›› Open(2,"K:",4,0)› key=GetD(2) ;get a key from the keyboard› Close(2)›››;this section erases the word more by›;printing 7 delete characters ›› FOR i=1 TO 7› DO› PrintF("%C",254)› OD›› IF key='Q OR key='q THEN› rval=0› ELSE› rval=1› FI› FOR i=1 TO 7› DO› Put(126)› OD››RETURN(rval)›››PROC better_read()›› BYTE ARRAY line(50)› BYTE num_lines››› num_lines=0› Close(1) ;make sure the file isn't already open› Open(1,filename,4,0)›› WHILE EOF(1)=0 ;are we at the end?› DO› num_lines=num_lines+1› InputSD(1,line) ; get a line › PrintE(line) ; print it› IF num_lines=21 THEN› num_lines=0› IF more()=0 THEN› EXIT› FI› FI› OD› Close(1)›RETURN››PROC main()›› get_file()› better_read()››RETURN›››