home *** CD-ROM | disk | FTP | other *** search
/ PC User 2001 August / APC_Aug2001_CD2.iso / features / devtools / files / lb202win.exe / LB202W.EXE / SEGMENT.BAS < prev    next >
Encoding:
BASIC Source File  |  2000-12-09  |  1.2 KB  |  46 lines

  1.  
  2.     'segment.bas
  3.     'This program demonstrates the use of graphics
  4.     'segments.  Five graphic segments are drawn, and
  5.     'then the second and fourth are deleted.  Then
  6.     'the window is redrawn, causing the first, third,
  7.     'and fifth segments to be redrawn automatically.
  8.  
  9.     'Open a graphics window
  10.     open "segment demo" for graphics as #draw
  11.     print #draw, "trapclose [quit]"
  12.  
  13.     'Set up a large font and put the pen in the
  14.     'upper left corner
  15.     print #draw, "font arial 20"
  16.     print #draw, "place 10 25"
  17.  
  18.     'Draw the words ONE, TWO, THREE, FOUR and FIVE
  19.     'each in its own segment (this is done with the
  20.     'flush command).
  21.     print #draw, "\ONE"
  22.     print #draw, "flush"
  23.     print #draw, "\TWO"
  24.     print #draw, "flush"
  25.     print #draw, "\THREE"
  26.     print #draw, "flush"
  27.     print #draw, "\FOUR"
  28.     print #draw, "flush"
  29.     print #draw, "\FIVE"
  30.     print #draw, "flush"
  31.  
  32.     'Now delete the second and fourth segments, leaving
  33.     'only the drawn words ONE, THREE, and FIVE
  34.     print #draw, "delsegment 2"
  35.     print #draw, "delsegment 4"
  36.  
  37.     'Now redraw so that the graphics will be displayed
  38.     'without the deleted segments.
  39.     print #draw, "redraw"
  40.  
  41.     wait
  42.  
  43. [quit]
  44.     close #draw
  45.     end
  46.