'CM3DEMO2.BAS is an example program that shows how the file COLORS50.PAL  
'was included in a VGA graphics program. To see the file choose  
'Included Lines from the View menu.
       
        'set screen mode before $INCLUDE metacommand
        'screen 13 allows up to 255 foreground colors
        'with 320 x 200 resolution
        'to set the background color assign a color number
        'to attribute 0 (the default is black)
        'PALETTE 0, ColorNumber&
        'ColorNumber& = (blue% * (256 ^ 2)) + (green% * 256) + red%
        SCREEN 13
        CLS

        'include the file with the PALETTE statements
        REM $INCLUDE: '50COLORS.PAL'

        'draw bars using extended ASCII character #219
        FOR j% = 1 TO 50
           COLOR j%
           PRINT STRING$(8, 219);
        NEXT j%

        'draw 50 lines, one in each color
        FOR j% = 1 TO 50
           LINE (20, 85 + (j% * 2))-(300, 85 + (j% * 2)), j%
        NEXT j%

        'draw 50 circles, one in each color
        FOR j% = 1 TO 50
           CIRCLE (145 + j%, 135), 50, j%
        NEXT j%

        'wait for a key
        DO: LOOP WHILE INKEY$ = ""

        'return screen to text mode and 80 column width, end program
        SCREEN 0
        WIDTH 80
        CLS
        END

