home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / progrmng / qbgrphcs.sit / segview.bas / segview.bas
Encoding:
BASIC Source File  |  1991-04-21  |  1.3 KB  |  51 lines  |  [TEXT/MSBB]

  1. '------------------------------------------------------------------------------
  2. ' TITLE:    segview
  3. ' DATE:     March 11, 1991
  4. ' AUTHOR: R. Gonzalez
  5. '
  6. ' DESCRIPTION:  Show segments stored in appropriate format by segmaker.
  7. '            Also demonstrates how to print graphics.
  8. '
  9. ' COMPILING:    Remove STATIC declarations, uncomment indicated lines
  10. '     Check: Include MBPCs & MBLCs, Include runtime code, Make all arrays static,
  11. '     Use default window & menu, (if available: Generate 68020 & 68881 code).
  12. '
  13. ' (MODIFICATION HISTORY)
  14. ' DATE:      
  15. ' AUTHOR: 
  16. ' DESCRIPTION:   
  17. '------------------------------------------------------------------------------
  18.  
  19. 'MAIN
  20.  
  21.     DIM i%,no.segments%,seg.length%
  22.     DIM seg$(100),filename$,junk$
  23.  
  24.     filename$ = FILES$(1,"TEXT")
  25.     OPEN filename$ FOR INPUT AS #1
  26.     INPUT #1, no.segments%
  27.  
  28.     FOR i% = 1 TO no.segments%
  29.         INPUT #1, seg.length%
  30.         seg$(i%) = INPUT$(seg.length%,#1)
  31.         INPUT #1, junk$
  32.         PICTURE ,seg$(i%)
  33.     NEXT
  34.     
  35.     CLOSE #1
  36.  
  37.     LOCATE 1,1
  38.     INPUT "Print results (y or n)";choice$
  39.     IF choice$ = "y" OR choice$ = "Y" THEN
  40.         OPEN "lpt1:prompt" FOR OUTPUT AS #2
  41.         WINDOW OUTPUT #2
  42.  
  43.         FOR i% = 1 TO no.segments%
  44.             PICTURE ,seg$(i%)
  45.         NEXT i%
  46.  
  47.         CLOSE #2
  48.     END IF
  49.  
  50. END
  51.