home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / GRAPH_IT.ZIP / GRPHDEMO.PRG < prev    next >
Encoding:
Text File  |  1987-06-23  |  2.8 KB  |  92 lines

  1.  
  2. **************
  3. * Program: grphdemo.prg
  4. * Author : Roger J. Donnay
  5. * Date   : June 23, 1987
  6. * Notes  : This is a little test program to show you how GRAPH_IT
  7. *          procedures can be called to display different graphs.
  8. *          You can run this from your dbaseiii prompt by typing
  9. *          DO GRPHDEMO on the command line.  Be sure that the following
  10. *          files are in the current directory before running:
  11. *          GRAPH_PR.PRG, GRAPH_IT.DBF, SALES.DBF
  12. *
  13. ***************
  14.  
  15. SET TALK OFF
  16. SET PROC TO graph_pr
  17. SET BELL OFF
  18.  
  19. DO WHILE .T.
  20.   CLEAR
  21.   DO setcolor with 'bg'
  22.   @ 1,1 TO 18,78 DOUBLE
  23.   @ 3,2 to 3,77
  24.   @ 16,2 TO 16,77
  25.   DO setcolor WITH 'g'
  26.   @ 2,25 SAY '** GRAPH IT DEMO **'
  27.   @ 4,4 SAY '1 = 1985 Sales (Vertical graph)'
  28.   @ 5,4 say '2 = 1985 Summary Report (Vertical graph)'
  29.   @ 6,4 SAY '3 = 1985 Months we made a profit (Vertical graph)'
  30.   @ 7,4 say '4 = 1985 Profit Percentage (Vertical graph)'
  31.   @ 8,4 say '5 = 1985 Profit $ (Vertical and Horizontal graph)'
  32.   @ 9,4 say '6 = 1985 - 1986 First Quarter Comparisons (Vertical graph)'
  33.   @ 10,4 say '7 = 1985 - 1986 Profit Comparisons (Vertical graph)'
  34.   @ 11,4 say '8 = Months we made more than 5% profit (Horizontal graph)'
  35.   @ 13,4 say 'M = GRAPH FILE MAINTENANCE MENU'
  36.   @ 15,4 SAY 'Q = QUIT'
  37.   KEY=' '
  38.   DO setcolor with 'gr'
  39.   @ 17,4 say 'Enter Selection' GET KEY PICT '!'
  40.   READ
  41.   DO CASE
  42.     CASE KEY='Q'
  43.       SET PROC TO
  44.       RETURN
  45.     CASE KEY='M'
  46.       DO GRPHMENU
  47.     CASE KEY='1'
  48.       CLEAR
  49.       DO grphdrw WITH '100',.F.
  50.     CASE KEY='2'
  51.       CLEAR
  52.       DO grphdrw WITH '101',.F.
  53.     CASE KEY='3'
  54.       CLEAR
  55.       USE sales
  56.       SET FILT TO sales>expenses .AND. year='1985'
  57.       GOTO TOP
  58.       DO grphdrw WITH '101', .t.
  59.     CASE KEY='4'
  60.       CLEAR
  61.       DO grphdrw WITH '102',.F.
  62.     CASE KEY='5'
  63.       CLEAR
  64.       USE sales
  65.       SET FILTER TO year='1985' 
  66.       GOTO TOP &&Start at first month of 1985
  67.       STOR ' ' TO mbardesc_1
  68.       STOR 'Profit' TO mbardesc_2
  69.       STOR ' ' TO mbarexpr_1
  70.       STOR 'SALES-EXPENSES' TO mbarexpr_2 && an expression for "profit"
  71.       STOR ' ' TO mbardesc_3,mbardesc_4,mbarexpr_3,mbarexpr_4
  72.       STOR '1985 Profits Summary' TO mtitle
  73.       STOR 'Month' TO mpdesc_1
  74.       STOR 'MONTH' TO mpara_1
  75.       STOR 5000 TO mbar_incr
  76.       STOR 'V' TO mgtype
  77.       STOR 5 TO mp_space
  78.       DO grphdraw  && Draw Vertical Bar Graph
  79.       GOTO TOP
  80.       STOR 'H' TO mgtype
  81.       STOR 1 TO mp_space
  82.       DO grphdraw  && Draw Horizontal Bar Graph
  83.     CASE KEY='6'
  84.       DO grphdrw WITH '103',.F.
  85.     CASE KEY='7'
  86.       DO grphdrw WITH '104',.F.
  87.     CASE KEY='8'
  88.       DO grphdrw WITH '106',.F.
  89.   ENDCASE
  90. ENDDO
  91. RETURN
  92.