home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 15 / CDACTUAL15.iso / cdactual / program / basic / PGL.ZIP / PGLBS.ZIP / LINEPAT.BAS < prev    next >
Encoding:
BASIC Source File  |  1992-01-20  |  1.5 KB  |  55 lines

  1. '****************************************************************************
  2. '  LINEPAT.BAS
  3. '
  4. '  This sample program demonstrates the predefined linestyles.
  5. '****************************************************************************
  6. '$INCLUDE: 'PGL.BAS'
  7.  
  8.    dfile$="LINEPAT.PLT"
  9.    DIM linepatterns(8) AS STRING*25
  10.  
  11.    linepatterns(0) = "SOLID LINE" 
  12.    linepatterns(1) = "HUGE DASH LINE" 
  13.    linepatterns(2) = "LARGE DASH LINE" 
  14.    linepatterns(3) = "MEDIUM DASH LINE" 
  15.    linepatterns(4) = "SMALL DASH LINE" 
  16.    linepatterns(5) = "WIDE DOT LINE" 
  17.    linepatterns(6) = "CLOSE DOT LINE" 
  18.    linepatterns(7) = "DASH DOT LINE" 
  19.    linepatterns(8) = "CENTER LINE"    
  20.  
  21. ' ****   LienPat main procedure   ****  
  22. '    
  23. '    Open A Drawing File.
  24. '    
  25.    call pgInitDrw( dfile$, 2000, 2000, ierr% ) 
  26.    if ierr% <> 0 then
  27.       print "Error Opening Drawing File: " + dfile$ + " !"
  28.       goto exitpgm
  29.    endif
  30.    
  31.    call pgSetTextStyle( pgTRIPLEX ) 
  32.    call pgSetTextJustify( pgLEFT, pgBOTTOM ) 
  33.    call pgSetCharSpacing( 3 ) 
  34.    call pgSetTextScaling( 2, 1, 2, 1 ) 
  35.    call pgSetColor( 1 ) 
  36.  
  37.    maxx% = pgGetMaxX%
  38.  
  39. ' Set line styles and draw 'em.
  40.    y% = 200
  41.    FOR j% = 0 TO 8 
  42.        print linepatterns(j%)
  43.        call pgSetLineStyle( j%, 10 ) 
  44.        call pgSetLineWeight( 50 ) 
  45.        call pgLine( 0, y%, maxx% / 2, y% ) 
  46.        call pgDrawTextXY( maxx% / 2 + 100, y%, linepatterns(j%) ) 
  47.        y% = y% + 200 
  48.    NEXT
  49.  
  50. ' Close The Drawing File. 
  51.    call pgEndDrw 
  52.  
  53. exitpgm:
  54. end
  55.