Announcement

Collapse
No announcement yet.

Shopping List

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Shopping List

    I have been a Power Basic user since PBCC 4. I have PBCC 6.4 but haven't written any programs for several years due to age, 85, and am 90% blind. What you write in an hour takes me a week, because I also have a poor memory and can't remember the commands anymore. My wife got tired of me sitting around all day doing nothing and asked me to write her a program for when she goes shopping. I know she doesn't need it because I wrote her one using Word Perfect 15 years ago. I had to copy the dim's and other top parts from previous programs to be certain that I had full screen and took care of variables. I have hit a snag in printing the program to the printer. I know that we aren't suppose to post a program on this forum, but I have no choice. It would take me another week to find the download section we use to use. Can anyone that has a few minutes take a look at the program and see what I have been doing wrong. It is okay if you decide it isn't worth your time. I fully understand as time is all I have left. I am grateful to be on this side of the sod.

    {code}

    #COMPILE EXE
    #CONSOLE OFF
    #DEBUG ERROR ON
    #INCLUDE "Win32API.inc"

    FUNCTION PBMAIN () AS LONG

    RANDOMIZE(TIMER)

    LOCAL WIDTH8, HEIGHT8, DSKTOPX, DSKTOPY AS LONG
    LOCAL FF, FF2 AS DOUBLE
    LOCAL hFont10, hFont12, hFont15,hFont20, hFont19, hFont25 AS LONG
    LOCAL A, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25 AS LONG
    LOCAL A26, A27, A28, A29, A30, A31, A32, A33, A34, A35, A36, A37, A38, A39, A40, A41, A42, A43, A44, A45 AS LONG
    LOCAL E1, E2, E3, E4, E5, E6, E7, E8, E9, A(), A1(), O1 AS LONG

    LOCAL N$, Z$, Z1$()
    LOCAL AA$, BB$, CC$, EE$, GG$, HH$, II$, JJ$, KK$, LL$, MM$, NN$, OO$, PP$, QQ$, RR$, SS$, TT$, UU$, VV$, WW$, XX$, YY$, ZZ$
    LOCAL AAA$, BBB$, CCC$, DDD$, EEE$, FFF$, GGG$, HHH$, III$, JJJ$, KKK$, LLL$, MMM$, NNN$, OOO$, PPP$
    DIM F$(20)

    LOCAL CX!, CY!, CLICK&
    LOCAL hGW1&, st&, rev&, r&, sa&, se&, sc&, sar&, ser&, hFont&
    LOCAL TXTT1$, nWidth!, nHeight!
    LOCAL kbd$

    '------------------------------------------------------------------

    'do some graphics
    yloc#= 495
    GRAPHIC TEXT SIZE "Lottery" TO tx&,yx&
    GRAPHIC SET POS (-tx&/2,yloc#)

    DESKTOP GET CLIENT TO dsktopx, dsktopy

    GRAPHIC PRINT:GRAPHIC PRINT "lOTTERY"
    GRAPHIC WINDOW "Lottery", 0, 0, 1100, 650 TO hGW1&

    WIDTH8=dsktopx : HEIGHT8=dsktopy
    GRAPHIC SET SIZE WIDTH8, HEIGHT8
    GRAPHIC SCALE (0, 0) - (1100, 650) ' < SCALE to keep original layout

    IF DSKTOPX>=1000 AND DSKTOPX<1100 THEN FF2=1100
    IF DSKTOPX>=1200 AND DSKTOPX<1300 THEN FF2=1200
    IF DSKTOPX>=1300 AND DSKTOPX<1400 THEN FF2=1500
    IF DSKTOPX>=1400 AND DSKTOPX<1500 THEN FF2=1400
    IF DSKTOPX>=1500 AND DSKTOPX<1600 THEN FF2=1300
    IF DSKTOPX>=1600 THEN FF2=1100

    FF=WIDTH8/FF2

    ' ---------------------------------------------------------------------------------------
    '

    STARTUP:
    FONT NEW "Times New Roman", FF*10,1 TO hFont10
    FONT NEW "Times New Roman", FF*12,1 TO hFont12
    FONT NEW "Times New Roman", FF*15,1 TO hFont15
    FONT NEW "Times New Roman", FF*19,1 TO hFont19
    FONT NEW "Times New Roman", FF*20,1 TO hFont20
    FONT NEW "Times New Roman", FF*25,1 TO hFont25

    '
    ' ----------------------------------------------------------------------------------------


    GRAPHIC CLEAR

    GRAPHIC WINDOW STABILIZE ' This make it so the X can not turn off program
    '------------------------------------------------------------------

    GRAPHIC WIDTH 3
    GRAPHIC SET FONT hFont19

    GOSUB INFO5 ' INFO5 IS THE FIRST SCREEN AND EXPLAINS HOW TO PICK AND ERASE SELECTIONS
    '
    ' SELECTION SECTION... FIVE COLUMNS OF SELECTION BOXES AND SHOPPING ITEMS ARE PRINTED
    ' AFTER THEN NAMES ARE PRINTED, THEY ARE ASSIGNED A VARIABLE... SUCH AS AA$="EGGS"
    ' ASKING THE PROGRAM TO GRAPHIC PRINT AA$ (TO SCREEN) OR XPRINT AA$(TO PRINTER) THE WORD EGGS WILL BE PRINTED
    '

    GRAPHIC CLEAR

    CONTINUE: ' Come here when done removing unwanted items previously selectedX
    GRAPHIC BOX (360,80)-(610,120),30,%RED,%RGB_MOCCASIN ' Selection Section Box
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET POS (400,83):GRAPHIC PRINT "Selection Section"
    GRAPHIC SET FONT hFont12
    GRAPHIC BOX (50,140)-(70,160),30,%RED,%RGB_MOCCASIN ' Pick BOX
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET POS (90,140):GRAPHIC PRINT "Eggs":AA$="Eggs"
    GRAPHIC BOX (50,180)-(70,200),30,%RED,%RGB_MOCCASIN ' Pick BOX
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET POS (90,180):GRAPHIC PRINT "Sour Cream":BB$="Sour Cream"
    GRAPHIC BOX (50,220)-(70,240),30,%RED,%RGB_MOCCASIN ' Pick BOX
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET POS (90,220):GRAPHIC PRINT "Lite Creamer":CC$="Lite Cream"
    GRAPHIC BOX (50,260)-(70,280),30,%RED,%RGB_MOCCASIN ' Pick BOX
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET POS (90,260):GRAPHIC PRINT "Milk":EE$="Milk"
    GRAPHIC BOX (50,300)-(70,320),30,%RED,%RGB_MOCCASIN ' Pick BOX
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET POS (90,300):GRAPHIC PRINT "Orange Juice":GG$="Orange Juice"
    GRAPHIC BOX (50,340)-(70,360),30,%RED,%RGB_MOCCASIN ' Pick BOX
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET POS (90,340):GRAPHIC PRINT "Vegetable Oil":HH$="Vegetable Oil"
    GRAPHIC BOX (50,380)-(70,400),30,%RED,%RGB_MOCCASIN ' Pick BOX
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET POS (90,380):GRAPHIC PRINT "Vinegar":II$="Vinegar"
    GRAPHIC BOX (50,420)-(70,440),30,%RED,%RGB_MOCCASIN ' Pick BOX
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET POS (90,420):GRAPHIC PRINT "Mayoaise":JJ$="Mayonaise"
    GRAPHIC BOX (50,460)-(70,480),30,%RED,%RGB_MOCCASIN ' Pick BOX
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET POS (90,460):GRAPHIC PRINT "Catsup":KK$="Catsup"
    '
    ' continue items on next column
    '
    ' These Next Four Pick Boxes are at the bottom of all screens
    '
    GRAPHIC BOX (300,575)-(430,600),30,%RED,%RGB_MOCCASIN ' Pick BOX to return to list from erase section
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET POS (314,576):GRAPHIC PRINT "Return To List"
    GRAPHIC BOX (500,575)-(670,600),30,%RED,%RGB_MOCCASIN ' Pick BOX to exit without printing anything - this leaves program
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET POS (512,576):GRAPHIC PRINT "Exit without printing"
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC BOX (90,575)-(205, 600),30,%RED,%RGB_MOCCASIN ' Pick BOX to go to remove marks section
    GRAPHIC SET POS (97,577):GRAPHIC PRINT "Remove Marks"
    GRAPHIC BOX (760,575)-(850, 600),30,%RED,%RGB_MOCCASIN ' Pick BOX to Print List to printer
    GRAPHIC SET POS (770,577):GRAPHIC PRINT "Print List"
    ' Column 2
    GRAPHIC SET FONT hFont12
    GRAPHIC BOX (250,140)-(270,160),30,%RED,%RGB_MOCCASIN ' Pick BOX
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET POS (290,140):GRAPHIC PRINT "Mustard":LL$="Mustard"
    GRAPHIC BOX (250,180)-(270,200),30,%RED,%RGB_MOCCASIN ' Pick BOX
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET POS (290,180):GRAPHIC PRINT "Potatos":MM$="Potatos"
    GRAPHIC BOX (250,220)-(270,240),30,%RED,%RGB_MOCCASIN ' Pick BOX
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET POS (290,220):GRAPHIC PRINT "Soy Sauce":NN$="Soy Sauce"
    GRAPHIC BOX (250,260)-(270,280),30,%RED,%RGB_MOCCASIN ' Pick BOX
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET POS (290,260):GRAPHIC PRINT "Bagels":OO$="Bagels"
    GRAPHIC BOX (250,300)-(270,320),30,%RED,%RGB_MOCCASIN ' Pick BOX
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET POS (290,300):GRAPHIC PRINT "Swirl Bread":PP$="Swirl Bread"
    GRAPHIC BOX (250,340)-(270,360),30,%RED,%RGB_MOCCASIN ' Pick BOX
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET POS (290,340):GRAPHIC PRINT "Water":QQ$="Water"
    GRAPHIC BOX (250,380)-(270,400),30,%RED,%RGB_MOCCASIN ' Pick BOX
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET POS (290,380):GRAPHIC PRINT "Diet Pepsi":RR$="Diet Pepsi"
    GRAPHIC BOX (250,420)-(270,440),30,%RED,%RGB_MOCCASIN ' Pick BOX
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET POS (290,420):GRAPHIC PRINT "Taster's Choice":SS$="Taster's Choice"
    GRAPHIC BOX (250,460)-(270,480),30,%RED,%RGB_MOCCASIN ' Pick BOX
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET POS (290,460):GRAPHIC PRINT "Chicken Burger":TT$="Chicken Burger"
    ' Column 3
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC BOX (450,140)-(470,160),30,%RED,%RGB_MOCCASIN ' Pick BOX
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET POS (490,140):GRAPHIC PRINT "Le Seur Peas":UU$="Le Seur Peas"
    GRAPHIC BOX (450,180)-(470,200),30,%RED,%RGB_MOCCASIN ' Pick BOX
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET POS (490,180):GRAPHIC PRINT "Baked Beans":VV$="Baked Beans"
    GRAPHIC BOX (450,220)-(470,240),30,%RED,%RGB_MOCCASIN ' Pick BOX
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET POS (490,220):GRAPHIC PRINT "Olives":WW$="Olives"
    GRAPHIC BOX (450,260)-(470,280),30,%RED,%RGB_MOCCASIN ' Pick BOX
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET POS (490,260):GRAPHIC PRINT "Corn":XX$="Corn"
    GRAPHIC BOX (450,300)-(470,320),30,%RED,%RGB_MOCCASIN ' Pick BOX
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET POS (490,300):GRAPHIC PRINT "Stringbeens":YY$="String Beans"
    GRAPHIC BOX (450,340)-(470,360),30,%RED,%RGB_MOCCASIN ' Pick BOX
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET POS (490,340):GRAPHIC PRINT "Mushrooms":ZZ$="Mushrooms"
    GRAPHIC BOX (450,380)-(470,400),30,%RED,%RGB_MOCCASIN ' Pick BOX
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET POS (490,380):GRAPHIC PRINT "Paper Cups 12 oz":AAA$="Paper Cups 12 oz"
    GRAPHIC BOX (450,420)-(470,440),30,%RED,%RGB_MOCCASIN ' Pick BOX
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET POS (490,420):GRAPHIC PRINT "Paper Plates":BBB$="Paper Plates
    GRAPHIC BOX (450,460)-(470,480),30,%RED,%RGB_MOCCASIN ' Pick BOX
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET POS (490,460):GRAPHIC PRINT "Cling Wrap":CCC$="Cling Wrap"
    GRAPHIC BOX (250,140)-(270,160),30,%RED,%RGB_MOCCASIN ' Pick BOX
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    ' Column 4
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC BOX (650,140)-(670,160),30,%RED,%RGB_MOCCASIN ' Pick BOX
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET POS (690,140):GRAPHIC PRINT "Trash Bags"DD$="Trash Bags
    GRAPHIC BOX (650,180)-(670,200),30,%RED,%RGB_MOCCASIN ' Pick BOX
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET POS (690,180):GRAPHIC PRINT "Scrubbing Bubbles":EEE$="Scrubbing Bubbles"
    GRAPHIC BOX (650,220)-(670,240),30,%RED,%RGB_MOCCASIN ' Pick BOX
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET POS (690,220):GRAPHIC PRINT "Swiffer Floor Pads":FFF$="Swiffer Floor Pads"
    GRAPHIC BOX (650,260)-(670,280),30,%RED,%RGB_MOCCASIN ' Pick BOX
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET POS (690,260):GRAPHIC PRINT "Stamps":GGG$="Stamps"
    GRAPHIC BOX (650,300)-(670,320),30,%RED,%RGB_MOCCASIN ' Pick BOX
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET POS (690,300):GRAPHIC PRINT "Batteries":HHH$="Batteries"
    GRAPHIC BOX (650,340)-(670,360),30,%RED,%RGB_MOCCASIN ' Pick BOX
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET POS (690,340):GRAPHIC PRINT "Quiche Appetizers":III$="Quiche Appetizers"
    GRAPHIC BOX (650,380)-(670,400),30,%RED,%RGB_MOCCASIN ' Pick BOX
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET POS (690,380):GRAPHIC PRINT "Lox":JJJ$="Lox"
    GRAPHIC BOX (650,420)-(670,440),30,%RED,%RGB_MOCCASIN ' Pick BOX
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET POS (690,420):GRAPHIC PRINT "Salmon":KKK$="Salmon"
    GRAPHIC BOX (650,460)-(670,480),30,%RED,%RGB_MOCCASIN ' Pick BOX
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET POS (690,460):GRAPHIC PRINT "Paper Towels":LLL$="Papertowels"
    ' Column 5
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC BOX (850,140)-(870,160),30,%RED,%RGB_MOCCASIN ' Pick BOX
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET POS (890,140):GRAPHIC PRINT "Eye Roast":MMM$="Eye Roast"
    GRAPHIC BOX (850,180)-(870,200),30,%RED,%RGB_MOCCASIN ' Pick BOX
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET POS (890,180):GRAPHIC PRINT "Hamburger Patties":NNN$="Hamburger Patties"
    GRAPHIC BOX (850,220)-(870,240),30,%RED,%RGB_MOCCASIN ' Pick BOX
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET POS (890,220):GRAPHIC PRINT "Chicken Patties":OOO$="Chicken Patties"
    GRAPHIC BOX (850,260)-(870,280),30,%RED,%RGB_MOCCASIN ' Pick BOX
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET POS (890,260):GRAPHIC PRINT "Hot Dogs":PPP$="Hot Dogs"
    GRAPHIC BOX (850,300)-(870,320),30,%RED,%RGB_MOCCASIN ' Pick BOX
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET POS (890,300):GRAPHIC PRINT "Tuna Cans":QQQ$="Tuna Cans"
    GRAPHIC BOX (850,340)-(870,360),30,%RED,%RGB_MOCCASIN ' Pick BOX
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET POS (890,340):GRAPHIC PRINT "Vegetables":RRR$="Vegetables"
    GRAPHIC BOX (850,380)-(870,400),30,%RED,%RGB_MOCCASIN ' Pick BOX
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET POS (890,380):GRAPHIC PRINT "Paper Towels":SSS$="Paper Towels"
    GRAPHIC BOX (850,420)-(870,440),30,%RED,%RGB_MOCCASIN ' Pick BOX
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET POS (890,420):GRAPHIC PRINT "Charmin":TTT$="Charmin"
    GRAPHIC BOX (850,460)-(870,480),30,%RED,%RGB_MOCCASIN ' Pick BOX
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET POS (890,460):GRAPHIC PRINT "Puffs":UUU$="Puffs"

    ' THIS NEXT SECTION IS WHERE THE MARKS ARE PLACED IN THE PICKED BLOCKS... A MARK IN ANY BOX MEANS THAT ITEM WAS PICKED AND WILL BE HARD PRINTED...
    ' THE A? NUMBER ASSIGNED TO EACH ITEM IS SET TO ONE (1)... AN EXAMPLE IS THAT A1=1 AND HAS BEEN PICKED... A1=0 IS NOT A PICKED ITEM... ANY ITEM WHERE A?=0 WILL BE SKIPPED WHEN PRINTING TO PAPER...
    ' THE QUESTION MARK REPRESENTS THE NUMBER OF THE ITEM, SUCH AS... THE NUMBER A?, IS A1 IN THE CASE OF 'EGGS' AND A2 FOR 'SOUR CREAM' AND SO FORTH DOWN THE LIST...

    PICKBLOCKS: 'come her to pick items from the start or when coming back from the removal section
    '
    '
    '
    GRAPHIC BOX (360,80)-(610,120),30,%RED,%RGB_MOCCASIN ' Selection Section Box
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET FONT hFont19
    GRAPHIC SET POS (400,83):GRAPHIC PRINT "Selection Section"
    GRAPHIC SET FONT hFont12
    DO
    GRAPHIC WINDOW CLICK TO click&, cx, cy ' Use Mouse to Pick Answer **************************
    IF CX>50 AND CX<70 AND CY>140 AND CY<160 AND A1=0 THEN GRAPHIC SET POS (55,139):GRAPHIC PRINT CHR$(62):A1=1
    IF CX>50 AND CX<70 AND CY>180 AND CY<200 AND A2=0 THEN GRAPHIC SET POS (55,179):GRAPHIC PRINT CHR$(62):A2=1
    IF CX>50 AND CX<70 AND CY>220 AND CY<240 AND A3=0 THEN GRAPHIC SET POS (55,219):GRAPHIC PRINT CHR$(62):A3=1
    IF CX>50 AND CX<70 AND CY>260 AND CY<280 AND A4=0 THEN GRAPHIC SET POS (55,259):GRAPHIC PRINT CHR$(62):A4=1
    IF CX>50 AND CX<70 AND CY>300 AND CY<320 AND A5=0 THEN GRAPHIC SET POS (55,299):GRAPHIC PRINT CHR$(62):A5=1
    IF CX>50 AND CX<70 AND CY>340 AND CY<360 AND A6=0 THEN GRAPHIC SET POS (55,339):GRAPHIC PRINT CHR$(62):A6=1
    IF CX>50 AND CX<70 AND CY>380 AND CY<400 AND A7=0 THEN GRAPHIC SET POS (55,379):GRAPHIC PRINT CHR$(62):A7=1
    IF CX>50 AND CX<70 AND CY>420 AND CY<440 AND A8=0 THEN GRAPHIC SET POS (55,419):GRAPHIC PRINT CHR$(62):A8=1
    IF CX>50 AND CX<70 AND CY>460 AND CY<480 AND A9=0 THEN GRAPHIC SET POS (55,459):GRAPHIC PRINT CHR$(62):A9=1
    ' Column 2
    IF CX>250 AND CX<270 AND CY>140 AND CY<160 AND A10=0 THEN GRAPHIC SET POS (255,139):GRAPHIC PRINT CHR$(62):A10=1
    IF CX>250 AND CX<270 AND CY>180 AND CY<200 AND A11=0 THEN GRAPHIC SET POS (255,179):GRAPHIC PRINT CHR$(62):A11=1
    IF CX>250 AND CX<270 AND CY>220 AND CY<240 AND A12=0 THEN GRAPHIC SET POS (255,219):GRAPHIC PRINT CHR$(62):A12=1
    IF CX>250 AND CX<270 AND CY>260 AND CY<280 AND A13=0 THEN GRAPHIC SET POS (255,259):GRAPHIC PRINT CHR$(62):A13=1
    IF CX>250 AND CX<270 AND CY>300 AND CY<320 AND A14=0 THEN GRAPHIC SET POS (255,299):GRAPHIC PRINT CHR$(62):A14=1
    IF CX>250 AND CX<270 AND CY>340 AND CY<360 AND A15=0 THEN GRAPHIC SET POS (255,339):GRAPHIC PRINT CHR$(62):A15=1
    IF CX>250 AND CX<270 AND CY>380 AND CY<400 AND A16=0 THEN GRAPHIC SET POS (255,379):GRAPHIC PRINT CHR$(62):A16=1
    IF CX>250 AND CX<270 AND CY>420 AND CY<440 AND A17=0 THEN GRAPHIC SET POS (255,419):GRAPHIC PRINT CHR$(62):A17=1
    IF CX>250 AND CX<270 AND CY>460 AND CY<480 AND A18=0 THEN GRAPHIC SET POS (255,459):GRAPHIC PRINT CHR$(62):A18=1

    ' Column 3
    IF CX>450 AND CX<470 AND CY>140 AND CY<160 AND A19=0 THEN GRAPHIC SET POS (455,139):GRAPHIC PRINT CHR$(62):A19=1
    IF CX>450 AND CX<470 AND CY>180 AND CY<200 AND A20=0 THEN GRAPHIC SET POS (455,179):GRAPHIC PRINT CHR$(62):A20=1
    IF CX>450 AND CX<470 AND CY>220 AND CY<240 AND A21=0 THEN GRAPHIC SET POS (455,219):GRAPHIC PRINT CHR$(62):A21=1
    IF CX>450 AND CX<470 AND CY>260 AND CY<280 AND A22=0 THEN GRAPHIC SET POS (455,259):GRAPHIC PRINT CHR$(62):A22=1
    IF CX>450 AND CX<470 AND CY>300 AND CY<320 AND A23=0 THEN GRAPHIC SET POS (455,299):GRAPHIC PRINT CHR$(62):A23=1
    IF CX>450 AND CX<470 AND CY>340 AND CY<360 AND A24=0 THEN GRAPHIC SET POS (455,339):GRAPHIC PRINT CHR$(62):A24=1
    IF CX>450 AND CX<470 AND CY>380 AND CY<400 AND A25=0 THEN GRAPHIC SET POS (455,379):GRAPHIC PRINT CHR$(62):A25=1
    IF CX>450 AND CX<470 AND CY>420 AND CY<440 AND A26=0 THEN GRAPHIC SET POS (455,419):GRAPHIC PRINT CHR$(62):A26=1
    IF CX>450 AND CX<470 AND CY>460 AND CY<480 AND A27=0 THEN GRAPHIC SET POS (455,459):GRAPHIC PRINT CHR$(62):A27=1
    '
    ' Column 4
    IF CX>650 AND CX<670 AND CY>140 AND CY<160 AND A28=0 THEN GRAPHIC SET POS (655,139):GRAPHIC PRINT CHR$(62):A28=1
    IF CX>650 AND CX<670 AND CY>180 AND CY<200 AND A29=0 THEN GRAPHIC SET POS (655,179):GRAPHIC PRINT CHR$(62):A29=1
    IF CX>650 AND CX<670 AND CY>220 AND CY<240 AND A30=0 THEN GRAPHIC SET POS (655,219):GRAPHIC PRINT CHR$(62):A30=1
    IF CX>650 AND CX<670 AND CY>260 AND CY<280 AND A31=0 THEN GRAPHIC SET POS (655,259):GRAPHIC PRINT CHR$(62):A31=1
    IF CX>650 AND CX<670 AND CY>300 AND CY<320 AND A32=0 THEN GRAPHIC SET POS (655,299):GRAPHIC PRINT CHR$(62):A32=1
    IF CX>650 AND CX<670 AND CY>340 AND CY<360 AND A33=0 THEN GRAPHIC SET POS (655,339):GRAPHIC PRINT CHR$(62):A33=1
    IF CX>650 AND CX<670 AND CY>380 AND CY<400 AND A34=0 THEN GRAPHIC SET POS (655,379):GRAPHIC PRINT CHR$(62):A34=1
    IF CX>650 AND CX<670 AND CY>420 AND CY<440 AND A35=0 THEN GRAPHIC SET POS (655,419):GRAPHIC PRINT CHR$(62):A35=1
    IF CX>650 AND CX<670 AND CY>460 AND CY<480 AND A36=0 THEN GRAPHIC SET POS (655,459):GRAPHIC PRINT CHR$(62):A36=1
    ' Come here after all columns are filled

    ' Column 5
    IF CX>850 AND CX<870 AND CY>140 AND CY<160 AND A37=0 THEN GRAPHIC SET POS (855,139):GRAPHIC PRINT CHR$(62):A37=1
    IF CX>850 AND CX<870 AND CY>180 AND CY<200 AND A38=0 THEN GRAPHIC SET POS (855,179):GRAPHIC PRINT CHR$(62):A38=1
    IF CX>850 AND CX<870 AND CY>220 AND CY<240 AND A39=0 THEN GRAPHIC SET POS (855,219):GRAPHIC PRINT CHR$(62):A39=1
    IF CX>850 AND CX<870 AND CY>260 AND CY<280 AND A40=0 THEN GRAPHIC SET POS (855,259):GRAPHIC PRINT CHR$(62):A40=1
    IF CX>850 AND CX<870 AND CY>300 AND CY<320 AND A41=0 THEN GRAPHIC SET POS (855,299):GRAPHIC PRINT CHR$(62):A41=1
    IF CX>850 AND CX<870 AND CY>340 AND CY<360 AND A42=0 THEN GRAPHIC SET POS (855,339):GRAPHIC PRINT CHR$(62):A42=1
    IF CX>850 AND CX<870 AND CY>380 AND CY<400 AND A43=0 THEN GRAPHIC SET POS (855,379):GRAPHIC PRINT CHR$(62):A43=1
    IF CX>850 AND CX<870 AND CY>420 AND CY<440 AND A44=0 THEN GRAPHIC SET POS (855,419):GRAPHIC PRINT CHR$(62):A44=1
    IF CX>850 AND CX<870 AND CY>460 AND CY<480 AND A45=0 THEN GRAPHIC SET POS (855,459):GRAPHIC PRINT CHR$(62):A45=1
    '
    IF CX>90 AND CX<200 AND CY>570 AND CY<600 THEN GOTO REMOVAL ' Remove items that you do not want on printed list...
    IF CX>760 AND CX<850 AND CY>570 AND CY<600 THEN GOTO PRINTIT ' Get a paper printout then leave program
    IF CX>500 AND CX<660 AND CY>570 AND CY<600 THEN GOTO EXITIT ' leave program without paper printing
    LOOP

    ' THE NEXT SECTION IS THE ERASEING SECTION... THE ERASEIT SECTION IS WHERE WE ERASE THE MARK FROM THE PICK BOX, SET PICKBOX REFERENCE NUMBER 'A?' BACK TO ZERO (A?=0)
    ' WE CAN RETURN TO THE PICKING SECTION TO CONTINUE PICKING IF MORE ITEMS ARE NEEDED
    ' IMPORTANT - IMPORTANT - IMPORTANT... WE CAN GO FROM THE PICKING SECTION TO THE ERASEING SECTION AND BACK AS MANY TIMES AS NEEDED

    REMOVAL:

    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET FONT hFont19
    GRAPHIC SET POS (400,83):GRAPHIC PRINT "Removal Section"
    GRAPHIC SET FONT hFont12

    S$ = SPACE$(4)
    DO
    GRAPHIC WINDOW CLICK TO click&, cx, cy ' Use Mouse to Pick Answer **************************
    ' Column 1 erase marks
    IF CX>50 AND CX<70 AND CY>140 AND CY<160 AND A1=1 THEN GRAPHIC SET POS (50,140):GRAPHIC PRINT S$:GRAPHIC BOX (50,140)-(70,160),30,%RED,%RGB_MOCCASIN:A1=0
    IF CX>50 AND CX<70 AND CY>180 AND CY<200 AND A2=1 THEN GRAPHIC SET POS (55,180):GRAPHIC PRINT S$:GRAPHIC BOX (50,180)-(70,200),30,%RED,%RGB_MOCCASIN:A2=0
    IF CX>50 AND CX<70 AND CY>220 AND CY<240 AND A3=1 THEN GRAPHIC SET POS (55,220):GRAPHIC PRINT S$:GRAPHIC BOX (50,220)-(70,240),30,%RED,%RGB_MOCCASIN:A3=0
    IF CX>50 AND CX<70 AND CY>260 AND CY<280 AND A4=1 THEN GRAPHIC SET POS (55,260):GRAPHIC PRINT S$:GRAPHIC BOX (50,260)-(70,280),30,%RED,%RGB_MOCCASIN:A4=0
    IF CX>50 AND CX<70 AND CY>300 AND CY<320 AND A5=1 THEN GRAPHIC SET POS (55,300):GRAPHIC PRINT S$:GRAPHIC BOX (50,300)-(70,320),30,%RED,%RGB_MOCCASIN:A5=0
    IF CX>50 AND CX<70 AND CY>340 AND CY<360 AND A6=1 THEN GRAPHIC SET POS (55,340):GRAPHIC PRINT S$:GRAPHIC BOX (50,340)-(70,360),30,%RED,%RGB_MOCCASIN:A6=0
    IF CX>50 AND CX<70 AND CY>380 AND CY<400 AND A7=1 THEN GRAPHIC SET POS (55,380):GRAPHIC PRINT S$:GRAPHIC BOX (50,380)-(70,400),30,%RED,%RGB_MOCCASIN:A7=0
    IF CX>50 AND CX<70 AND CY>420 AND CY<440 AND A8=1 THEN GRAPHIC SET POS (55,420):GRAPHIC PRINT S$:GRAPHIC BOX (50,420)-(70,440),30,%RED,%RGB_MOCCASIN:A8=0
    IF CX>50 AND CX<70 AND CY>460 AND CY<480 AND A9=1 THEN GRAPHIC SET POS (55,460):GRAPHIC PRINT S$:GRAPHIC BOX (50,460)-(70,480),30,%RED,%RGB_MOCCASIN:A9=0
    ' Column 2 erase marks
    IF CX>250 AND CX<270 AND CY>140 AND CY<160 AND A10=1 THEN GRAPHIC SET POS (255,140):GRAPHIC PRINT S$:GRAPHIC BOX (250,140)-(270,160),30,%RED,%RGB_MOCCASIN:A10=0
    IF CX>250 AND CX<270 AND CY>180 AND CY<200 AND A11=1 THEN GRAPHIC SET POS (255,180):GRAPHIC PRINT S$:GRAPHIC BOX (250,180)-(270,200),30,%RED,%RGB_MOCCASIN:A11=0
    IF CX>250 AND CX<270 AND CY>220 AND CY<240 AND A12=1 THEN GRAPHIC SET POS (255,220):GRAPHIC PRINT S$:GRAPHIC BOX (250,220)-(270,240),30,%RED,%RGB_MOCCASIN:A12=0
    IF CX>250 AND CX<270 AND CY>260 AND CY<280 AND A13=1 THEN GRAPHIC SET POS (255,260):GRAPHIC PRINT S$:GRAPHIC BOX (250,260)-(270,280),30,%RED,%RGB_MOCCASIN:A13=0
    IF CX>250 AND CX<270 AND CY>300 AND CY<320 AND A14=1 THEN GRAPHIC SET POS (255,300):GRAPHIC PRINT S$:GRAPHIC BOX (250,300)-(270,320),30,%RED,%RGB_MOCCASIN:A14=0
    IF CX>250 AND CX<270 AND CY>340 AND CY<360 AND A15=1 THEN GRAPHIC SET POS (255,340):GRAPHIC PRINT S$:GRAPHIC BOX (250,340)-(270,360),30,%RED,%RGB_MOCCASIN:A15=0
    IF CX>250 AND CX<270 AND CY>380 AND CY<400 AND A16=1 THEN GRAPHIC SET POS (255,380):GRAPHIC PRINT S$:GRAPHIC BOX (250,380)-(270,400),30,%RED,%RGB_MOCCASIN:A16=0
    IF CX>250 AND CX<270 AND CY>420 AND CY<440 AND A17=1 THEN GRAPHIC SET POS (255,420):GRAPHIC PRINT S$:GRAPHIC BOX (250,420)-(270,440),30,%RED,%RGB_MOCCASIN:A17=0
    IF CX>250 AND CX<270 AND CY>460 AND CY<480 AND A18=1 THEN GRAPHIC SET POS (255,460):GRAPHIC PRINT S$:GRAPHIC BOX (250,460)-(270,480),30,%RED,%RGB_MOCCASIN:A18=0
    ' Column 3 erase marks
    IF CX>450 AND CX<470 AND CY>140 AND CY<160 AND A19=1 THEN GRAPHIC SET POS (455,140):GRAPHIC PRINT S$:GRAPHIC BOX (450,140)-(470,160),30,%RED,%RGB_MOCCASIN:A19=0
    IF CX>450 AND CX<470 AND CY>180 AND CY<200 AND A20=1 THEN GRAPHIC SET POS (455,180):GRAPHIC PRINT S$:GRAPHIC BOX (450,180)-(470,200),30,%RED,%RGB_MOCCASIN:A20=0
    IF CX>450 AND CX<470 AND CY>220 AND CY<240 AND A21=1 THEN GRAPHIC SET POS (455,220):GRAPHIC PRINT S$:GRAPHIC BOX (450,220)-(470,240),30,%RED,%RGB_MOCCASIN:A21=0
    IF CX>450 AND CX<470 AND CY>260 AND CY<280 AND A22=1 THEN GRAPHIC SET POS (455,260):GRAPHIC PRINT S$:GRAPHIC BOX (450,260)-(470,280),30,%RED,%RGB_MOCCASIN:A22=0
    IF CX>450 AND CX<470 AND CY>300 AND CY<320 AND A23=1 THEN GRAPHIC SET POS (455,300):GRAPHIC PRINT S$:GRAPHIC BOX (450,300)-(470,320),30,%RED,%RGB_MOCCASIN:A23=0
    IF CX>450 AND CX<470 AND CY>340 AND CY<360 AND A24=1 THEN GRAPHIC SET POS (455,340):GRAPHIC PRINT S$:GRAPHIC BOX (450,340)-(470,360),30,%RED,%RGB_MOCCASIN:A24=0
    IF CX>450 AND CX<470 AND CY>380 AND CY<400 AND A25=1 THEN GRAPHIC SET POS (455,380):GRAPHIC PRINT S$:GRAPHIC BOX (450,380)-(470,400),30,%RED,%RGB_MOCCASIN:A25=0
    IF CX>450 AND CX<470 AND CY>420 AND CY<440 AND A26=1 THEN GRAPHIC SET POS (455,420):GRAPHIC PRINT S$:GRAPHIC BOX (450,420)-(470,440),30,%RED,%RGB_MOCCASIN:A26=0
    IF CX>450 AND CX<470 AND CY>460 AND CY<480 AND A27=1 THEN GRAPHIC SET POS (455,460):GRAPHIC PRINT S$:GRAPHIC BOX (450,460)-(470,480),30,%RED,%RGB_MOCCASIN:A27=0
    ' Column 4 erase marks
    IF CX>650 AND CX<670 AND CY>140 AND CY<160 AND A28=1 THEN GRAPHIC SET POS (655,140):GRAPHIC PRINT S$:GRAPHIC BOX (650,140)-(670,160),30,%RED,%RGB_MOCCASIN:A28=0
    IF CX>650 AND CX<670 AND CY>180 AND CY<200 AND A29=1 THEN GRAPHIC SET POS (655,180):GRAPHIC PRINT S$:GRAPHIC BOX (650,180)-(670,200),30,%RED,%RGB_MOCCASIN:A29=0
    IF CX>650 AND CX<670 AND CY>220 AND CY<240 AND A30=1 THEN GRAPHIC SET POS (655,220):GRAPHIC PRINT S$:GRAPHIC BOX (650,220)-(670,240),30,%RED,%RGB_MOCCASIN:A30=0
    IF CX>650 AND CX<670 AND CY>260 AND CY<280 AND A31=1 THEN GRAPHIC SET POS (655,260):GRAPHIC PRINT S$:GRAPHIC BOX (650,260)-(670,280),30,%RED,%RGB_MOCCASIN:A31=0
    IF CX>650 AND CX<670 AND CY>300 AND CY<320 AND A32=1 THEN GRAPHIC SET POS (655,300):GRAPHIC PRINT S$:GRAPHIC BOX (650,300)-(670,320),30,%RED,%RGB_MOCCASIN:A32=0
    IF CX>650 AND CX<670 AND CY>340 AND CY<360 AND A33=1 THEN GRAPHIC SET POS (655,340):GRAPHIC PRINT S$:GRAPHIC BOX (650,340)-(670,360),30,%RED,%RGB_MOCCASIN:A33=0
    IF CX>650 AND CX<670 AND CY>380 AND CY<400 AND A34=1 THEN GRAPHIC SET POS (655,380):GRAPHIC PRINT S$:GRAPHIC BOX (650,380)-(670,400),30,%RED,%RGB_MOCCASIN:A34=0
    IF CX>650 AND CX<670 AND CY>420 AND CY<440 AND A35=1 THEN GRAPHIC SET POS (655,420):GRAPHIC PRINT S$:GRAPHIC BOX (650,420)-(670,440),30,%RED,%RGB_MOCCASIN:A35=0
    IF CX>650 AND CX<670 AND CY>460 AND CY<480 AND A36=1 THEN GRAPHIC SET POS (655,460):GRAPHIC PRINT S$:GRAPHIC BOX (650,460)-(670,480),30,%RED,%RGB_MOCCASIN:A36=0
    ' Column 5 erase marks
    IF CX>850 AND CX<870 AND CY>140 AND CY<160 AND A37=1 THEN GRAPHIC SET POS (855,140):GRAPHIC PRINT S$:GRAPHIC BOX (850,140)-(870,160),30,%RED,%RGB_MOCCASIN:A37=0
    IF CX>850 AND CX<870 AND CY>180 AND CY<200 AND A38=1 THEN GRAPHIC SET POS (855,180):GRAPHIC PRINT S$:GRAPHIC BOX (850,180)-(870,200),30,%RED,%RGB_MOCCASIN:A38=0
    IF CX>850 AND CX<870 AND CY>220 AND CY<240 AND A39=1 THEN GRAPHIC SET POS (855,220):GRAPHIC PRINT S$:GRAPHIC BOX (850,220)-(870,240),30,%RED,%RGB_MOCCASIN:A39=0
    IF CX>850 AND CX<870 AND CY>260 AND CY<280 AND A40=1 THEN GRAPHIC SET POS (855,260):GRAPHIC PRINT S$:GRAPHIC BOX (850,260)-(870,280),30,%RED,%RGB_MOCCASIN:A40=0
    IF CX>850 AND CX<870 AND CY>300 AND CY<320 AND A41=1 THEN GRAPHIC SET POS (855,300):GRAPHIC PRINT S$:GRAPHIC BOX (850,300)-(870,320),30,%RED,%RGB_MOCCASIN:A41=0
    IF CX>850 AND CX<870 AND CY>340 AND CY<360 AND A42=1 THEN GRAPHIC SET POS (855,340):GRAPHIC PRINT S$:GRAPHIC BOX (850,340)-(870,360),30,%RED,%RGB_MOCCASIN:A42=0
    IF CX>850 AND CX<870 AND CY>380 AND CY<400 AND A43=1 THEN GRAPHIC SET POS (855,380):GRAPHIC PRINT S$:GRAPHIC BOX (850,380)-(870,400),30,%RED,%RGB_MOCCASIN:A43=0
    IF CX>850 AND CX<870 AND CY>420 AND CY<440 AND A44=1 THEN GRAPHIC SET POS (855,420):GRAPHIC PRINT S$:GRAPHIC BOX (850,420)-(870,440),30,%RED,%RGB_MOCCASIN:A44=0
    IF CX>850 AND CX<870 AND CY>460 AND CY<480 AND A45=1 THEN GRAPHIC SET POS (855,460):GRAPHIC PRINT S$:GRAPHIC BOX (850,460)-(870,480),30,%RED,%RGB_MOCCASIN:A45=0
    IF CX>300 AND CX<430 AND CY>570 AND CY<600 THEN GOTO PICKBLOCKS 'Return to pickblocks to select more items
    '
    LOOP
    '
    INFO5:
    '
    ' THIS IS THE FIRST SCREEN DISPLAYED AND EXPLAINS THE USE OF THE PROGRAM...
    '
    GRAPHIC CLEAR ' CLEARS SCREEN COMPLETELY
    GRAPHIC BOX (20,30)-(975,563),30,%RED,%RGB_MOCCASIN ' Large Screen BOX
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC BOX (340,130)-(610,168),30,%RED,%RGB_MOCCASIN ' BJ's BOX
    GRAPHIC BOX (400,430)-(540,470),30,%RED,%RGB_MOCCASIN ' Continue BOX
    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN

    GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    GRAPHIC SET POS (365,132):GRAPHIC PRINT "BJ's Shopping List" ' PRINTED IN BJ's BOX
    GRAPHIC SET POS (420,432):GRAPHIC PRINT "Continue" ' PRINTED IN CONTINUE BOX
    GRAPHIC SET POS (70,175):GRAPHIC PRINT "This shopping list is for shopping at BJ's only."
    GRAPHIC SET POS (70,215):GRAPHIC PRINT "If you want an item on the list, pick the box in front of the item."
    GRAPHIC SET POS (70,255):GRAPHIC PRINT "If you decide to change your mind, pick the remove box and again pick the items."
    GRAPHIC SET POS (70,295):GRAPHIC PRINT "When you have picked all the item you want, pick the 'Print List' box."
    GRAPHIC SET POS (70,335):GRAPHIC PRINT "For other stores, pick it from the index page when we get an index page!"
    '
    DO
    GRAPHIC WINDOW CLICK TO click&, cx, cy ' Use Mouse to Pick Answer **************************
    IF CX>380 AND CX<520 AND CY>430 AND CY<463 THEN RETURN ' THE PROGRAM CAME HERE FROM A SUB ROUTINE COMMAND AND NEEDS A RETURN COMMAND TO GET BACT TO THE NEXT LINE UNDER THAT SUB ROUTINE COMMAND...
    LOOP
    '
    ' SENDING THE CHOSEN ITEMS TO THE PRINTER... ONLY ITEM THAT THE A?=1 WILL BE PRINTED...
    ' WE USE THE FOR/NEXT LOOP TO SELECT THE ITEMS THAT ARE SET TO THE NUMBER ONE... THE ITEMS SET TO ZERO WILL BE SKIPPED...
    '
    PRINTIT:
    '
    O1=0
    FOR O1=1 TO 45 'That is total items that can be printed...
    '
    IF A1=1 THEN Z1$(O1)=AA$ ' Assign Z1$(?) munber to each valid item and skip the ones that where A? does not equal 1...
    IF A2=1 THEN Z1$(O1)=BB$
    IF A3=1 THEN Z1$(O1)=CC$
    IF A4=1 THEN Z1$(O1)=EE$
    IF A5=1 THEN Z1$(O1)=GG$
    IF A6=1 THEN Z1$(O1)=HH$
    IF A7=1 THEN Z1$(O1)=II$
    IF A8=1 THEN Z1$(O1)=JJ$
    IF A9=1 THEN Z1$(O1)=KK$
    IF A10=1 THEN Z1$(O1)=LL$
    IF A11=1 THEN Z1$(O1)=MM$
    IF A12=1 THEN Z1$(O1)=NN$
    IF A13=1 THEN Z1$(O1)=OO$
    IF A14=1 THEN Z1$(O1)=PP$
    IF A15=1 THEN Z1$(O1)=QQ$
    IF A16=1 THEN Z1$(O1)=RR$
    IF A17=1 THEN Z1$(O1)=SS$
    IF A18=1 THEN Z1$(O1)=TT$
    IF A19=1 THEN Z1$(O1)=UU$
    IF A20=1 THEN Z1$(O1)=VV$
    IF A21=1 THEN Z1$(O1)=WW$
    IF A22=1 THEN Z1$(O1)=XX$
    IF A23=1 THEN Z1$(O1)=YY$
    IF A24=1 THEN Z1$(O1)=ZZ$
    IF A25=1 THEN Z1$(O1)=AAA$
    IF A26=1 THEN Z1$(O1)=BBB$
    IF A27=1 THEN Z1$(O1)=CCC$
    IF A28=1 THEN Z1$(O1)=DDD$
    IF A29=1 THEN Z1$(O1)=EEE$
    IF A30=1 THEN Z1$(O1)=FFF$
    IF A31=1 THEN Z1$(O1)=GGG$
    IF A32=1 THEN Z1$(O1)=HHH$
    IF A33=1 THEN Z1$(O1)=III$
    IF A34=1 THEN Z1$(O1)=JJJ$
    IF A35=1 THEN Z1$(O1)=KKK$
    IF A36=1 THEN Z1$(O1)=LLL$
    IF A37=1 THEN Z1$(O1)=MMM$
    IF A38=1 THEN Z1$(O1)=NNN$
    IF A39=1 THEN Z1$(O1)=OOO$
    IF A40=1 THEN Z1$(O1)=PPP$
    IF A41=1 THEN Z1$(O1)=QQQ$
    IF A42=1 THEN Z1$(O1)=RRR$
    IF A43=1 THEN Z1$(O1)=SSS$
    IF A44=1 THEN Z1$(O1)=TTT$
    IF A45=1 THEN Z1$(O1)=UUU$
    NEXT

    ' THIS WAS AS FAR AS THE PROGRAM WAS CORRECT...
    'GRAPHIC SET POS(2,2):GRAPHIC PRINT "A1, A3, A5, A7",A1,A3,A5,A7 USED THESE FOUR LINS TO SEE WHERE SEQUINCE WENT WRONG... IT PRINTED ALL THE A's CORRECTLY
    'GRAPHIC SET POS(2,22):GRAPHIC PRINT "O1,Z1$(O1)= ",O1,Z1$(01) IT DIDN'T PRINT THE Z1$(O1)... PROBLEM COULD BE HERE???
    'GRAPHIC SET POS(2,42):GRAPHIC PRINT "ZZ$= ",ZZ$ IT PRINTED 'MUSHROOM' AND THAT IS WHAT ZZ$ IS... IT USED THE ZZ$ FROM THE ABOVE SETTING, NOT THE Z1$(O1) NUMBER
    'GRAPHIC WAITKEY$

    '
    XPRINT ATTACH DEFAULT
    XPRINT SET FONT hFont15
    XPRINT:XPRINT TAB(23)"BJ's List"
    XPRINT SET FONT hFont10
    XPRINT
    '
    'HARD PRINT USING ABOVE AMENDED LIST... ELIMINATING ALL ITEMS NOT MARKED A?=1
    '
    FOR O1=1 TO 45
    XPRINT TAB(10)Z1$(O1),TAB(50)Z1$(O1)
    XPRINT TAB(10)Z1$(O1),TAB(50)Z1$(O1)
    XPRINT TAB(10)Z1$(O1),TAB(50)Z1$(O1)
    XPRINT TAB(10)Z1$(O1),TAB(50)Z1$(O1)
    XPRINT TAB(10)Z1$(O1),TAB(50)Z1$(O1)
    XPRINT TAB(10)Z1$(O1),TAB(50)Z1$(O1)
    XPRINT TAB(10)Z1$(O1),TAB(50)Z1$(O1)
    XPRINT TAB(10)Z1$(O1),TAB(50)Z1$(O1)
    XPRINT TAB(10)Z1$(O1),TAB(50)Z1$(O1)
    XPRINT TAB(10)Z1$(O1),TAB(50)Z1$(O1)
    XPRINT TAB(10)Z1$(O1),TAB(50)Z1$(O1)
    XPRINT TAB(10)Z1$(O1),TAB(50)Z1$(O1)
    XPRINT TAB(10)Z1$(O1),TAB(50)Z1$(O1)
    XPRINT TAB(10)Z1$(O1),TAB(50)Z1$(O1)
    XPRINT TAB(10)Z1$(O1),TAB(50)Z1$(O1)
    XPRINT TAB(10)Z1$(O1),TAB(50)Z1$(O1)
    XPRINT TAB(10)Z1$(O1),TAB(50)Z1$(O1)
    XPRINT TAB(10)Z1$(O1),TAB(50)Z1$(O1)
    XPRINT TAB(10)Z1$(O1),TAB(50)Z1$(O1)
    XPRINT TAB(10)Z1$(O1),TAB(50)Z1$(O1)
    XPRINT TAB(10)Z1$(O1),TAB(50)Z1$(O1)
    XPRINT TAB(10)Z1$(O1),TAB(50)Z1$(O1)
    XPRINT TAB(10)Z1$(O1)

    '
    XPRINT CLOSE


    EXITIT: 'End Of Program


    END FUNCTION

    {/code}

    Izzy Zeitz

  • #2
    Hi,Izzy
    Ttook a look at it and changed some things to use arrays for selected items and contents instead - plus removed a bunch of un-used variables. Same code, but cleaner and now printing seems to work fine.

    PS. You have listed "Paper tovels" twice, at bottom of column 4 and 3:rd from bottom in column 5..

    Edited - added SLEEP 1 to both DO/LOOP to ease up on processor burdon.

    Code:
    #COMPILE EXE
    #CONSOLE OFF
    '#DEBUG ERROR ON
    '#INCLUDE "Win32API.inc"
    
    FUNCTION PBMAIN () AS LONG
    
      LOCAL WIDTH8, HEIGHT8, DSKTOPX, DSKTOPY AS LONG
      LOCAL FF, FF2 AS DOUBLE
      LOCAL hFont10, hFont12, hFont15,hFont20, hFont19, hFont25 AS LONG
      LOCAL O1 AS LONG
    
      DIM A&(1 TO 45)
      DIM Z1$(1 TO 45)
    
      LOCAL CX!, CY!, CLICK&
      LOCAL hGW1&
    
      '------------------------------------------------------------------
    
      'do some graphics
      yloc#= 495
      GRAPHIC TEXT SIZE "Shopping list" TO tx&,yx&
      GRAPHIC SET POS (-tx&/2,yloc#)
    
      DESKTOP GET CLIENT TO dsktopx, dsktopy
    
      GRAPHIC WINDOW "Shopping list", 0, 0, 1100, 650 TO hGW1&
    
      WIDTH8=dsktopx : HEIGHT8=dsktopy
      GRAPHIC SET SIZE WIDTH8, HEIGHT8
      GRAPHIC SCALE (0, 0) - (1100, 650) ' < SCALE to keep original layout
    
      IF DSKTOPX>=1000 AND DSKTOPX<1100 THEN FF2=1100
      IF DSKTOPX>=1200 AND DSKTOPX<1300 THEN FF2=1200
      IF DSKTOPX>=1300 AND DSKTOPX<1400 THEN FF2=1500
      IF DSKTOPX>=1400 AND DSKTOPX<1500 THEN FF2=1400
      IF DSKTOPX>=1500 AND DSKTOPX<1600 THEN FF2=1300
      IF DSKTOPX>=1600 THEN FF2=1100
    
      FF=WIDTH8/FF2
    
      ' ---------------------------------------------------------------------------------------
      '
    
      STARTUP:
      FONT NEW "Times New Roman", FF*10,1 TO hFont10
      FONT NEW "Times New Roman", FF*12,1 TO hFont12
      FONT NEW "Times New Roman", FF*15,1 TO hFont15
      FONT NEW "Times New Roman", FF*19,1 TO hFont19
      FONT NEW "Times New Roman", FF*20,1 TO hFont20
      FONT NEW "Times New Roman", FF*25,1 TO hFont25
    
      '
      ' ----------------------------------------------------------------------------------------
    
    
      GRAPHIC CLEAR
    
      GRAPHIC WINDOW STABILIZE ' This make it so the X can not turn off program
      '------------------------------------------------------------------
    
      GRAPHIC WIDTH 3
      GRAPHIC SET FONT hFont19
    
      GOSUB INFO5 ' INFO5 IS THE FIRST SCREEN AND EXPLAINS HOW TO PICK AND ERASE SELECTIONS
      '
      ' SELECTION SECTION... FIVE COLUMNS OF SELECTION BOXES AND SHOPPING ITEMS ARE PRINTED
      ' AFTER THEN NAMES ARE PRINTED, THEY ARE ASSIGNED A VARIABLE... SUCH AS AA$="EGGS"
      ' ASKING THE PROGRAM TO GRAPHIC PRINT AA$ (TO SCREEN) OR XPRINT AA$(TO PRINTER) THE WORD EGGS WILL BE PRINTED
      '
    
      GRAPHIC CLEAR
    
      CONTINUE: ' Come here when done removing unwanted items previously selectedX
      GRAPHIC BOX (360,80)-(610,120),30,%RED,%RGB_MOCCASIN ' Selection Section Box
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET POS (400,83):GRAPHIC PRINT "Selection Section"
      GRAPHIC SET FONT hFont12
      GRAPHIC BOX (50,140)-(70,160),30,%RED,%RGB_MOCCASIN ' Pick BOX
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET POS (90,140):GRAPHIC PRINT "Eggs":Z1$(1)="Eggs"
      GRAPHIC BOX (50,180)-(70,200),30,%RED,%RGB_MOCCASIN ' Pick BOX
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET POS (90,180):GRAPHIC PRINT "Sour Cream":Z1$(2)="Sour Cream"
      GRAPHIC BOX (50,220)-(70,240),30,%RED,%RGB_MOCCASIN ' Pick BOX
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET POS (90,220):GRAPHIC PRINT "Lite Creamer":Z1$(3)="Lite Cream"
      GRAPHIC BOX (50,260)-(70,280),30,%RED,%RGB_MOCCASIN ' Pick BOX
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET POS (90,260):GRAPHIC PRINT "Milk":Z1$(4)="Milk"
      GRAPHIC BOX (50,300)-(70,320),30,%RED,%RGB_MOCCASIN ' Pick BOX
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET POS (90,300):GRAPHIC PRINT "Orange Juice":Z1$(5)="Orange Juice"
      GRAPHIC BOX (50,340)-(70,360),30,%RED,%RGB_MOCCASIN ' Pick BOX
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET POS (90,340):GRAPHIC PRINT "Vegetable Oil":Z1$(6)="Vegetable Oil"
      GRAPHIC BOX (50,380)-(70,400),30,%RED,%RGB_MOCCASIN ' Pick BOX
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET POS (90,380):GRAPHIC PRINT "Vinegar":Z1$(7)="Vinegar"
      GRAPHIC BOX (50,420)-(70,440),30,%RED,%RGB_MOCCASIN ' Pick BOX
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET POS (90,420):GRAPHIC PRINT "Mayoaise":Z1$(8)="Mayonaise"
      GRAPHIC BOX (50,460)-(70,480),30,%RED,%RGB_MOCCASIN ' Pick BOX
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET POS (90,460):GRAPHIC PRINT "Catsup":Z1$(9)="Catsup"
      '
      ' continue items on next column
      '
      ' These Next Four Pick Boxes are at the bottom of all screens
      '
      GRAPHIC BOX (300,575)-(430,600),30,%RED,%RGB_MOCCASIN ' Pick BOX to return to list from erase section
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET POS (314,576):GRAPHIC PRINT "Return To List"
      GRAPHIC BOX (500,575)-(670,600),30,%RED,%RGB_MOCCASIN ' Pick BOX to exit without printing anything - this leaves program
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET POS (512,576):GRAPHIC PRINT "Exit without printing"
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC BOX (90,575)-(205, 600),30,%RED,%RGB_MOCCASIN ' Pick BOX to go to remove marks section
      GRAPHIC SET POS (97,577):GRAPHIC PRINT "Remove Marks"
      GRAPHIC BOX (760,575)-(850, 600),30,%RED,%RGB_MOCCASIN ' Pick BOX to Print List to printer
      GRAPHIC SET POS (770,577):GRAPHIC PRINT "Print List"
      ' Column 2
      GRAPHIC SET FONT hFont12
      GRAPHIC BOX (250,140)-(270,160),30,%RED,%RGB_MOCCASIN ' Pick BOX
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET POS (290,140):GRAPHIC PRINT "Mustard":Z1$(10)="Mustard"
      GRAPHIC BOX (250,180)-(270,200),30,%RED,%RGB_MOCCASIN ' Pick BOX
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET POS (290,180):GRAPHIC PRINT "Potatos":Z1$(11)="Potatos"
      GRAPHIC BOX (250,220)-(270,240),30,%RED,%RGB_MOCCASIN ' Pick BOX
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET POS (290,220):GRAPHIC PRINT "Soy Sauce":Z1$(12)="Soy Sauce"
      GRAPHIC BOX (250,260)-(270,280),30,%RED,%RGB_MOCCASIN ' Pick BOX
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET POS (290,260):GRAPHIC PRINT "Bagels":Z1$(13)="Bagels"
      GRAPHIC BOX (250,300)-(270,320),30,%RED,%RGB_MOCCASIN ' Pick BOX
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET POS (290,300):GRAPHIC PRINT "Swirl Bread":Z1$(14)="Swirl Bread"
      GRAPHIC BOX (250,340)-(270,360),30,%RED,%RGB_MOCCASIN ' Pick BOX
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET POS (290,340):GRAPHIC PRINT "Water":Z1$(15)="Water"
      GRAPHIC BOX (250,380)-(270,400),30,%RED,%RGB_MOCCASIN ' Pick BOX
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET POS (290,380):GRAPHIC PRINT "Diet Pepsi":Z1$(16)="Diet Pepsi"
      GRAPHIC BOX (250,420)-(270,440),30,%RED,%RGB_MOCCASIN ' Pick BOX
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET POS (290,420):GRAPHIC PRINT "Taster's Choice":Z1$(17)="Taster's Choice"
      GRAPHIC BOX (250,460)-(270,480),30,%RED,%RGB_MOCCASIN ' Pick BOX
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET POS (290,460):GRAPHIC PRINT "Chicken Burger":Z1$(18)="Chicken Burger"
      ' Column 3
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC BOX (450,140)-(470,160),30,%RED,%RGB_MOCCASIN ' Pick BOX
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET POS (490,140):GRAPHIC PRINT "Le Seur Peas":Z1$(19)="Le Seur Peas"
      GRAPHIC BOX (450,180)-(470,200),30,%RED,%RGB_MOCCASIN ' Pick BOX
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET POS (490,180):GRAPHIC PRINT "Baked Beans":Z1$(20)="Baked Beans"
      GRAPHIC BOX (450,220)-(470,240),30,%RED,%RGB_MOCCASIN ' Pick BOX
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET POS (490,220):GRAPHIC PRINT "Olives":Z1$(21)="Olives"
      GRAPHIC BOX (450,260)-(470,280),30,%RED,%RGB_MOCCASIN ' Pick BOX
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET POS (490,260):GRAPHIC PRINT "Corn":Z1$(22)="Corn"
      GRAPHIC BOX (450,300)-(470,320),30,%RED,%RGB_MOCCASIN ' Pick BOX
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET POS (490,300):GRAPHIC PRINT "Stringbeens":Z1$(23)="String Beans"
      GRAPHIC BOX (450,340)-(470,360),30,%RED,%RGB_MOCCASIN ' Pick BOX
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET POS (490,340):GRAPHIC PRINT "Mushrooms":Z1$(24)="Mushrooms"
      GRAPHIC BOX (450,380)-(470,400),30,%RED,%RGB_MOCCASIN ' Pick BOX
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET POS (490,380):GRAPHIC PRINT "Paper Cups 12 oz":Z1$(25)="Paper Cups 12 oz"
      GRAPHIC BOX (450,420)-(470,440),30,%RED,%RGB_MOCCASIN ' Pick BOX
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET POS (490,420):GRAPHIC PRINT "Paper Plates":Z1$(26)="Paper Plates
      GRAPHIC BOX (450,460)-(470,480),30,%RED,%RGB_MOCCASIN ' Pick BOX
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET POS (490,460):GRAPHIC PRINT "Cling Wrap":Z1$(27)="Cling Wrap"
      GRAPHIC BOX (250,140)-(270,160),30,%RED,%RGB_MOCCASIN ' Pick BOX
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      ' Column 4
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC BOX (650,140)-(670,160),30,%RED,%RGB_MOCCASIN ' Pick BOX
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET POS (690,140):GRAPHIC PRINT "Trash Bags" : Z1$(28)="Trash Bags"
      GRAPHIC BOX (650,180)-(670,200),30,%RED,%RGB_MOCCASIN ' Pick BOX
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET POS (690,180):GRAPHIC PRINT "Scrubbing Bubbles":Z1$(29)="Scrubbing Bubbles"
      GRAPHIC BOX (650,220)-(670,240),30,%RED,%RGB_MOCCASIN ' Pick BOX
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET POS (690,220):GRAPHIC PRINT "Swiffer Floor Pads":Z1$(30)="Swiffer Floor Pads"
      GRAPHIC BOX (650,260)-(670,280),30,%RED,%RGB_MOCCASIN ' Pick BOX
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET POS (690,260):GRAPHIC PRINT "Stamps":Z1$(31)="Stamps"
      GRAPHIC BOX (650,300)-(670,320),30,%RED,%RGB_MOCCASIN ' Pick BOX
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET POS (690,300):GRAPHIC PRINT "Batteries":Z1$(32)="Batteries"
      GRAPHIC BOX (650,340)-(670,360),30,%RED,%RGB_MOCCASIN ' Pick BOX
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET POS (690,340):GRAPHIC PRINT "Quiche Appetizers":Z1$(33)="Quiche Appetizers"
      GRAPHIC BOX (650,380)-(670,400),30,%RED,%RGB_MOCCASIN ' Pick BOX
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET POS (690,380):GRAPHIC PRINT "Lox":Z1$(34)="Lox"
      GRAPHIC BOX (650,420)-(670,440),30,%RED,%RGB_MOCCASIN ' Pick BOX
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET POS (690,420):GRAPHIC PRINT "Salmon":Z1$(35)="Salmon"
      GRAPHIC BOX (650,460)-(670,480),30,%RED,%RGB_MOCCASIN ' Pick BOX
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET POS (690,460):GRAPHIC PRINT "Paper Towels":Z1$(36)="Papertowels"
      ' Column 5
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC BOX (850,140)-(870,160),30,%RED,%RGB_MOCCASIN ' Pick BOX
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET POS (890,140):GRAPHIC PRINT "Eye Roast":Z1$(37)="Eye Roast"
      GRAPHIC BOX (850,180)-(870,200),30,%RED,%RGB_MOCCASIN ' Pick BOX
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET POS (890,180):GRAPHIC PRINT "Hamburger Patties":Z1$(38)="Hamburger Patties"
      GRAPHIC BOX (850,220)-(870,240),30,%RED,%RGB_MOCCASIN ' Pick BOX
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET POS (890,220):GRAPHIC PRINT "Chicken Patties":Z1$(39)="Chicken Patties"
      GRAPHIC BOX (850,260)-(870,280),30,%RED,%RGB_MOCCASIN ' Pick BOX
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET POS (890,260):GRAPHIC PRINT "Hot Dogs":Z1$(40)="Hot Dogs"
      GRAPHIC BOX (850,300)-(870,320),30,%RED,%RGB_MOCCASIN ' Pick BOX
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET POS (890,300):GRAPHIC PRINT "Tuna Cans":Z1$(41)="Tuna Cans"
      GRAPHIC BOX (850,340)-(870,360),30,%RED,%RGB_MOCCASIN ' Pick BOX
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET POS (890,340):GRAPHIC PRINT "Vegetables":Z1$(42)="Vegetables"
      GRAPHIC BOX (850,380)-(870,400),30,%RED,%RGB_MOCCASIN ' Pick BOX
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET POS (890,380):GRAPHIC PRINT "Paper Towels":Z1$(43)="Paper Towels"
      GRAPHIC BOX (850,420)-(870,440),30,%RED,%RGB_MOCCASIN ' Pick BOX
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET POS (890,420):GRAPHIC PRINT "Charmin":Z1$(44)="Charmin"
      GRAPHIC BOX (850,460)-(870,480),30,%RED,%RGB_MOCCASIN ' Pick BOX
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET POS (890,460):GRAPHIC PRINT "Puffs":Z1$(45)="Puffs"
    
      ' THIS NEXT SECTION IS WHERE THE MARKS ARE PLACED IN THE PICKED BLOCKS... A MARK IN ANY BOX MEANS THAT ITEM WAS PICKED AND WILL BE HARD PRINTED...
      ' THE A? NUMBER ASSIGNED TO EACH ITEM IS SET TO ONE (1)... AN EXAMPLE IS THAT A1=1 AND HAS BEEN PICKED... A1=0 IS NOT A PICKED ITEM... ANY ITEM WHERE A?=0 WILL BE SKIPPED WHEN PRINTING TO PAPER...
      ' THE QUESTION MARK REPRESENTS THE NUMBER OF THE ITEM, SUCH AS... THE NUMBER A?, IS A1 IN THE CASE OF 'EGGS' AND A2 FOR 'SOUR CREAM' AND SO FORTH DOWN THE LIST...
    
      PICKBLOCKS: 'come her to pick items from the start or when coming back from the removal section
      '
      '
      '
      GRAPHIC BOX (360,80)-(610,120),30,%RED,%RGB_MOCCASIN ' Selection Section Box
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET FONT hFont19
      GRAPHIC SET POS (400,83):GRAPHIC PRINT "Selection Section"
      GRAPHIC SET FONT hFont12
      DO
         SLEEP 1
         GRAPHIC WINDOW CLICK TO click&, cx, cy ' Use Mouse to Pick Answer **************************
         IF CX>50 AND CX<70 AND CY>140 AND CY<160 AND A&(1)=0 THEN GRAPHIC SET POS (55,139):GRAPHIC PRINT CHR$(62):A&(1)=1
         IF CX>50 AND CX<70 AND CY>180 AND CY<200 AND A&(2)=0 THEN GRAPHIC SET POS (55,179):GRAPHIC PRINT CHR$(62):A&(2)=1
         IF CX>50 AND CX<70 AND CY>220 AND CY<240 AND A&(3)=0 THEN GRAPHIC SET POS (55,219):GRAPHIC PRINT CHR$(62):A&(3)=1
         IF CX>50 AND CX<70 AND CY>260 AND CY<280 AND A&(4)=0 THEN GRAPHIC SET POS (55,259):GRAPHIC PRINT CHR$(62):A&(4)=1
         IF CX>50 AND CX<70 AND CY>300 AND CY<320 AND A&(5)=0 THEN GRAPHIC SET POS (55,299):GRAPHIC PRINT CHR$(62):A&(5)=1
         IF CX>50 AND CX<70 AND CY>340 AND CY<360 AND A&(6)=0 THEN GRAPHIC SET POS (55,339):GRAPHIC PRINT CHR$(62):A&(6)=1
         IF CX>50 AND CX<70 AND CY>380 AND CY<400 AND A&(7)=0 THEN GRAPHIC SET POS (55,379):GRAPHIC PRINT CHR$(62):A&(7)=1
         IF CX>50 AND CX<70 AND CY>420 AND CY<440 AND A&(8)=0 THEN GRAPHIC SET POS (55,419):GRAPHIC PRINT CHR$(62):A&(8)=1
         IF CX>50 AND CX<70 AND CY>460 AND CY<480 AND A&(9)=0 THEN GRAPHIC SET POS (55,459):GRAPHIC PRINT CHR$(62):A&(9)=1
         ' Column 2
         IF CX>250 AND CX<270 AND CY>140 AND CY<160 AND A&(10)=0 THEN GRAPHIC SET POS (255,139):GRAPHIC PRINT CHR$(62):A&(10)=1
         IF CX>250 AND CX<270 AND CY>180 AND CY<200 AND A&(11)=0 THEN GRAPHIC SET POS (255,179):GRAPHIC PRINT CHR$(62):A&(11)=1
         IF CX>250 AND CX<270 AND CY>220 AND CY<240 AND A&(12)=0 THEN GRAPHIC SET POS (255,219):GRAPHIC PRINT CHR$(62):A&(12)=1
         IF CX>250 AND CX<270 AND CY>260 AND CY<280 AND A&(13)=0 THEN GRAPHIC SET POS (255,259):GRAPHIC PRINT CHR$(62):A&(13)=1
         IF CX>250 AND CX<270 AND CY>300 AND CY<320 AND A&(14)=0 THEN GRAPHIC SET POS (255,299):GRAPHIC PRINT CHR$(62):A&(14)=1
         IF CX>250 AND CX<270 AND CY>340 AND CY<360 AND A&(15)=0 THEN GRAPHIC SET POS (255,339):GRAPHIC PRINT CHR$(62):A&(15)=1
         IF CX>250 AND CX<270 AND CY>380 AND CY<400 AND A&(16)=0 THEN GRAPHIC SET POS (255,379):GRAPHIC PRINT CHR$(62):A&(16)=1
         IF CX>250 AND CX<270 AND CY>420 AND CY<440 AND A&(17)=0 THEN GRAPHIC SET POS (255,419):GRAPHIC PRINT CHR$(62):A&(17)=1
         IF CX>250 AND CX<270 AND CY>460 AND CY<480 AND A&(18)=0 THEN GRAPHIC SET POS (255,459):GRAPHIC PRINT CHR$(62):A&(18)=1
    
         ' Column 3
         IF CX>450 AND CX<470 AND CY>140 AND CY<160 AND A&(19)=0 THEN GRAPHIC SET POS (455,139):GRAPHIC PRINT CHR$(62):A&(19)=1
         IF CX>450 AND CX<470 AND CY>180 AND CY<200 AND A&(20)=0 THEN GRAPHIC SET POS (455,179):GRAPHIC PRINT CHR$(62):A&(20)=1
         IF CX>450 AND CX<470 AND CY>220 AND CY<240 AND A&(21)=0 THEN GRAPHIC SET POS (455,219):GRAPHIC PRINT CHR$(62):A&(21)=1
         IF CX>450 AND CX<470 AND CY>260 AND CY<280 AND A&(22)=0 THEN GRAPHIC SET POS (455,259):GRAPHIC PRINT CHR$(62):A&(22)=1
         IF CX>450 AND CX<470 AND CY>300 AND CY<320 AND A&(23)=0 THEN GRAPHIC SET POS (455,299):GRAPHIC PRINT CHR$(62):A&(23)=1
         IF CX>450 AND CX<470 AND CY>340 AND CY<360 AND A&(24)=0 THEN GRAPHIC SET POS (455,339):GRAPHIC PRINT CHR$(62):A&(24)=1
         IF CX>450 AND CX<470 AND CY>380 AND CY<400 AND A&(25)=0 THEN GRAPHIC SET POS (455,379):GRAPHIC PRINT CHR$(62):A&(25)=1
         IF CX>450 AND CX<470 AND CY>420 AND CY<440 AND A&(26)=0 THEN GRAPHIC SET POS (455,419):GRAPHIC PRINT CHR$(62):A&(26)=1
         IF CX>450 AND CX<470 AND CY>460 AND CY<480 AND A&(27)=0 THEN GRAPHIC SET POS (455,459):GRAPHIC PRINT CHR$(62):A&(27)=1
         '
         ' Column 4
         IF CX>650 AND CX<670 AND CY>140 AND CY<160 AND A&(28)=0 THEN GRAPHIC SET POS (655,139):GRAPHIC PRINT CHR$(62):A&(28)=1
         IF CX>650 AND CX<670 AND CY>180 AND CY<200 AND A&(29)=0 THEN GRAPHIC SET POS (655,179):GRAPHIC PRINT CHR$(62):A&(29)=1
         IF CX>650 AND CX<670 AND CY>220 AND CY<240 AND A&(30)=0 THEN GRAPHIC SET POS (655,219):GRAPHIC PRINT CHR$(62):A&(30)=1
         IF CX>650 AND CX<670 AND CY>260 AND CY<280 AND A&(31)=0 THEN GRAPHIC SET POS (655,259):GRAPHIC PRINT CHR$(62):A&(31)=1
         IF CX>650 AND CX<670 AND CY>300 AND CY<320 AND A&(32)=0 THEN GRAPHIC SET POS (655,299):GRAPHIC PRINT CHR$(62):A&(32)=1
         IF CX>650 AND CX<670 AND CY>340 AND CY<360 AND A&(33)=0 THEN GRAPHIC SET POS (655,339):GRAPHIC PRINT CHR$(62):A&(33)=1
         IF CX>650 AND CX<670 AND CY>380 AND CY<400 AND A&(34)=0 THEN GRAPHIC SET POS (655,379):GRAPHIC PRINT CHR$(62):A&(34)=1
         IF CX>650 AND CX<670 AND CY>420 AND CY<440 AND A&(35)=0 THEN GRAPHIC SET POS (655,419):GRAPHIC PRINT CHR$(62):A&(35)=1
         IF CX>650 AND CX<670 AND CY>460 AND CY<480 AND A&(36)=0 THEN GRAPHIC SET POS (655,459):GRAPHIC PRINT CHR$(62):A&(36)=1
         ' Come here after all columns are filled
    
         ' Column 5
         IF CX>850 AND CX<870 AND CY>140 AND CY<160 AND A&(37)=0 THEN GRAPHIC SET POS (855,139):GRAPHIC PRINT CHR$(62):A&(37)=1
         IF CX>850 AND CX<870 AND CY>180 AND CY<200 AND A&(38)=0 THEN GRAPHIC SET POS (855,179):GRAPHIC PRINT CHR$(62):A&(38)=1
         IF CX>850 AND CX<870 AND CY>220 AND CY<240 AND A&(39)=0 THEN GRAPHIC SET POS (855,219):GRAPHIC PRINT CHR$(62):A&(39)=1
         IF CX>850 AND CX<870 AND CY>260 AND CY<280 AND A&(40)=0 THEN GRAPHIC SET POS (855,259):GRAPHIC PRINT CHR$(62):A&(40)=1
         IF CX>850 AND CX<870 AND CY>300 AND CY<320 AND A&(41)=0 THEN GRAPHIC SET POS (855,299):GRAPHIC PRINT CHR$(62):A&(41)=1
         IF CX>850 AND CX<870 AND CY>340 AND CY<360 AND A&(42)=0 THEN GRAPHIC SET POS (855,339):GRAPHIC PRINT CHR$(62):A&(42)=1
         IF CX>850 AND CX<870 AND CY>380 AND CY<400 AND A&(43)=0 THEN GRAPHIC SET POS (855,379):GRAPHIC PRINT CHR$(62):A&(43)=1
         IF CX>850 AND CX<870 AND CY>420 AND CY<440 AND A&(44)=0 THEN GRAPHIC SET POS (855,419):GRAPHIC PRINT CHR$(62):A&(44)=1
         IF CX>850 AND CX<870 AND CY>460 AND CY<480 AND A&(45)=0 THEN GRAPHIC SET POS (855,459):GRAPHIC PRINT CHR$(62):A&(45)=1
         '
         IF CX>90 AND CX<200 AND CY>570 AND CY<600 THEN GOTO REMOVAL ' Remove items that you do not want on printed list...
         IF CX>760 AND CX<850 AND CY>570 AND CY<600 THEN GOTO PRINTIT ' Get a paper printout then leave program
         IF CX>500 AND CX<660 AND CY>570 AND CY<600 THEN GOTO EXITIT ' leave program without paper printing
      LOOP
    
      ' THE NEXT SECTION IS THE ERASEING SECTION... THE ERASEIT SECTION IS WHERE WE ERASE THE MARK FROM THE PICK BOX, SET PICKBOX REFERENCE NUMBER 'A?' BACK TO ZERO (A?=0)
      ' WE CAN RETURN TO THE PICKING SECTION TO CONTINUE PICKING IF MORE ITEMS ARE NEEDED
      ' IMPORTANT - IMPORTANT - IMPORTANT... WE CAN GO FROM THE PICKING SECTION TO THE ERASEING SECTION AND BACK AS MANY TIMES AS NEEDED
    
      REMOVAL:
    
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET FONT hFont19
      GRAPHIC SET POS (400,83):GRAPHIC PRINT "Removal Section"
      GRAPHIC SET FONT hFont12
    
      S$ = SPACE$(4)
      DO
         SLEEP 1
         GRAPHIC WINDOW CLICK TO click&, cx, cy ' Use Mouse to Pick Answer **************************
         ' Column 1 erase marks
         IF CX>50 AND CX<70 AND CY>140 AND CY<160 AND A&(1)=1 THEN GRAPHIC SET POS (50,140):GRAPHIC PRINT S$:GRAPHIC BOX (50,140)-(70,160),30,%RED,%RGB_MOCCASIN:A&(1)=0
         IF CX>50 AND CX<70 AND CY>180 AND CY<200 AND A&(2)=1 THEN GRAPHIC SET POS (55,180):GRAPHIC PRINT S$:GRAPHIC BOX (50,180)-(70,200),30,%RED,%RGB_MOCCASIN:A&(2)=0
         IF CX>50 AND CX<70 AND CY>220 AND CY<240 AND A&(3)=1 THEN GRAPHIC SET POS (55,220):GRAPHIC PRINT S$:GRAPHIC BOX (50,220)-(70,240),30,%RED,%RGB_MOCCASIN:A&(3)=0
         IF CX>50 AND CX<70 AND CY>260 AND CY<280 AND A&(4)=1 THEN GRAPHIC SET POS (55,260):GRAPHIC PRINT S$:GRAPHIC BOX (50,260)-(70,280),30,%RED,%RGB_MOCCASIN:A&(4)=0
         IF CX>50 AND CX<70 AND CY>300 AND CY<320 AND A&(5)=1 THEN GRAPHIC SET POS (55,300):GRAPHIC PRINT S$:GRAPHIC BOX (50,300)-(70,320),30,%RED,%RGB_MOCCASIN:A&(5)=0
         IF CX>50 AND CX<70 AND CY>340 AND CY<360 AND A&(6)=1 THEN GRAPHIC SET POS (55,340):GRAPHIC PRINT S$:GRAPHIC BOX (50,340)-(70,360),30,%RED,%RGB_MOCCASIN:A&(6)=0
         IF CX>50 AND CX<70 AND CY>380 AND CY<400 AND A&(7)=1 THEN GRAPHIC SET POS (55,380):GRAPHIC PRINT S$:GRAPHIC BOX (50,380)-(70,400),30,%RED,%RGB_MOCCASIN:A&(7)=0
         IF CX>50 AND CX<70 AND CY>420 AND CY<440 AND A&(8)=1 THEN GRAPHIC SET POS (55,420):GRAPHIC PRINT S$:GRAPHIC BOX (50,420)-(70,440),30,%RED,%RGB_MOCCASIN:A&(8)=0
         IF CX>50 AND CX<70 AND CY>460 AND CY<480 AND A&(9)=1 THEN GRAPHIC SET POS (55,460):GRAPHIC PRINT S$:GRAPHIC BOX (50,460)-(70,480),30,%RED,%RGB_MOCCASIN:A&(9)=0
         ' Column 2 erase marks
         IF CX>250 AND CX<270 AND CY>140 AND CY<160 AND A&(10)=1 THEN GRAPHIC SET POS (255,140):GRAPHIC PRINT S$:GRAPHIC BOX (250,140)-(270,160),30,%RED,%RGB_MOCCASIN:A&(10)=0
         IF CX>250 AND CX<270 AND CY>180 AND CY<200 AND A&(11)=1 THEN GRAPHIC SET POS (255,180):GRAPHIC PRINT S$:GRAPHIC BOX (250,180)-(270,200),30,%RED,%RGB_MOCCASIN:A&(11)=0
         IF CX>250 AND CX<270 AND CY>220 AND CY<240 AND A&(12)=1 THEN GRAPHIC SET POS (255,220):GRAPHIC PRINT S$:GRAPHIC BOX (250,220)-(270,240),30,%RED,%RGB_MOCCASIN:A&(12)=0
         IF CX>250 AND CX<270 AND CY>260 AND CY<280 AND A&(13)=1 THEN GRAPHIC SET POS (255,260):GRAPHIC PRINT S$:GRAPHIC BOX (250,260)-(270,280),30,%RED,%RGB_MOCCASIN:A&(13)=0
         IF CX>250 AND CX<270 AND CY>300 AND CY<320 AND A&(14)=1 THEN GRAPHIC SET POS (255,300):GRAPHIC PRINT S$:GRAPHIC BOX (250,300)-(270,320),30,%RED,%RGB_MOCCASIN:A&(14)=0
         IF CX>250 AND CX<270 AND CY>340 AND CY<360 AND A&(15)=1 THEN GRAPHIC SET POS (255,340):GRAPHIC PRINT S$:GRAPHIC BOX (250,340)-(270,360),30,%RED,%RGB_MOCCASIN:A&(15)=0
         IF CX>250 AND CX<270 AND CY>380 AND CY<400 AND A&(16)=1 THEN GRAPHIC SET POS (255,380):GRAPHIC PRINT S$:GRAPHIC BOX (250,380)-(270,400),30,%RED,%RGB_MOCCASIN:A&(16)=0
         IF CX>250 AND CX<270 AND CY>420 AND CY<440 AND A&(17)=1 THEN GRAPHIC SET POS (255,420):GRAPHIC PRINT S$:GRAPHIC BOX (250,420)-(270,440),30,%RED,%RGB_MOCCASIN:A&(17)=0
         IF CX>250 AND CX<270 AND CY>460 AND CY<480 AND A&(18)=1 THEN GRAPHIC SET POS (255,460):GRAPHIC PRINT S$:GRAPHIC BOX (250,460)-(270,480),30,%RED,%RGB_MOCCASIN:A&(18)=0
         ' Column 3 erase marks
         IF CX>450 AND CX<470 AND CY>140 AND CY<160 AND A&(19)=1 THEN GRAPHIC SET POS (455,140):GRAPHIC PRINT S$:GRAPHIC BOX (450,140)-(470,160),30,%RED,%RGB_MOCCASIN:A&(19)=0
         IF CX>450 AND CX<470 AND CY>180 AND CY<200 AND A&(20)=1 THEN GRAPHIC SET POS (455,180):GRAPHIC PRINT S$:GRAPHIC BOX (450,180)-(470,200),30,%RED,%RGB_MOCCASIN:A&(20)=0
         IF CX>450 AND CX<470 AND CY>220 AND CY<240 AND A&(21)=1 THEN GRAPHIC SET POS (455,220):GRAPHIC PRINT S$:GRAPHIC BOX (450,220)-(470,240),30,%RED,%RGB_MOCCASIN:A&(21)=0
         IF CX>450 AND CX<470 AND CY>260 AND CY<280 AND A&(22)=1 THEN GRAPHIC SET POS (455,260):GRAPHIC PRINT S$:GRAPHIC BOX (450,260)-(470,280),30,%RED,%RGB_MOCCASIN:A&(22)=0
         IF CX>450 AND CX<470 AND CY>300 AND CY<320 AND A&(23)=1 THEN GRAPHIC SET POS (455,300):GRAPHIC PRINT S$:GRAPHIC BOX (450,300)-(470,320),30,%RED,%RGB_MOCCASIN:A&(23)=0
         IF CX>450 AND CX<470 AND CY>340 AND CY<360 AND A&(24)=1 THEN GRAPHIC SET POS (455,340):GRAPHIC PRINT S$:GRAPHIC BOX (450,340)-(470,360),30,%RED,%RGB_MOCCASIN:A&(24)=0
         IF CX>450 AND CX<470 AND CY>380 AND CY<400 AND A&(25)=1 THEN GRAPHIC SET POS (455,380):GRAPHIC PRINT S$:GRAPHIC BOX (450,380)-(470,400),30,%RED,%RGB_MOCCASIN:A&(25)=0
         IF CX>450 AND CX<470 AND CY>420 AND CY<440 AND A&(26)=1 THEN GRAPHIC SET POS (455,420):GRAPHIC PRINT S$:GRAPHIC BOX (450,420)-(470,440),30,%RED,%RGB_MOCCASIN:A&(26)=0
         IF CX>450 AND CX<470 AND CY>460 AND CY<480 AND A&(27)=1 THEN GRAPHIC SET POS (455,460):GRAPHIC PRINT S$:GRAPHIC BOX (450,460)-(470,480),30,%RED,%RGB_MOCCASIN:A&(27)=0
         ' Column 4 erase marks
         IF CX>650 AND CX<670 AND CY>140 AND CY<160 AND A&(28)=1 THEN GRAPHIC SET POS (655,140):GRAPHIC PRINT S$:GRAPHIC BOX (650,140)-(670,160),30,%RED,%RGB_MOCCASIN:A&(28)=0
         IF CX>650 AND CX<670 AND CY>180 AND CY<200 AND A&(29)=1 THEN GRAPHIC SET POS (655,180):GRAPHIC PRINT S$:GRAPHIC BOX (650,180)-(670,200),30,%RED,%RGB_MOCCASIN:A&(29)=0
         IF CX>650 AND CX<670 AND CY>220 AND CY<240 AND A&(30)=1 THEN GRAPHIC SET POS (655,220):GRAPHIC PRINT S$:GRAPHIC BOX (650,220)-(670,240),30,%RED,%RGB_MOCCASIN:A&(30)=0
         IF CX>650 AND CX<670 AND CY>260 AND CY<280 AND A&(31)=1 THEN GRAPHIC SET POS (655,260):GRAPHIC PRINT S$:GRAPHIC BOX (650,260)-(670,280),30,%RED,%RGB_MOCCASIN:A&(31)=0
         IF CX>650 AND CX<670 AND CY>300 AND CY<320 AND A&(32)=1 THEN GRAPHIC SET POS (655,300):GRAPHIC PRINT S$:GRAPHIC BOX (650,300)-(670,320),30,%RED,%RGB_MOCCASIN:A&(32)=0
         IF CX>650 AND CX<670 AND CY>340 AND CY<360 AND A&(33)=1 THEN GRAPHIC SET POS (655,340):GRAPHIC PRINT S$:GRAPHIC BOX (650,340)-(670,360),30,%RED,%RGB_MOCCASIN:A&(33)=0
         IF CX>650 AND CX<670 AND CY>380 AND CY<400 AND A&(34)=1 THEN GRAPHIC SET POS (655,380):GRAPHIC PRINT S$:GRAPHIC BOX (650,380)-(670,400),30,%RED,%RGB_MOCCASIN:A&(34)=0
         IF CX>650 AND CX<670 AND CY>420 AND CY<440 AND A&(35)=1 THEN GRAPHIC SET POS (655,420):GRAPHIC PRINT S$:GRAPHIC BOX (650,420)-(670,440),30,%RED,%RGB_MOCCASIN:A&(35)=0
         IF CX>650 AND CX<670 AND CY>460 AND CY<480 AND A&(36)=1 THEN GRAPHIC SET POS (655,460):GRAPHIC PRINT S$:GRAPHIC BOX (650,460)-(670,480),30,%RED,%RGB_MOCCASIN:A&(36)=0
         ' Column 5 erase marks
         IF CX>850 AND CX<870 AND CY>140 AND CY<160 AND A&(37)=1 THEN GRAPHIC SET POS (855,140):GRAPHIC PRINT S$:GRAPHIC BOX (850,140)-(870,160),30,%RED,%RGB_MOCCASIN:A&(37)=0
         IF CX>850 AND CX<870 AND CY>180 AND CY<200 AND A&(38)=1 THEN GRAPHIC SET POS (855,180):GRAPHIC PRINT S$:GRAPHIC BOX (850,180)-(870,200),30,%RED,%RGB_MOCCASIN:A&(38)=0
         IF CX>850 AND CX<870 AND CY>220 AND CY<240 AND A&(39)=1 THEN GRAPHIC SET POS (855,220):GRAPHIC PRINT S$:GRAPHIC BOX (850,220)-(870,240),30,%RED,%RGB_MOCCASIN:A&(39)=0
         IF CX>850 AND CX<870 AND CY>260 AND CY<280 AND A&(40)=1 THEN GRAPHIC SET POS (855,260):GRAPHIC PRINT S$:GRAPHIC BOX (850,260)-(870,280),30,%RED,%RGB_MOCCASIN:A&(40)=0
         IF CX>850 AND CX<870 AND CY>300 AND CY<320 AND A&(41)=1 THEN GRAPHIC SET POS (855,300):GRAPHIC PRINT S$:GRAPHIC BOX (850,300)-(870,320),30,%RED,%RGB_MOCCASIN:A&(41)=0
         IF CX>850 AND CX<870 AND CY>340 AND CY<360 AND A&(42)=1 THEN GRAPHIC SET POS (855,340):GRAPHIC PRINT S$:GRAPHIC BOX (850,340)-(870,360),30,%RED,%RGB_MOCCASIN:A&(42)=0
         IF CX>850 AND CX<870 AND CY>380 AND CY<400 AND A&(43)=1 THEN GRAPHIC SET POS (855,380):GRAPHIC PRINT S$:GRAPHIC BOX (850,380)-(870,400),30,%RED,%RGB_MOCCASIN:A&(43)=0
         IF CX>850 AND CX<870 AND CY>420 AND CY<440 AND A&(44)=1 THEN GRAPHIC SET POS (855,420):GRAPHIC PRINT S$:GRAPHIC BOX (850,420)-(870,440),30,%RED,%RGB_MOCCASIN:A&(44)=0
         IF CX>850 AND CX<870 AND CY>460 AND CY<480 AND A&(45)=1 THEN GRAPHIC SET POS (855,460):GRAPHIC PRINT S$:GRAPHIC BOX (850,460)-(870,480),30,%RED,%RGB_MOCCASIN:A&(45)=0
         IF CX>300 AND CX<430 AND CY>570 AND CY<600 THEN GOTO PICKBLOCKS 'Return to pickblocks to select more items
         '
      LOOP
      '
      INFO5:
      '
      ' THIS IS THE FIRST SCREEN DISPLAYED AND EXPLAINS THE USE OF THE PROGRAM...
      '
      GRAPHIC CLEAR ' CLEARS SCREEN COMPLETELY
      GRAPHIC BOX (20,30)-(975,563),30,%RED,%RGB_MOCCASIN ' Large Screen BOX
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC BOX (340,130)-(610,168),30,%RED,%RGB_MOCCASIN ' BJ's BOX
      GRAPHIC BOX (400,430)-(540,470),30,%RED,%RGB_MOCCASIN ' Continue BOX
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
    
      GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
      GRAPHIC SET POS (365,132):GRAPHIC PRINT "BJ's Shopping List" ' PRINTED IN BJ's BOX
      GRAPHIC SET POS (420,432):GRAPHIC PRINT "Continue" ' PRINTED IN CONTINUE BOX
      GRAPHIC SET POS (70,175):GRAPHIC PRINT "This shopping list is for shopping at BJ's only."
      GRAPHIC SET POS (70,215):GRAPHIC PRINT "If you want an item on the list, pick the box in front of the item."
      GRAPHIC SET POS (70,255):GRAPHIC PRINT "If you decide to change your mind, pick the remove box and again pick the items."
      GRAPHIC SET POS (70,295):GRAPHIC PRINT "When you have picked all the item you want, pick the 'Print List' box."
      GRAPHIC SET POS (70,335):GRAPHIC PRINT "For other stores, pick it from the index page when we get an index page!"
      '
      DO
         GRAPHIC WINDOW CLICK TO click&, cx, cy ' Use Mouse to Pick Answer **************************
         IF CX>380 AND CX<520 AND CY>430 AND CY<463 THEN RETURN ' THE PROGRAM CAME HERE FROM A SUB ROUTINE COMMAND AND NEEDS A RETURN COMMAND TO GET BACT TO THE NEXT LINE UNDER THAT SUB ROUTINE COMMAND...
      LOOP
      '
      ' SENDING THE CHOSEN ITEMS TO THE PRINTER... ONLY ITEM THAT THE A?=1 WILL BE PRINTED...
      ' WE USE THE FOR/NEXT LOOP TO SELECT THE ITEMS THAT ARE SET TO THE NUMBER ONE... THE ITEMS SET TO ZERO WILL BE SKIPPED...
      '
      PRINTIT:
      ' THIS WAS AS FAR AS THE PROGRAM WAS CORRECT...
      'GRAPHIC SET POS(2,2):GRAPHIC PRINT "A1, A3, A5, A7",A1,A3,A5,A7 USED THESE FOUR LINS TO SEE WHERE SEQUINCE WENT WRONG... IT PRINTED ALL THE A's CORRECTLY
      'GRAPHIC SET POS(2,22):GRAPHIC PRINT "O1,Z1$(O1)= ",O1,Z1$(01) IT DIDN'T PRINT THE Z1$(O1)... PROBLEM COULD BE HERE???
      'GRAPHIC SET POS(2,42):GRAPHIC PRINT "ZZ$= ",ZZ$ IT PRINTED 'MUSHROOM' AND THAT IS WHAT ZZ$ IS... IT USED THE ZZ$ FROM THE ABOVE SETTING, NOT THE Z1$(O1) NUMBER
      'GRAPHIC WAITKEY$
    
      '
      XPRINT ATTACH DEFAULT
      XPRINT SET FONT hFont15
      XPRINT:XPRINT TAB(23)"BJ's List"
      XPRINT SET FONT hFont10
      XPRINT
      '
      'HARD PRINT USING ABOVE AMENDED LIST... ELIMINATING ALL ITEMS NOT MARKED A&(O1)=1
      '
      FOR O1=1 TO 45
          IF A&(O1) THEN XPRINT TAB(10),Z1$(O1);TAB(50)Z1$(O1)
      NEXT
      '
      XPRINT CLOSE
    
    
      EXITIT: 'End Of Program
    
    
    END FUNCTION
    Last edited by Borje Hagsten; 8 Apr 2019, 11:15 AM.

    Comment


    • #3
      Wow

      Congratulations Izzy on being a programmer at 85

      Do we have any older programmers on the forum?

      I am 73 - I do hope I have 12 more years programming in me!!!!

      I wrote my first program when I was about 19 - so I have been programming for about 54 years. I wonder what the world record for length of time as a programmer is. I have always programmed but some of the time, I was not a fully committed professional programmer so my record is not 'pure'.

      Kerry
      [I]I made a coding error once - but fortunately I fixed it before anyone noticed[/I]
      Kerry Farmer

      Comment


      • #4
        Kerry, you have beat me by a mile... I started selling 10 different uses Civil Engineering programs for the Texas Instrument's TI57 calculator...
        It was a 50 step programmable calculator that had to be reprogrammed after turning it off... I adjusted the programs for their TI 58 and TI 59 when they pulled the TI57 for doing more than they expected... I then had written programs for the 5-1/4 and later the 3-1/2 discs... The rest is history... I also want to thank you for fixing my shopping program... It is amazing how you remember the commands after someone reminds you... Thanx again, and happy computing... One last thing... I know why they say not to mess with old people... A "30 to life" sentence doesn't scare them very much...

        Comment


        • #5
          Borje:
          Thanx for taking the time to find the problem that a programming tyro would't do... It is people such as you and Kerry that keep us on our toes... Another reason for me is that they raised the urinals higher in my town...
          Izzy

          Comment


          • #6
            Izzy One of my claims to fame was that I wrote an operating system (strictly speaking it was a tape operating system) for a calculator. The calculator had an endless tape which had four blocks of data on it. I forget the brand and the model!! But the system worked. This was pre internet so I was unable to market it easily - ahh lost opportunities! Kerry
            [I]I made a coding error once - but fortunately I fixed it before anyone noticed[/I]
            Kerry Farmer

            Comment


            • #7
              Hi, Borje
              I had to adjust your printing section to get what I was looking for...
              Two columns of only selected items...
              Your original printed the same 'O1' in both columns.
              See if this doesn't work better...

              {code}
              PRINTIT:
              '
              XPRINT ATTACH DEFAULT
              XPRINT SET FONT hFont15
              XPRINT:XPRINT TAB(23)"BJ's List"
              XPRINT SET FONT hFont10
              XPRINT
              '
              'HARD PRINT USING ABOVE AMENDED LIST... ELIMINATING ALL ITEMS NOT MARKED A&(O1)=1
              '
              ' BORJE... THIS IS THE CHANGED PART
              '
              X=10
              FOR O1=1 TO 45
              IF A&(O1) THEN XPRINT TAB(X),Z1$(O1);TAB(X+40)Z1$(O1+1) 'THIS MOVES 2ND CHOICE TO 2ND COLUMN AND KEEPS IT ON THE SAME LINE AS 1ST ENTRY...
              O1=O1+1 ' THIS ADVANCES O1 TO NEXT PROPER NUMBER BECAUSE THE 2ND PART OF THE LAST LINE DID NOT ADVANCE THE COUNTER...
              NEXT
              '
              XPRINT CLOSE
              {/CODE}

              Izzy

              Comment


              • #8
                Hi Izzy,

                I had a play with Borje's modified version.
                This one further uses arrays to make the program a little more 'generic' to facilitate using different lists for different vendors.
                It occurred to me that the selections could be made / modified on the same page - click once to select / click again to remove..
                Code:
                #COMPILE EXE
                #CONSOLE OFF
                '#DEBUG ERROR ON
                '#INCLUDE "Win32API.inc"
                
                FUNCTION PBMAIN () AS LONG
                
                  LOCAL WIDTH8, HEIGHT8, DSKTOPX, DSKTOPY AS LONG
                  LOCAL FF, FF2 AS DOUBLE
                  LOCAL hFont10, hFont12, hFont15,hFont20, hFont19, hFont25 AS LONG
                  LOCAL O1 AS LONG
                
                  DIM A&(1 TO 45)           ' Pick status array
                  DIM Z1$(45)               ' (0) = List Title, (1 to 45) = Items
                
                  Dim Picks&(1 To 9, 1 To 5) At VarPtr(A&(1))
                
                  LOCAL CX!, CY!, CLICK&
                  LOCAL hGW1&
                
                  ' Load array with shopping list (could be read from a disk file?)
                  ' First item Z1$(0) is Vendor Name
                  Array Assign Z1$() = "BJ's","Eggs","Sour Cream","Lite Creamer","Milk","Orange Juice","Vegetable Oil","Vinegar","Mayoaise","Catsup", _
                 "Mustard","Potatos","Soy Sauce","Bagels","Swirl Bread","Water","Diet Pepsi","Taster's Choice","Chicken Burger", _
                 "Le Seur Peas", "Baked Beans","Olives","Corn","Stringbeens","Mushrooms","Paper Cups 12 oz","Paper Plates","Cling Wrap", _
                 "Trash Bags","Scrubbing Bubbles","Swiffer Floor Pads","Stamps","Batteries","Quiche Appetizers","Lox","Salmon","Paper Towels", _
                 "Eye Roast","Hamburger Patties","Chicken Patties","Hot Dogs","Tuna Cans","Vegetables","Paper Towels","Charmin","Puffs"
                
                
                  '------------------------------------------------------------------
                
                  'do some graphics
                  yloc#= 495
                  GRAPHIC TEXT SIZE "Shopping list" TO tx&,yx&
                  GRAPHIC SET POS (-tx&/2,yloc#)
                
                  DESKTOP GET CLIENT TO dsktopx, dsktopy
                
                  GRAPHIC WINDOW "Shopping list", 0, 0, 1100, 650 TO hGW1&
                
                  WIDTH8 = dsktopx : HEIGHT8 = dsktopy
                  GRAPHIC SET SIZE WIDTH8, HEIGHT8
                  GRAPHIC SCALE (0, 0) - (1100, 650) ' < SCALE to keep original layout
                
                  IF DSKTOPX>=1000 AND DSKTOPX<1100 THEN FF2=1100
                  IF DSKTOPX>=1200 AND DSKTOPX<1300 THEN FF2=1200
                  IF DSKTOPX>=1300 AND DSKTOPX<1400 THEN FF2=1500
                  IF DSKTOPX>=1400 AND DSKTOPX<1500 THEN FF2=1400
                  IF DSKTOPX>=1500 AND DSKTOPX<1600 THEN FF2=1300
                  IF DSKTOPX>=1600 THEN FF2=1100
                
                  FF = WIDTH8/FF2               ' calculate scale factor for fonts
                
                  ' ---------------------------------------------------------------------------------------
                  '
                
                  STARTUP:
                  FONT NEW "Times New Roman", FF*10,1 TO hFont10
                  FONT NEW "Times New Roman", FF*12,1 TO hFont12
                  FONT NEW "Times New Roman", FF*15,1 TO hFont15
                  FONT NEW "Times New Roman", FF*19,1 TO hFont19
                  FONT NEW "Times New Roman", FF*20,1 TO hFont20
                  FONT NEW "Times New Roman", FF*25,1 TO hFont25
                
                  '
                  ' ----------------------------------------------------------------------------------------
                
                
                  GRAPHIC CLEAR
                
                  GRAPHIC WINDOW STABILIZE ' This make it so the X can not turn off program
                  '------------------------------------------------------------------
                
                  GRAPHIC WIDTH 3
                  GRAPHIC SET FONT hFont19
                
                  GOSUB INFO5 ' INFO5 IS THE FIRST SCREEN AND EXPLAINS HOW TO PICK AND ERASE SELECTIONS
                  '
                  ' SELECTION SECTION... FIVE COLUMNS OF SELECTION BOXES AND SHOPPING ITEMS ARE PRINTED
                  '
                  GRAPHIC Clear
                
                  ' These Two Pick Boxes are at the bottom of the selection screen(s)
                  '
                  GRAPHIC SET FONT hFont12
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC BOX (500,575)-(670,600),30,%RED,%RGB_MOCCASIN ' Pick BOX to exit without printing anything - this leaves program
                  GRAPHIC SET POS (512,576):GRAPHIC PRINT "Exit without printing"
                  GRAPHIC BOX (760,575)-(850, 600),30,%RED,%RGB_MOCCASIN ' Pick BOX to Print List to printer
                  GRAPHIC SET POS (770,577):GRAPHIC PRINT "Print List"
                
                  ' Column 1  ( 9 rows)
                  GRAPHIC BOX (50,140)-(70,160),30,%RED,%RGB_MOCCASIN ' Pick BOX
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC SET POS (90,140):GRAPHIC PRINT Z1$(1)
                  GRAPHIC BOX (50,180)-(70,200),30,%RED,%RGB_MOCCASIN ' Pick BOX
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC SET POS (90,180):GRAPHIC PRINT Z1$(2)
                  GRAPHIC BOX (50,220)-(70,240),30,%RED,%RGB_MOCCASIN ' Pick BOX
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC SET POS (90,220):GRAPHIC PRINT Z1$(3)
                  GRAPHIC BOX (50,260)-(70,280),30,%RED,%RGB_MOCCASIN ' Pick BOX
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC SET POS (90,260):GRAPHIC PRINT Z1$(4)
                  GRAPHIC BOX (50,300)-(70,320),30,%RED,%RGB_MOCCASIN ' Pick BOX
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC SET POS (90,300):GRAPHIC PRINT Z1$(5)
                  GRAPHIC BOX (50,340)-(70,360),30,%RED,%RGB_MOCCASIN ' Pick BOX
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC SET POS (90,340):GRAPHIC PRINT Z1$(6)
                  GRAPHIC BOX (50,380)-(70,400),30,%RED,%RGB_MOCCASIN ' Pick BOX
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC SET POS (90,380):GRAPHIC PRINT Z1$(7)
                  GRAPHIC BOX (50,420)-(70,440),30,%RED,%RGB_MOCCASIN ' Pick BOX
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC SET POS (90,420):GRAPHIC PRINT Z1$(8)
                  GRAPHIC BOX (50,460)-(70,480),30,%RED,%RGB_MOCCASIN ' Pick BOX
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC SET POS (90,460):GRAPHIC PRINT Z1$(9)
                  ' Column 2
                  GRAPHIC BOX (250,140)-(270,160),30,%RED,%RGB_MOCCASIN ' Pick BOX
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC SET POS (290,140):GRAPHIC PRINT Z1$(10)
                  GRAPHIC BOX (250,180)-(270,200),30,%RED,%RGB_MOCCASIN ' Pick BOX
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC SET POS (290,180):GRAPHIC PRINT Z1$(11)
                  GRAPHIC BOX (250,220)-(270,240),30,%RED,%RGB_MOCCASIN ' Pick BOX
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC SET POS (290,220):GRAPHIC PRINT Z1$(12)
                  GRAPHIC BOX (250,260)-(270,280),30,%RED,%RGB_MOCCASIN ' Pick BOX
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC SET POS (290,260):GRAPHIC PRINT Z1$(13)
                  GRAPHIC BOX (250,300)-(270,320),30,%RED,%RGB_MOCCASIN ' Pick BOX
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC SET POS (290,300):GRAPHIC PRINT Z1$(14)
                  GRAPHIC BOX (250,340)-(270,360),30,%RED,%RGB_MOCCASIN ' Pick BOX
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC SET POS (290,340):GRAPHIC PRINT Z1$(15)
                  GRAPHIC BOX (250,380)-(270,400),30,%RED,%RGB_MOCCASIN ' Pick BOX
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC SET POS (290,380):GRAPHIC PRINT Z1$(16)
                  GRAPHIC BOX (250,420)-(270,440),30,%RED,%RGB_MOCCASIN ' Pick BOX
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC SET POS (290,420):GRAPHIC PRINT Z1$(17)
                  GRAPHIC BOX (250,460)-(270,480),30,%RED,%RGB_MOCCASIN ' Pick BOX
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC SET POS (290,460):GRAPHIC PRINT Z1$(18)
                  ' Column 3
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC BOX (450,140)-(470,160),30,%RED,%RGB_MOCCASIN ' Pick BOX
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC SET POS (490,140):GRAPHIC PRINT Z1$(19)
                  GRAPHIC BOX (450,180)-(470,200),30,%RED,%RGB_MOCCASIN ' Pick BOX
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC SET POS (490,180):GRAPHIC PRINT Z1$(20)
                  GRAPHIC BOX (450,220)-(470,240),30,%RED,%RGB_MOCCASIN ' Pick BOX
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC SET POS (490,220):GRAPHIC PRINT Z1$(21)
                  GRAPHIC BOX (450,260)-(470,280),30,%RED,%RGB_MOCCASIN ' Pick BOX
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC SET POS (490,260):GRAPHIC PRINT Z1$(22)
                  GRAPHIC BOX (450,300)-(470,320),30,%RED,%RGB_MOCCASIN ' Pick BOX
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC SET POS (490,300):GRAPHIC PRINT Z1$(23)
                  GRAPHIC BOX (450,340)-(470,360),30,%RED,%RGB_MOCCASIN ' Pick BOX
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC SET POS (490,340):GRAPHIC PRINT Z1$(24)
                  GRAPHIC BOX (450,380)-(470,400),30,%RED,%RGB_MOCCASIN ' Pick BOX
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC SET POS (490,380):GRAPHIC PRINT Z1$(25)
                  GRAPHIC BOX (450,420)-(470,440),30,%RED,%RGB_MOCCASIN ' Pick BOX
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC SET POS (490,420):GRAPHIC PRINT Z1$(26)
                  GRAPHIC BOX (450,460)-(470,480),30,%RED,%RGB_MOCCASIN ' Pick BOX
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC SET POS (490,460):GRAPHIC PRINT Z1$(27)
                  GRAPHIC BOX (250,140)-(270,160),30,%RED,%RGB_MOCCASIN ' Pick BOX
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  ' Column 4
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC BOX (650,140)-(670,160),30,%RED,%RGB_MOCCASIN ' Pick BOX
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC SET POS (690,140):GRAPHIC PRINT Z1$(28)
                  GRAPHIC BOX (650,180)-(670,200),30,%RED,%RGB_MOCCASIN ' Pick BOX
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC SET POS (690,180):GRAPHIC PRINT Z1$(29)
                  GRAPHIC BOX (650,220)-(670,240),30,%RED,%RGB_MOCCASIN ' Pick BOX
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC SET POS (690,220):GRAPHIC PRINT Z1$(30)
                  GRAPHIC BOX (650,260)-(670,280),30,%RED,%RGB_MOCCASIN ' Pick BOX
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC SET POS (690,260):GRAPHIC PRINT Z1$(31)
                  GRAPHIC BOX (650,300)-(670,320),30,%RED,%RGB_MOCCASIN ' Pick BOX
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC SET POS (690,300):GRAPHIC PRINT Z1$(32)
                  GRAPHIC BOX (650,340)-(670,360),30,%RED,%RGB_MOCCASIN ' Pick BOX
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC SET POS (690,340):GRAPHIC PRINT Z1$(33)
                  GRAPHIC BOX (650,380)-(670,400),30,%RED,%RGB_MOCCASIN ' Pick BOX
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC SET POS (690,380):GRAPHIC PRINT Z1$(34)
                  GRAPHIC BOX (650,420)-(670,440),30,%RED,%RGB_MOCCASIN ' Pick BOX
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC SET POS (690,420):GRAPHIC PRINT Z1$(35)
                  GRAPHIC BOX (650,460)-(670,480),30,%RED,%RGB_MOCCASIN ' Pick BOX
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC SET POS (690,460):GRAPHIC PRINT Z1$(36)
                  ' Column 5
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC BOX (850,140)-(870,160),30,%RED,%RGB_MOCCASIN ' Pick BOX
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC SET POS (890,140):GRAPHIC PRINT Z1$(37)
                  GRAPHIC BOX (850,180)-(870,200),30,%RED,%RGB_MOCCASIN ' Pick BOX
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC SET POS (890,180):GRAPHIC PRINT Z1$(38)
                  GRAPHIC BOX (850,220)-(870,240),30,%RED,%RGB_MOCCASIN ' Pick BOX
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC SET POS (890,220):GRAPHIC PRINT Z1$(39)
                  GRAPHIC BOX (850,260)-(870,280),30,%RED,%RGB_MOCCASIN ' Pick BOX
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC SET POS (890,260):GRAPHIC PRINT Z1$(40)
                  GRAPHIC BOX (850,300)-(870,320),30,%RED,%RGB_MOCCASIN ' Pick BOX
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC SET POS (890,300):GRAPHIC PRINT Z1$(41)
                  GRAPHIC BOX (850,340)-(870,360),30,%RED,%RGB_MOCCASIN ' Pick BOX
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC SET POS (890,340):GRAPHIC PRINT Z1$(42)
                  GRAPHIC BOX (850,380)-(870,400),30,%RED,%RGB_MOCCASIN ' Pick BOX
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC SET POS (890,380):GRAPHIC PRINT Z1$(43)
                  GRAPHIC BOX (850,420)-(870,440),30,%RED,%RGB_MOCCASIN ' Pick BOX
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC SET POS (890,420):GRAPHIC PRINT Z1$(44)
                  GRAPHIC BOX (850,460)-(870,480),30,%RED,%RGB_MOCCASIN ' Pick BOX
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC SET POS (890,460):GRAPHIC PRINT Z1$(45)
                
                  ' THIS NEXT SECTION IS WHERE THE MARKS ARE PLACED IN THE PICKED BLOCKS... A MARK IN ANY BOX MEANS THAT ITEM WAS PICKED AND WILL BE HARD PRINTED...
                  ' THE A? NUMBER ASSIGNED TO EACH ITEM IS SET TO ONE (1)... AN EXAMPLE IS THAT A1=1 AND HAS BEEN PICKED... A1=0 IS NOT A PICKED ITEM... ANY ITEM WHERE A?=0 WILL BE SKIPPED WHEN PRINTING TO PAPER...
                  ' THE QUESTION MARK REPRESENTS THE NUMBER OF THE ITEM, SUCH AS... THE NUMBER A?, IS A1 IN THE CASE OF 'EGGS' AND A2 FOR 'SOUR CREAM' AND SO FORTH DOWN THE LIST...
                
                  PICKBLOCKS: 'come here to pick items from the start or when coming back from the removal section
                  '
                  GRAPHIC BOX (360,80)-(610,120),30,%RED,%RGB_MOCCASIN ' Selection Section Box
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC SET FONT hFont19
                  GRAPHIC SET POS (400,83):GRAPHIC PRINT Z1$(0) + " Selection"
                  GRAPHIC SET FONT hFont12
                  DO
                     SLEEP 1 : If Graphic$(InKey$) = $ESC Then Goto Exitit:
                
                     GRAPHIC WINDOW CLICK TO click&, cx, cy ' Use Mouse to Pick Answer **************************
                     If click& > 0 Then
                
                      Local Colm, lRow, px, py As Long
                      Select Case cx
                        Case 50 To 70     : Colm = 1  : px = 55     ' if in pick box column
                        Case 250 To 270   : Colm = 2  : px = 255
                        Case 450 To 470   : Colm = 3  : px = 455
                        Case 650 To 670   : Colm = 4  : px = 655
                        Case 850 To 870   : Colm = 5  : px = 855
                        Case Else : Colm = 0
                      End Select
                      Select Case cy                                ' which row was clicked?
                        Case 140 To 160   : lRow = 1   : py = 141
                        Case 180 To 200   : lRow = 2   : py = 181
                        Case 220 To 240   : lRow = 3   : py = 221
                        Case 260 To 280   : lRow = 4   : py = 261
                        Case 300 To 320   : lRow = 5   : py = 301
                        Case 340 To 360   : lRow = 6   : py = 341
                        Case 380 To 400   : lRow = 7   : py = 381
                        Case 420 To 440   : lRow = 8   : py = 421
                        Case 460 To 480   : lRow = 9   : py = 461
                        Case Else : lRow = 0
                      End Select
                      If Colm AND lRow Then
                        Picks&(lRow, Colm) XOR= 1
                 '          Local n As Long, Msg As String : Msg = ""
                 '          For n = 1 To 45 : Msg += Str$(A&(n)) + " " : Next : Graphic Set Caption Msg
                        GRAPHIC SET POS (px,py) : GRAPHIC PRINT IIF$(Picks&(lRow, Colm) = 1,CHR$(62),Chr$(32,32,32))
                      End If
                
                      IF CX>760 AND CX<850 AND CY>570 AND CY<600 THEN GOTO PRINTIT ' Get a paper printout then leave program
                      IF CX>500 AND CX<660 AND CY>570 AND CY<600 THEN GOTO EXITIT ' leave program without paper printing
                
                     End If
                  LOOP
                
                  INFO5:
                  '
                  ' THIS IS THE FIRST SCREEN DISPLAYED AND EXPLAINS THE USE OF THE PROGRAM...
                  '
                  GRAPHIC CLEAR ' CLEARS SCREEN COMPLETELY
                  GRAPHIC BOX (20,30)-(975,563),30,%RED,%RGB_MOCCASIN ' Large Screen BOX
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC BOX (340,130)-(610,168),30,%RED,%RGB_MOCCASIN ' BJ's BOX
                  GRAPHIC BOX (400,430)-(540,470),30,%RED,%RGB_MOCCASIN ' Continue BOX
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                
                  GRAPHIC COLOR %BLACK,%RGB_MOCCASIN
                  GRAPHIC SET POS (365,132):GRAPHIC PRINT Z1$(0) " Shopping List" ' PRINTED IN Vendors's BOX
                  GRAPHIC SET POS (420,432):GRAPHIC PRINT "Continue" ' PRINTED IN CONTINUE BOX
                  GRAPHIC SET POS (70,175):GRAPHIC PRINT "This shopping list is for shopping at sample vendor."
                  GRAPHIC SET POS (70,215):GRAPHIC PRINT "If you want an item on the list, pick the box in front of the item."
                  GRAPHIC SET POS (70,255):GRAPHIC PRINT "If you decide to change your mind, pick the item again to clear the mark."
                  GRAPHIC SET POS (70,295):GRAPHIC PRINT "When you have picked all the item you want, pick the 'Print List' box."
                  GRAPHIC SET POS (70,335):GRAPHIC PRINT "For other stores, pick it from the index page when we get an index page!"
                  '
                  DO
                     GRAPHIC WINDOW CLICK TO click&, cx, cy ' Use Mouse to Pick Answer **************************
                     IF CX>380 AND CX<520 AND CY>430 AND CY<463 THEN RETURN ' THE PROGRAM CAME HERE FROM A SUB ROUTINE COMMAND AND NEEDS A RETURN COMMAND TO GET BACT TO THE NEXT LINE UNDER THAT SUB ROUTINE COMMAND...
                     If Graphic$(InKey$) = $ESC Then Return
                  LOOP
                  '
                  ' SENDING THE CHOSEN ITEMS TO THE PRINTER... ONLY ITEM THAT THE A?=1 WILL BE PRINTED...
                  ' WE USE THE FOR/NEXT LOOP TO SELECT THE ITEMS THAT ARE SET TO THE NUMBER ONE... THE ITEMS SET TO ZERO WILL BE SKIPPED...
                  '
                  PRINTIT:
                  '
                  XPRINT ATTACH DEFAULT                         ' eg CutePDF Writer
                  XPRINT SET FONT hFont15
                  XPRINT:XPRINT TAB(23) Z1$(0) + " List"
                  XPRINT SET FONT hFont10
                  XPRINT
                  '
                  'HARD PRINT USING ABOVE AMENDED LIST... ELIMINATING ALL ITEMS NOT MARKED A&(O1)=1
                  '
                  Local X, lTab As long
                  For O1 = 1 To 45
                     X = IIF(lTab = 0, 20, 50)    ' alternate Columns, Tab 20 or 50 for printable items
                     If A&(O1) = 1 Then : lTab XOR= 1 : XPRINT TAB(X) Z1$(O1);
                  Next
                  '
                  XPRINT CLOSE
                
                  EXITIT: 'End Of Program
                
                END FUNCTION
                '------------------/
                Rgds, Dave

                Comment


                • #9
                  Just for fun, a PBWin 10 version taking off from Dave's example and following my instincts. It has a slightly different user interface, and a lot fewer lines of code. Sorry if I strayed off target, Izzy!

                  I'm sure it would convert readily to PBCC, which I don't have at my fingertips. Click to toggle selection, Esc to end:

                  Code:
                  #debug display
                  #compile exe
                  #dim all
                  #include once "WIN32API.INC"
                  
                  %rows = 12
                  %columns = 4
                  
                  global product() as string
                  global boxen()   as rect
                  global selected() as long
                  
                  function pbmain as long
                      local hGW, hfont, CellX, CellY, cw, ch, W, H, X, Y, n, bkcolour, txtcolour, l as long
                      local key as string
                      local pt as point
                      ' Load array with shopping list (could be read from a disk file?)
                      dim product(0 to 45):dim boxen(0 to 45): dim selected(0 to 45)
                       array assign product() = "BJ's","Eggs","Sour Cream","Lite Creamer","Milk","Orange Juice","Vegetable Oil","Vinegar","Mayoaise","Catsup", _
                      "Mustard","Potatos","Soy Sauce","Bagels","Swirl Bread","Water","Diet Pepsi","Taster's Choice","Chicken Burger", _
                      "Le Seur Peas", "Baked Beans","Olives","Corn","Stringbeens","Mushrooms","Paper Cups 12 oz","Paper Plates","Cling Wrap", _
                      "Trash Bags","Scrubbing Bubbles","Swiffer Floor Pads","Stamps","Batteries","Quiche Appetizers","Lox","Salmon","Paper Towels", _
                      "Eye Roast","Hamburger Patties","Chicken Patties","Hot Dogs","Tuna Cans","Vegetables","Paper Towels","Charmin","Puffs"
                  
                      ? str$(ubound(product))
                      desktop get client to W, H
                      graphic window new "", 0, 0, W, H to hGW
                      graphic clear %rgb_cornsilk
                  
                      font new "COMIC SANS MS", 12 to hfont
                      graphic set font hfont
                      graphic cell size to cw, ch
                      cellX = W/(%columns + 2)
                      cellY = H/(%rows + 2)
                      for y = 1 to %rows
                          for x = 1 to %columns
                              incr n
                              if n > ubound(product) then iterate
                              setrect(boxen(n), X* cellX, Y*cellY, (X+1)* cellX, (Y+1) * cellY + 1)
                                  bkcolour = %rgb_cornsilk: txtcolour = %black
                              graphic box (boxen(n).left, boxen(n).top)-(boxen(n).right, boxen(n).bottom), _
                                      0, -2, bkcolour
                              graphic set pos (X* cellX + cw, Y*cellY + ch)
                              graphic color txtcolour, bkcolour
                              graphic print product(n)
                          next
                      next
                      do
                          graphic instat to l
                          if l then graphic inkey$ to key
                          graphic window click to l, pt.X, pt.Y
                          if l = 0 then iterate loop
                          for n = 1 to ubound(product)
                              if ptinrect( boxen(n), pt) then
                                  if selected(n) = 0 then
                                      selected(n) = 1
                                      bkcolour = %red: txtcolour = %white
                                  else
                                      selected(n) = 0
                                      bkcolour = %rgb_cornsilk: txtcolour = %black
                                  end if
                                  graphic set pos (boxen(n).left + cw, boxen(n).top + ch)
                                  graphic color txtcolour, bkcolour
                                  graphic print product(n)
                              end if
                          next
                      loop until key = $esc
                      graphic window end hGW
                  end function
                  Last edited by Chris Holbrook; 11 Apr 2019, 05:27 PM. Reason: removed debug code

                  Comment


                  • #10
                    I tried the above with PBCC5, and my apologies, it does not compile. While making the necessary corrections, I thought it would be interesting to use bitmaps to set and clear a tick (checkmark) symbol instead of using different colours to indicate the selected state. So this one does compile with PBCC5, which is the latest PBCC I own.

                    Code:
                    '
                    #console off
                    #debug display
                    #compile exe
                    #dim all
                    #include once "WIN32API.INC"
                    
                    %rows = 12
                    %columns = 4
                    %bkcolour = %rgb_cornsilk
                    %textcolour = %black
                    
                    global product() as string ' array of grocery products
                    global boxen()   as rect   ' array of bounding rects for products, same index as products()
                    global selected() as long  ' array of selected statuses, same index as products()
                    
                    function pbmain as long
                        local hGW, htickbmp, hnotickbmp, hfont, _
                              CellX, CellY, cw, ch, W, H, X, Y, n, l as long
                        local skey as string
                        local pt as point
                        ' Load array with shopping list (could be read from a disk file?)
                        dim product(0 to 45):dim boxen(0 to 45): dim selected(0 to 45)
                         array assign product() = "BJ's","Eggs","Sour Cream","Lite Creamer","Milk","Orange Juice","Vegetable Oil","Vinegar","Mayoaise","Catsup", _
                        "Mustard","Potatos","Soy Sauce","Bagels","Swirl Bread","Water","Diet Pepsi","Taster's Choice","Chicken Burger", _
                        "Le Seur Peas", "Baked Beans","Olives","Corn","Stringbeens","Mushrooms","Paper Cups 12 oz","Paper Plates","Cling Wrap", _
                        "Trash Bags","Scrubbing Bubbles","Swiffer Floor Pads","Stamps","Batteries","Quiche Appetizers","Lox","Salmon","Paper Towels", _
                        "Eye Roast","Hamburger Patties","Chicken Patties","Hot Dogs","Tuna Cans","Vegetables","Paper Towels","Charmin","Puffs"
                    
                        desktop get client to W, H
                        graphic window "", 0, 0, W, H to hGW
                        graphic attach hGW, 0
                        graphic clear %rgb_cornsilk
                    
                        font new "COMIC SANS MS", 12 to hfont
                        graphic set font hfont
                        graphic chr size to cw, ch
                        ' make little bitmap containing a tick symbol
                        graphic bitmap new 2*cw, ch to htickbmp
                        graphic attach htickbmp, 0
                        graphic clear %rgb_cornsilk
                        graphic width 2
                        graphic color %red
                        graphic line (2*cw, 0)-(cw/2, ch)
                        graphic line (0, ch/2)-(cw/2, ch)
                        ' make little bitmap containing no tick symbol
                        graphic bitmap new 2*cw, ch to hnotickbmp
                        graphic attach hnotickbmp, 0
                        graphic clear %rgb_cornsilk
                        '
                        graphic attach hGW, 0, redraw
                        graphic color %textcolour, %bkcolour
                        ' calculate size of cell, same for all product names
                        cellX = W/(%columns + 2)
                        cellY = H/(%rows + 2)
                        ' display initial array of products, none selected yet
                        for y = 1 to %rows
                            for x = 1 to %columns
                                incr n
                                if n > ubound(product) then iterate
                                setrect(boxen(n), X* cellX, Y*cellY, (X+1)* cellX, (Y+1) * cellY + 1)
                                graphic set pos (X* cellX + 3* cw, Y*cellY + ch)
                                graphic print product(n)
                            next
                        next
                        graphic redraw
                        ' loop waiting for a mouse click to toggle product's selected state
                        ' or ESC key to end
                        do
                            graphic instat to l
                            if l then exit loop
                            graphic window click to l, pt.X, pt.Y
                            if l = 0 then iterate loop
                            for n = 1 to ubound(product)
                                if ptinrect( boxen(n), pt.X, pt.Y) then ' was the click inside nth product's bounding rect?
                                    if selected(n) = 0 then
                                        selected(n) = 1
                                        l = htickbmp
                                    else
                                        selected(n) = 0
                                        l = hnotickbmp
                                    end if
                                    graphic copy l, 0 to (boxen(n).nleft + cw, boxen(n).ntop + ch) ' set or clear tick symbol
                                end if
                                graphic redraw
                            next
                            sleep 0
                        loop
                        ' clean up
                        graphic set font 0
                        graphic window end 'hGW
                        font end hfont
                        graphic attach htickbmp, 0
                        graphic bitmap end
                        graphic attach hnotickbmp, 0
                        graphic bitmap end
                    end function

                    Comment


                    • #11
                      Hi Chris,
                      Izzy has PBCC6 (see post #1).

                      Code in post #9 compiles fine in PBCC6 once string var "key" is changed to "sKey".

                      Code in post #10 needs adjustment for PBCC6 as the definition for ptinrect() is different in the win32api.inc supplied with PBCC5 (PBCC6 uses pt as a parameter instead of pt.x, pt.y).
                      so..
                      Code:
                          if ptinrect( boxen(n), pt ) then    '  was the click inside nth product's bounding rect?
                      ps.
                      Code:
                              graphic instat to l
                              if l then exit loop                       ' any key to end

                      Both #9 and #10 are fine examples of a more compact way of presenting the list on screen. The boxes around the clickable areas in #9 lends itself to easy use on a touch screen
                      Rgds, Dave

                      Comment


                      • #12
                        Thanks for the explanation Dave. I should have known about the point API stuff, because it's just like PBWin10. Sheer laziness has prevented me from writing a macro to test the compiler version and throw the correct parameters to ptinrect(), or indeed from looking to see if anyone else has already done that.

                        I had to add a focus rect, didn't I? It is less compact. The approach is to create bitmaps for each product name, one with focus and one without, as well as the bitmaps for the tick symbol. all the paint operations are then achieved by copying the appropriate bitmaps into place, rather than GRAPHIC PRINTing all over the place.There is only one GRAPHIC PRINT statement in the entire program.

                        I also tried using GRAPHIC BOX on the fly to put in the focus rect, but it was significantly slower. GRAPHIC COPY in PBWIN V10 (and I presume PBCC V6) is fast!

                        Here's the PBCC5 version, pending my attempt to make the code capable of compiling with either PBCC5 or 6, which will be fun as I don't have PBCC6.

                        Code:
                        ' code removed, see post #14 below.
                        Last edited by Chris Holbrook; 14 Apr 2019, 07:36 AM. Reason: code superceded, see post#14

                        Comment


                        • #13
                          Hi Chris,

                          Using this declaration for PtInRect() at the top of the source will work with either PBCC5 or 6 includes

                          DECLARE FUNCTION CkInRect LIB "USER32.DLL" ALIAS "PtInRect" (lpRect AS RECT, BYVAL ptx AS LONG, BYVAL pty AS LONG) AS LONG
                          (Replace calls to PtInRect() with CkInRect() in the source).
                          Rgds, Dave

                          Comment


                          • #14
                            Thank you, sensei! I did think of that but it doesn't cover the #CONSOLE OFF, for which #IF etc seems the only remedy short of looking for an attached console and killing it..

                            This one works for me on PBCC5 and PBWIN10:

                            Code:
                            '
                            #if %def(%pb_cc32)
                                #console off
                            #endif
                            #debug display
                            #compile exe
                            #dim all
                            #include once "WIN32API.INC"
                            
                            %rows = 12
                            %columns = 4
                            %bkcolour = %rgb_cornsilk
                            %textcolour = %black
                            %nproducts = 45
                            
                            global product() as string ' array of grocery products
                            global boxen()   as rect   ' array of bounding rects for products, same index as products()
                            global selected() as long  ' array of selected statuses, same index as products()
                            global hfocusbmp() as long   ' array of bitmaps for active(under cursor) products
                            global hunfocusbmp() as long ' array of bitmaps for inactive(not under cursor) products
                            '
                            macro mprintprod
                                graphic set pos (4*cw, (cellY-ch)/2)
                                graphic print product(n)
                                graphic set font 0
                            end macro
                            
                            macro function mpointinrect(r, pt)
                                macrotemp l
                                dim l as long
                            #if %def(%pb_cc32)
                                #if (%pb_revision < &H600)
                                    l = ptinrect(r, pt.X, pt.y)
                                #else
                                    l = ptinrect(r, pt)
                                #endif
                            #elseif %def(%pb_win32)
                                #if (%pb_revision < &H1000)
                                    l = ptinrect(r, pt.X, pt.y)
                                #else
                                    l = ptinrect(r, pt)
                                #endif
                            #endif
                            end macro = l
                            
                            function pbmain as long
                                local hGW, htickbmp, hnotickbmp, hfont, _
                                      CellX, CellY, cw, ch, W, H, X, Y, n, l, _
                                      focussedproduct as long
                                local skey as string
                                local pt as point
                                ' Load array with shopping list (could be read from a disk file?)
                                dim product(0 to %nproducts)
                                dim boxen(0 to %nproducts)
                                dim selected(0 to %nproducts)
                                dim hfocusbmp(0 to %nproducts)
                                dim hunfocusbmp(0 to %nproducts)
                                 array assign product() = "BJ's","Eggs","Sour Cream","Lite Creamer","Milk","Orange Juice","Vegetable Oil","Vinegar","Mayoaise","Catsup", _
                                "Mustard","Potatos","Soy Sauce","Bagels","Swirl Bread","Water","Diet Pepsi","Taster's Choice","Chicken Burger", _
                                "Le Seur Peas", "Baked Beans","Olives","Corn","Stringbeens","Mushrooms","Paper Cups 12 oz","Paper Plates","Cling Wrap", _
                                "Trash Bags","Scrubbing Bubbles","Swiffer Floor Pads","Stamps","Batteries","Quiche Appetizers","Lox","Salmon","Paper Towels", _
                                "Eye Roast","Hamburger Patties","Chicken Patties","Hot Dogs","Tuna Cans","Vegetables","Paper Towels","Charmin","Puffs"
                            
                                desktop get client to W, H
                                graphic window "", 0, 0, W, H to hGW
                                graphic attach hGW, 0
                                graphic clear %rgb_cornsilk
                                font new "Comic Sans MS", 12 to hfont
                                graphic set font hfont
                                graphic chr size to cw, ch
                                graphic set font 0
                                ' calculate size of cell, same for all product names
                                cellX = W/(%columns + 2)
                                decr CellX ' cells must not overlap
                                cellY = H/(%rows + 2)
                                decr CellY ' cells must not overlap
                                ' make little bitmap containing a tick symbol
                                graphic bitmap new 2*cw, ch to htickbmp
                                graphic attach htickbmp, 0
                                graphic clear %rgb_cornsilk
                                graphic width 2
                                graphic color %red
                                graphic line (2*cw, 0)-(cw/2, ch)
                                graphic line (0, ch/2)-(cw/2, ch)
                                ' make little bitmap containing no tick symbol
                                graphic bitmap new 2*cw, ch to hnotickbmp
                                graphic attach hnotickbmp, 0
                                graphic clear %rgb_cornsilk
                                '
                            prodbmps:
                                ' make little bitmaps for each product
                                n = 1
                                for y = 1 to %rows
                                    for x = 1 to %columns
                                        incr n
                                        if n > ubound(product) then exit for
                                        setrect(boxen(n), X* cellX, Y*cellY, (X+1)* cellX, (Y+1) * cellY + 1)
                                        ' ...one for the product with focus
                                        graphic bitmap new cellX, cellY to hfocusbmp(n)
                                        graphic attach hfocusbmp(n), 0
                                        graphic set font hfont
                                        graphic color %textcolour, %bkcolour
                                        graphic clear %bkcolour
                                        graphic box(0,0)-(cellX, cellY), 20, %black, -2
                                        mprintprod
                                        '... and one for when the product doesn't have focus
                                        graphic bitmap new cellX, cellY to hunfocusbmp(n)
                                        graphic attach hunfocusbmp(n), 0
                                        graphic set font hfont
                                        graphic color %textcolour, %bkcolour
                                        graphic clear %bkcolour
                                        mprintprod
                                    next
                                next
                            '
                            paint:
                                graphic attach hGW, 0, redraw
                                graphic color %textcolour, %bkcolour
                                ' display initial array of products, none selected yet
                                n = 1
                                for y = 1 to %rows
                                    for x = 1 to %columns
                                        incr n
                                        if n > ubound(product) then exit for
                                            graphic copy l, 0 to (boxen(n).nleft, boxen(n).ntop)
                                    next
                                next
                                graphic redraw
                                ' loop waiting for a mouse click to toggle product's selected state
                                ' or ESC key to end
                                focussedproduct = 0
                                do
                                    graphic instat to l  ' keypress detector
                                    if l then exit loop
                                    graphic window click to l, pt.X, pt.Y
                                    if l then goto clicked
                                    getcursorpos(pt)
                                    for n = 1 to ubound(product)
                                        X = boxen(n).nleft + cw
                                        Y = boxen(n).ntop + ch
                                        if mpointinrect( boxen(n), pt) then ' was the click inside nth product's bounding rect?
                                            if n = focussedproduct then iterate loop ' avoid repainting if move within focussed cell
                                            focussedproduct = n
                                            l = hfocusbmp(n)
                                        else
                                            l = hunfocusbmp(n)
                                            focussedproduct = 0
                                        end if
                                        graphic copy l, 0 to (boxen(n).nleft, boxen(n).ntop )
                                        if selected(n) then
                                            graphic copy htickbmp, 0 to (boxen(n).nleft + cw, boxen(n).ntop + ch/2) ' set tick symbol
                                        end if
                                    next
                                    graphic redraw
                                    sleep 0
                                    iterate loop
                            clicked:
                                    for n = 1 to ubound(product)
                                        if mpointinrect( boxen(n), pt) then ' was the click inside nth product's bounding rect?
                                            if selected(n) = 0 then
                                                selected(n) = 1
                                                l = htickbmp
                                            else
                                                selected(n) = 0
                                                l = hnotickbmp
                                            end if
                                            graphic copy l, 0 to (boxen(n).nleft + cw, boxen(n).ntop + ch/2) ' set or clear tick symbol
                                        end if
                                        graphic redraw
                                    next
                                    sleep 0
                                loop
                            cleanup:
                                ' clean up
                                graphic window end 'hGW
                                for n = 1 to ubound(product)
                                    if hfocusbmp(n) then graphic attach hfocusbmp(n), 0: graphic bitmap end
                                    if hunfocusbmp(n) then graphic attach hunfocusbmp(n), 0: graphic bitmap end
                                next
                            
                                graphic attach htickbmp, 0
                                graphic bitmap end
                                graphic attach hnotickbmp, 0
                                graphic bitmap end
                            '    font end hfont ' let PB do this, I get an error 5
                            end function

                            Comment


                            • #15
                              GRAPHIC CLICK seems to deliver its payload when the mouse button is released, which makes the UI sluggish. ISTR that by scanning the keyboard instead, the button press can be detected. I suppose one could subclass the GW and get the WM_LBUTTONDOWN, but Izzy's approach is to use the GRAPHIC toolkit so I'm sticking with that!

                              Comment


                              • #16
                                I think you'll find that Graphic Click works on button down. (Press without release to test).
                                Maybe it looks like it's working on release because of the sluggish behaviour?

                                Try commenting out the Graphic Redraw statement in the clicked: loop for a much snappier performance.
                                Rgds, Dave

                                Comment


                                • #17
                                  Dave, you are right, I was wrong.

                                  As you say, much snappier. :Thank you!

                                  Comment


                                  • #18
                                    Because I don't feel like gardening in the rain, I decided to add a different colour to the cell with focus, and IMHO it improves the UI significantly. It requires the tick symbol to be different in the focus and non-focus states, so that makes four bitmaps to handle the tick, as there are two focus states and two selected states!

                                    Code:
                                    '
                                    #if %def(%pb_cc32)
                                        #console off
                                    #endif
                                    #debug display
                                    #compile exe
                                    #dim all
                                    #include once "WIN32API.INC"
                                    
                                    %rows = 12
                                    %columns = 4
                                    %bkcolour = %rgb_cornsilk
                                    %textcolour = %black
                                    %focusbkcolour = %rgb_lavender
                                    %tickcolour = %red
                                    %nproducts = 45
                                    
                                    global product() as string ' array of grocery products
                                    global boxen()   as rect   ' array of bounding rects for products, same index as products()
                                    global selected() as long  ' array of selected statuses, same index as products()
                                    global hfocusbmp() as long   ' array of bitmaps for active(under cursor) products
                                    global hunfocusbmp() as long ' array of bitmaps for inactive(not under cursor) products
                                    '
                                    macro mprintprod
                                        graphic set pos (4*cw, (cellY-ch)/2)
                                        graphic print product(n)
                                        graphic set font 0
                                    end macro
                                    
                                    macro function mpointinrect(r, pt)
                                        macrotemp l
                                        dim l as long
                                    #if %def(%pb_cc32)
                                        #if (%pb_revision < &H600)
                                            l = ptinrect(r, pt.X, pt.y)
                                        #else
                                            l = ptinrect(r, pt)
                                        #endif
                                    #elseif %def(%pb_win32)
                                        #if (%pb_revision < &H1000)
                                            l = ptinrect(r, pt.X, pt.y)
                                        #else
                                            l = ptinrect(r, pt)
                                        #endif
                                    #endif
                                    end macro = l
                                    '
                                    ' make little bitmap containing no tick symbol
                                    macro function mmakenoticksymbolbmp(colour)
                                        macrotemp bmp
                                        dim bmp as long
                                        '
                                        graphic bitmap new 2*cw, ch to bmp
                                        graphic attach bmp, 0
                                        graphic clear colour
                                    end macro = bmp
                                    '
                                    ' make little bitmap containing a tick symbol
                                    macro function mmaketicksymbolbmp(colour)
                                        macrotemp bmp
                                        dim bmp as long
                                    
                                        graphic bitmap new 2*cw, ch to bmp
                                        graphic attach bmp, 0
                                        graphic clear colour
                                        graphic width 2
                                        graphic color %tickcolour
                                        graphic line (2*cw, 0)-(cw/2, ch)
                                        graphic line (0, ch/2)-(cw/2, ch)
                                    end macro = bmp
                                    '
                                    function pbmain as long
                                        ' bitmaps for tick symbol
                                        local htickbmpNS as long ' no focus, selected
                                        local htickbmpFS as long ' focus, selected
                                        local htickbmpNN as long ' neither with focus nor selected
                                        local htickbmpFN as long ' focus, not selected
                                        '
                                        local hGW as long ' graphic window handle
                                        local hfont as long ' font handle
                                        local CellX, CellY as long ' X and Y dimensions of cell containing a single product
                                        local cw, ch as long' character cell dimensions
                                        local focussedproduct as long ' the index of the prduct currently under the cursor
                                        local W, H, X, Y, n, l, m as long ' ephemerals
                                        local skey as string
                                        local pt as point
                                        ' Load array with shopping list (could be read from a disk file?)
                                        dim product(0 to %nproducts)
                                        dim boxen(0 to %nproducts)
                                        dim selected(0 to %nproducts)
                                        dim hfocusbmp(0 to %nproducts)
                                        dim hunfocusbmp(0 to %nproducts)
                                         array assign product() = "BJ's","Eggs","Sour Cream","Lite Creamer","Milk","Orange Juice","Vegetable Oil","Vinegar","Mayoaise","Catsup", _
                                        "Mustard","Potatos","Soy Sauce","Bagels","Swirl Bread","Water","Diet Pepsi","Taster's Choice","Chicken Burger", _
                                        "Le Seur Peas", "Baked Beans","Olives","Corn","Stringbeens","Mushrooms","Paper Cups 12 oz","Paper Plates","Cling Wrap", _
                                        "Trash Bags","Scrubbing Bubbles","Swiffer Floor Pads","Stamps","Batteries","Quiche Appetizers","Lox","Salmon","Paper Towels", _
                                        "Eye Roast","Hamburger Patties","Chicken Patties","Hot Dogs","Tuna Cans","Vegetables","Paper Towels","Charmin","Puffs"
                                    
                                        desktop get client to W, H
                                        graphic window "", 0, 0, W, H to hGW
                                        graphic attach hGW, 0
                                        graphic clear %rgb_cornsilk
                                        font new "Comic Sans MS", 12 to hfont
                                        graphic set font hfont
                                        graphic chr size to cw, ch
                                        graphic set font 0
                                        ' calculate size of cell, same for all product names
                                        cellX = W/(%columns + 2)
                                        decr CellX ' cells must not overlap
                                        cellY = H/(%rows + 2)
                                        decr CellY ' cells must not overlap
                                        ' make little bitmap containing a tick symbol, no focus
                                        htickbmpNS = mmaketicksymbolbmp(%bkcolour)
                                        ' make little bitmap containing a tick symbol, with focus
                                        htickbmpFS = mmaketicksymbolbmp(%focusbkcolour)
                                        ' make little bitmap containing no tick symbol, no focus
                                        htickbmpNN = mmakenoticksymbolbmp(%bkcolour)
                                        ' make little bitmap containing no tick symbol with focus
                                        htickbmpFN = mmakenoticksymbolbmp(%focusbkcolour)
                                        '
                                    prodbmps:
                                        ' make little bitmaps for each product
                                        n = 1
                                        for y = 1 to %rows
                                            for x = 1 to %columns
                                                incr n
                                                if n > ubound(product) then exit for
                                                setrect(boxen(n), X* cellX, Y*cellY, (X+1)* cellX, (Y+1) * cellY + 1)
                                                ' ...one for the product with focus
                                                graphic bitmap new cellX, cellY to hfocusbmp(n)
                                                graphic attach hfocusbmp(n), 0
                                                graphic set font hfont
                                                graphic color %textcolour, %focusbkcolour
                                                graphic clear %focusbkcolour
                                                graphic box(0,0)-(cellX, cellY), 20, %black, -2
                                                mprintprod
                                                '... and one for when the product doesn't have focus
                                                graphic bitmap new cellX, cellY to hunfocusbmp(n)
                                                graphic attach hunfocusbmp(n), 0
                                                graphic set font hfont
                                                graphic color %textcolour, %bkcolour
                                                graphic clear %bkcolour
                                                mprintprod
                                            next
                                        next
                                    '
                                    paint:
                                        graphic attach hGW, 0, redraw
                                        graphic color %textcolour, %bkcolour
                                        ' display initial array of products, none selected yet
                                        n = 1
                                        for y = 1 to %rows
                                            for x = 1 to %columns
                                                incr n
                                                if n > ubound(product) then exit for
                                                    graphic copy l, 0 to (boxen(n).nleft, boxen(n).ntop)
                                            next
                                        next
                                        graphic redraw
                                        ' loop waiting for a mouse click to toggle product's selected state
                                        ' or ESC key to end
                                        focussedproduct = 0
                                        do
                                            graphic instat to l  ' keypress detector
                                            if l then exit loop
                                            graphic window click to l, pt.X, pt.Y
                                            if l then goto clicked
                                            getcursorpos(pt)
                                            for n = 1 to ubound(product)
                                                X = boxen(n).nleft + cw
                                                Y = boxen(n).ntop + ch
                                                if mpointinrect( boxen(n), pt) then ' was the click inside nth product's bounding rect?
                                                    if n = focussedproduct then iterate loop ' avoid repainting if move within focussed cell
                                                    focussedproduct = n
                                                    l = hfocusbmp(n)
                                                    m = iif(selected(n), htickbmpFS, htickbmpFN)
                                                else
                                                    l = hunfocusbmp(n)
                                                    m = iif (selected(n), htickbmpNS, htickbmpNN)
                                                    focussedproduct = 0
                                                end if
                                                graphic copy l, 0 to (boxen(n).nleft, boxen(n).ntop )
                                                graphic copy m, 0 to (boxen(n).nleft + cw, boxen(n).ntop + ch/2) ' set tick symbol
                                            next
                                            graphic redraw
                                            sleep 0
                                            iterate loop
                                    clicked:
                                            for n = 1 to ubound(product)
                                                if mpointinrect( boxen(n), pt) then
                                                    ' the click was inside nth product's bounding rect?
                                                    if selected(n) = 0 then
                                                        selected(n) = 1
                                                        l = htickbmpFS
                                                    else
                                                        selected(n) = 0
                                                        l = htickbmpFN
                                                    end if
                                                    graphic copy l, 0 to (boxen(n).nleft + cw, boxen(n).ntop + ch/2) ' set or clear tick symbol
                                                end if
                                            next
                                            sleep 0
                                        loop
                                    cleanup:
                                        ' clean up
                                        graphic window end 'hGW
                                        for n = 1 to ubound(product)
                                            if hfocusbmp(n) then graphic attach hfocusbmp(n), 0: graphic bitmap end
                                            if hunfocusbmp(n) then graphic attach hunfocusbmp(n), 0: graphic bitmap end
                                        next
                                    
                                        graphic attach htickbmpFS, 0: graphic bitmap end
                                        graphic attach htickbmpNS, 0: graphic bitmap end
                                        graphic attach htickbmpFN, 0: graphic bitmap end
                                        graphic attach htickbmpNN, 0: graphic bitmap end
                                    '    font end hfont ' let PB do this, I get an error 5
                                    end function

                                    Comment

                                    Working...
                                    X