home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Product / Product.zip / oncmd.zip / PIZZA.PRG < prev    next >
Text File  |  1996-02-09  |  3KB  |  96 lines

  1. * -- declare/initialize topping arrays
  2. declare topleft[15]
  3. declare toprite[15]
  4. declare topboth[15]
  5. declare topdesc[15]
  6. topdesc = mkarray( 'Extra Sauce', 'Double Cheese',  'Onions', ;
  7.                    'Pepperoni',   'Mushrooms',      'Green Peppers', ;
  8.                    'Ham',         'Pineapple',      'Hot Peppers', ;
  9.                    'Olives',      'Sausage',        'Bacon', ;
  10.                    'Anchovies',   'Ground Beef',    'Tomatoes' )
  11.  
  12. * -- initialize variables
  13. pizza_butt = ' '
  14. clearit = ' '
  15. doubleit = ' '
  16. qty = 2 
  17. size = 2
  18. style = 1
  19. itemcount = 0
  20. pricepie1 = 8.99
  21. pricexitems = 2.40
  22. pricexpies = 5.00
  23. pricetotal = 16.39
  24. gPie_save = ' '
  25. gPie_cancel = ' '
  26. comment = 'extra crispy' + space(20)
  27. topleft[2]=1
  28. topleft[4]=1
  29. topleft[5]=1
  30. topleft[6]=1
  31. toprite[2]=1
  32. toprite[4]=1
  33. toprite[5]=1
  34. toprite[6]=1
  35. toppingl='PMG2'
  36. toppingr='PMG2'
  37.  
  38.  
  39. * -- make the screen look nice
  40. set color to n/p
  41. clear
  42. titlefont='Helvetica Bold Italic'
  43. titlefontsize = 20
  44. set color to r/w
  45. @ .2,15 to 2,61 double clear
  46. @ 1.2,18 say "Pizza World" color 'r/w' font titlefont,titlefontsize
  47. @ 1.2,35 say 'Pizza Builder' font titlefont,titlefontsize color 'b/w'
  48. set color to n/p
  49. set delimiters on
  50. set fullread on
  51. @ 3.0,2  say 'Quantity'
  52. @ 3.0,45 say 'Left Side'
  53. @ 4.5,45 say toppingl color 'b/p'
  54. @ 3.0,61 say 'Right Side'
  55. @ 4.5,61 say toppingr color 'b/p'
  56.  
  57. * -- get the fields for the screen
  58. @ 4.5,2  get pizza_butt picture '@*N ~Pizza' size 1.5,6 valid countpizza()
  59. @ 4.5,9  get qty spinner 1,1,200 size 1,6 picture '999' valid calcpizza()
  60. @ 4.0,16 get size  picture '@*R Small-10";Medium-12";Large-15";Dominator' color 'n/p' valid calcpizza()
  61. @ 4.0,30.5 get style picture '@*R Regular Thick;Thin;Extra Thin' size 1,14,.5 color 'n/p'
  62. @ 6.5,45 get comment  size 1,29
  63. for i = 1 to 5
  64.     for j = 1 to 3
  65.         @ 2*(i-1)+9.4,23*(j-1)+2  get topleft[3*(i-1)+j] picture '@*CN' valid topping( 'L' )
  66.         @ 2*(i-1)+9.7,23*(j-1)+5  get topboth[3*(i-1)+j] picture '@*N ' + topdesc[3*(i-1)+j] size 1.5,13 valid topping( 'B' )
  67.         @ 2*(i-1)+9.4,23*(j-1)+19 get toprite[3*(i-1)+j] picture '@*CN' valid topping( 'R' )
  68.     next j
  69. next i
  70. @ 11,68 get clearit  picture '@*T ~Clear'  size 3,7 valid topping( 'C' )
  71. @ 14.5,68 get doubleit picture '@*T ~Double' size 3,7 valid topping( 'D' )
  72. @ 18,68 get doubleit picture '@*T Com~bo' size 3,7 valid topping( 'X' )
  73. @ 8.7,1 to 18.7,76      && draw a box
  74. @ 21,40 say 'Items: ' + str(itemcount)
  75. @ 21,35 say 'First Pizza: ' + transform(pricepie1, '@$ 9999.99' )
  76. @ 22,35 say 'Extra Items: ' + transform(pricexitems, '@$ 9999.99' )
  77. @ 23,35 say 'Extra Pizza: ' + transform(pricexpies, '@$ 9999.99' )
  78. @ 24,35 say 'Total Pizza: ' + transform(pricetotal, '@$ 9999.99' )
  79. @ 22,58 to 24.5,66 get gPie_save picture '@*T ~Save' color 's/p'
  80. @ 22,67 to 24.5,75 get gPie_cancel picture '@*T ~Cancel' color 'r/p'
  81. @ 27,23 say '(c) 1994 On-Line Data (519) 579-3930' font 'Helvetica',9 color 'n/p'
  82.  
  83. read
  84.  
  85. * -- this routine would calculate the cost of the pizza(s) based on
  86. * -- size, crust type, and topping(s) selected
  87. function calcpizza
  88. * this is a stub of the real routine
  89. return .t.
  90.  
  91. * -- this routine would increase the number of pizzas to use
  92. * -- for the cost calculation
  93. function countpizza
  94. * this is a stub of the real routine
  95. return .t.
  96.