home *** CD-ROM | disk | FTP | other *** search
/ AMOS PD CD / amospdcd.iso / sourcecode / subroutines / ascii_print.amos / ascii_print.amosSourceCode
AMOS Source Code  |  1978-01-05  |  1KB  |  84 lines

  1. ' *******************
  2. ' *** ASCII PRINT ***
  3. ' *******************
  4.  
  5. ' *** This routine prints out an ASCII text file, with page numbering. 
  6.  
  7. ' *** Open screen. 
  8.  
  9. Screen Open 0,640,200,2,Hires
  10. Curs Off 
  11. Flash Off 
  12. Cls 0
  13. Palette $0,$FFC
  14.  
  15. ' *** Select file. 
  16.  
  17. F$=Fsel$("","","PRINT ASCII FILE")
  18.  
  19. If F$=""
  20.    Screen Close 0
  21.    Direct 
  22. End If 
  23.  
  24. ' *** Open file. 
  25.  
  26. Set Input 10,-1
  27. Open In 1,F$
  28.  
  29. ' *** Set page line-length.
  30.  
  31. ML=55
  32.  
  33. ' *** Reset variables. 
  34.  
  35. L=1
  36. PG=1
  37.  
  38. ' *** Print file.
  39.  
  40. While Not Eof(1)
  41.    
  42.    Line Input #1,A$
  43.    Lprint A$
  44.    Print Mid$(A$,1,80)
  45.    
  46.    Inc L
  47.    
  48.    ' *** If end of page, print page number. 
  49.    
  50.    If L>=ML
  51.       
  52.       Lprint 
  53.       Lprint 
  54.       Lprint 
  55.       Lprint "*** PAGE :"+Str$(PG)+" ***"
  56.       Lprint Chr$(12)
  57.       
  58.       PG=PG+1
  59.       L=1
  60.       
  61.    End If 
  62.    
  63. Wend 
  64.  
  65. ' *** Close file.
  66.  
  67. Close 
  68.  
  69. ' *** Print final page number. 
  70.  
  71. If L<ML
  72.    
  73.    For A=L To ML
  74.       Lprint 
  75.    Next A
  76.    
  77.    Lprint "*** PAGE :"+Str$(PG)+" ***"
  78.    Lprint Chr$(12)
  79.    
  80. End If 
  81.  
  82. ' *** Quit.
  83.  
  84. Direct