* -- declare/initialize topping arrays
declare topleft[15]
declare toprite[15]
declare topboth[15]
declare topdesc[15]
topdesc = mkarray( 'Extra Sauce', 'Double Cheese',  'Onions', ;
                   'Pepperoni',   'Mushrooms',      'Green Peppers', ;
                   'Ham',         'Pineapple',      'Hot Peppers', ;
                   'Olives',      'Sausage',        'Bacon', ;
                   'Anchovies',   'Ground Beef',    'Tomatoes' )

* -- initialize variables
pizza_butt = ' '
clearit = ' '
doubleit = ' '
qty = 2 
size = 2
style = 1
itemcount = 0
pricepie1 = 8.99
pricexitems = 2.40
pricexpies = 5.00
pricetotal = 16.39
gPie_save = ' '
gPie_cancel = ' '
comment = 'extra crispy' + space(20)
topleft[2]=1
topleft[4]=1
topleft[5]=1
topleft[6]=1
toprite[2]=1
toprite[4]=1
toprite[5]=1
toprite[6]=1
toppingl='PMG2'
toppingr='PMG2'


* -- make the screen look nice
set color to n/p
clear
titlefont='Helvetica Bold Italic'
titlefontsize = 20
set color to r/w
@ .2,15 to 2,61 double clear
@ 1.2,18 say "Pizza World" color 'r/w' font titlefont,titlefontsize
@ 1.2,35 say 'Pizza Builder' font titlefont,titlefontsize color 'b/w'
set color to n/p
set delimiters on
set fullread on
@ 3.0,2  say 'Quantity'
@ 3.0,45 say 'Left Side'
@ 4.5,45 say toppingl color 'b/p'
@ 3.0,61 say 'Right Side'
@ 4.5,61 say toppingr color 'b/p'

* -- get the fields for the screen
@ 4.5,2  get pizza_butt picture '@*N ~Pizza' size 1.5,6 valid countpizza()
@ 4.5,9  get qty spinner 1,1,200 size 1,6 picture '999' valid calcpizza()
@ 4.0,16 get size  picture '@*R Small-10";Medium-12";Large-15";Dominator' color 'n/p' valid calcpizza()
@ 4.0,30.5 get style picture '@*R Regular Thick;Thin;Extra Thin' size 1,14,.5 color 'n/p'
@ 6.5,45 get comment  size 1,29
for i = 1 to 5
    for j = 1 to 3
        @ 2*(i-1)+9.4,23*(j-1)+2  get topleft[3*(i-1)+j] picture '@*CN' valid topping( 'L' )
        @ 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' )
        @ 2*(i-1)+9.4,23*(j-1)+19 get toprite[3*(i-1)+j] picture '@*CN' valid topping( 'R' )
    next j
next i
@ 11,68 get clearit  picture '@*T ~Clear'  size 3,7 valid topping( 'C' )
@ 14.5,68 get doubleit picture '@*T ~Double' size 3,7 valid topping( 'D' )
@ 18,68 get doubleit picture '@*T Com~bo' size 3,7 valid topping( 'X' )
@ 8.7,1 to 18.7,76      && draw a box
@ 21,40 say 'Items: ' + str(itemcount)
@ 21,35 say 'First Pizza: ' + transform(pricepie1, '@$ 9999.99' )
@ 22,35 say 'Extra Items: ' + transform(pricexitems, '@$ 9999.99' )
@ 23,35 say 'Extra Pizza: ' + transform(pricexpies, '@$ 9999.99' )
@ 24,35 say 'Total Pizza: ' + transform(pricetotal, '@$ 9999.99' )
@ 22,58 to 24.5,66 get gPie_save picture '@*T ~Save' color 's/p'
@ 22,67 to 24.5,75 get gPie_cancel picture '@*T ~Cancel' color 'r/p'
@ 27,23 say '(c) 1994 On-Line Data (519) 579-3930' font 'Helvetica',9 color 'n/p'

read

* -- this routine would calculate the cost of the pizza(s) based on
* -- size, crust type, and topping(s) selected
function calcpizza
* this is a stub of the real routine
return .t.

* -- this routine would increase the number of pizzas to use
* -- for the cost calculation
function countpizza
* this is a stub of the real routine
return .t.
