home *** CD-ROM | disk | FTP | other *** search
-
- **************
- * Program: grphdemo.prg
- * Author : Roger J. Donnay
- * Date : June 23, 1987
- * Notes : This is a little test program to show you how GRAPH_IT
- * procedures can be called to display different graphs.
- * You can run this from your dbaseiii prompt by typing
- * DO GRPHDEMO on the command line. Be sure that the following
- * files are in the current directory before running:
- * GRAPH_PR.PRG, GRAPH_IT.DBF, SALES.DBF
- *
- ***************
-
- SET TALK OFF
- SET PROC TO graph_pr
- SET BELL OFF
-
- DO WHILE .T.
- CLEAR
- DO setcolor with 'bg'
- @ 1,1 TO 18,78 DOUBLE
- @ 3,2 to 3,77
- @ 16,2 TO 16,77
- DO setcolor WITH 'g'
- @ 2,25 SAY '** GRAPH IT DEMO **'
- @ 4,4 SAY '1 = 1985 Sales (Vertical graph)'
- @ 5,4 say '2 = 1985 Summary Report (Vertical graph)'
- @ 6,4 SAY '3 = 1985 Months we made a profit (Vertical graph)'
- @ 7,4 say '4 = 1985 Profit Percentage (Vertical graph)'
- @ 8,4 say '5 = 1985 Profit $ (Vertical and Horizontal graph)'
- @ 9,4 say '6 = 1985 - 1986 First Quarter Comparisons (Vertical graph)'
- @ 10,4 say '7 = 1985 - 1986 Profit Comparisons (Vertical graph)'
- @ 11,4 say '8 = Months we made more than 5% profit (Horizontal graph)'
- @ 13,4 say 'M = GRAPH FILE MAINTENANCE MENU'
- @ 15,4 SAY 'Q = QUIT'
- KEY=' '
- DO setcolor with 'gr'
- @ 17,4 say 'Enter Selection' GET KEY PICT '!'
- READ
- DO CASE
- CASE KEY='Q'
- SET PROC TO
- RETURN
- CASE KEY='M'
- DO GRPHMENU
- CASE KEY='1'
- CLEAR
- DO grphdrw WITH '100',.F.
- CASE KEY='2'
- CLEAR
- DO grphdrw WITH '101',.F.
- CASE KEY='3'
- CLEAR
- USE sales
- SET FILT TO sales>expenses .AND. year='1985'
- GOTO TOP
- DO grphdrw WITH '101', .t.
- CASE KEY='4'
- CLEAR
- DO grphdrw WITH '102',.F.
- CASE KEY='5'
- CLEAR
- USE sales
- SET FILTER TO year='1985'
- GOTO TOP &&Start at first month of 1985
- STOR ' ' TO mbardesc_1
- STOR 'Profit' TO mbardesc_2
- STOR ' ' TO mbarexpr_1
- STOR 'SALES-EXPENSES' TO mbarexpr_2 && an expression for "profit"
- STOR ' ' TO mbardesc_3,mbardesc_4,mbarexpr_3,mbarexpr_4
- STOR '1985 Profits Summary' TO mtitle
- STOR 'Month' TO mpdesc_1
- STOR 'MONTH' TO mpara_1
- STOR 5000 TO mbar_incr
- STOR 'V' TO mgtype
- STOR 5 TO mp_space
- DO grphdraw && Draw Vertical Bar Graph
- GOTO TOP
- STOR 'H' TO mgtype
- STOR 1 TO mp_space
- DO grphdraw && Draw Horizontal Bar Graph
- CASE KEY='6'
- DO grphdrw WITH '103',.F.
- CASE KEY='7'
- DO grphdrw WITH '104',.F.
- CASE KEY='8'
- DO grphdrw WITH '106',.F.
- ENDCASE
- ENDDO
- RETURN