Computer Science Canada vending machine |
Author: | Jenkinz [ Tue Mar 28, 2006 9:02 am ] |
Post subject: | vending machine |
I've tried to get this vending machine to work correctly and it seems that everything is, the only thing wrong with it is that the pictures won show, if anyone can see why help would be appreciated greatly var letter :string var number :int var answer :string loop put "Please enter the letter selection" get letter put "Please enter the number selection" get number if number= 1 and letter = "A" then Pic.ScreenLoad("crispycrunch.bmp", 100, 100, picCopy) elsif number= 1 and letter = "B" then Pic.ScreenLoad("mmpeanut.bmp", 100, 100, picCopy) elsif number= 1 and letter = "C" then Pic.ScreenLoad("max5.bmp", 100, 100, picCopy) elsif number= 1 and letter = "D" then Pic.ScreenLoad("snickers.bmp", 100, 100, picCopy) elsif number= 1 and letter = "E" then Pic.ScreenLoad("smarties.bmp", 100, 100, picCopy) elsif number= 1 and letter = "F" then Pic.ScreenLoad("MarsBar.bmp", 100, 100, picCopy) elsif number=1 and letter = "G" then Pic.ScreenLoad("CoffeeCrisp.bmp", 100, 100, picCopy) elsif number=1 and letter = "H" then Pic.ScreenLoad("aero.bmp", 100, 100, picCopy) end if delay (1000) put "do you want another poster?" get answer exit when answer = "no" end loop |
Author: | codemage [ Tue Mar 28, 2006 9:56 am ] |
Post subject: | |
For starters, make sure that your .t file and all of your images are saved in the same location. |
Author: | Delos [ Tue Mar 28, 2006 10:46 am ] |
Post subject: | |
Hello Jenkinz. Please use [code] tags in the future when posting code. |
Author: | Jenkinz [ Tue Mar 28, 2006 1:09 pm ] |
Post subject: | |
Delos wrote: Hello Jenkinz. Please use [code] tags in the future when posting code.
sorry bout that, and yes all my images are saved as bmp and are in the same folder as the actual question |
Author: | Dan [ Tue Mar 28, 2006 1:39 pm ] |
Post subject: | |
Are you puting the letter in as a captial becuses the way you have it lowercase will not work. Also you could do this much easyer by naming the image files the same as there letter number code and then adding the number to the string and puting that in Pic.ScreenLoad + the file existion. Any how there are no syntax errors in your code, so either you are not using a captial letter or there is somthing wrong with the images. |