Turing: |
procedure selecttrack_click (x1, x2, y1, y2 : int)
var mx, my, mb : int
loop
Mouse.Where (mx, my, mb )
if mx >= x1 and mx <= y1 and my >= x2 and my <= y2 and mb = 1
then
drawfillbox (8, 468, 12, 472, black) %Creates selection
drawfillbox (93, 468, 97, 472, white) %From here onward--clears other selections
drawfillbox (178, 468, 182, 472, white)
drawfillbox (263, 468, 267, 472, white)
drawfillbox (348, 468, 352, 472, white)
drawfillbox (433, 468, 437, 472, white)
loop
fork music1
exit when mx >= x1 + 85 and mx <= y1 + 85 and my >= x2 and my <= y2 and mb = 1 or
mx >= x1 + 170 and mx <= y1 + 170 and my >= x2 and my <= y2 and mb = 1 or
mx >= x1 + 255 and mx <= y1 + 255 and my >= x2 and my <= y2 and mb = 1 or
mx >= x1 + 340 and mx <= y1 + 340 and my >= x2 and my <= y2 and mb = 1 or
mx >= x1 + 425 and mx <= y1 + 425 and my >= x2 and my <= y2 and mb = 1
end loop
elsif mx >= x1 + 85 and mx <= y1 + 85 and my >= x2 and my <= y2 and mb = 1
then
drawfillbox (93, 468, 97, 472, black) %Creates selection
drawfillbox (8, 468, 12, 472, white) %From here onward--clears other selections
drawfillbox (178, 468, 182, 472, white)
drawfillbox (263, 468, 267, 472, white)
drawfillbox (348, 468, 352, 472, white)
drawfillbox (433, 468, 437, 472, white)
fork music2
elsif mx >= x1 + 170 and mx <= y1 + 170 and my >= x2 and my <= y2 and mb = 1
then
drawfillbox (178, 468, 182, 472, black) %Creates selection
drawfillbox (8, 468, 12, 472, white) %From here onward--clears other selections
drawfillbox (93, 468, 97, 472, white)
drawfillbox (263, 468, 267, 472, white)
drawfillbox (348, 468, 352, 472, white)
drawfillbox (433, 468, 437, 472, white)
fork music3
elsif mx >= x1 + 255 and mx <= y1 + 255 and my >= x2 and my <= y2 and mb = 1
then
drawfillbox (263, 468, 267, 472, black) %Creates selection
drawfillbox (93, 468, 97, 472, white) %From here onward--clears other selections
drawfillbox (178, 468, 182, 472, white)
drawfillbox (8, 468, 12, 472, white)
drawfillbox (348, 468, 352, 472, white)
drawfillbox (433, 468, 437, 472, white)
fork music4
elsif mx >= x1 + 340 and mx <= y1 + 340 and my >= x2 and my <= y2 and mb = 1
then
drawfillbox (348, 468, 352, 472, black) %Creates selection
drawfillbox (93, 468, 97, 472, white) %From here onward--clears other selections
drawfillbox (178, 468, 182, 472, white)
drawfillbox (263, 468, 267, 472, white)
drawfillbox (8, 468, 12, 472, white)
drawfillbox (433, 468, 437, 472, white)
fork music5
elsif mx >= x1 + 425 and mx <= y1 + 425 and my >= x2 and my <= y2 and mb = 1
then
drawfillbox (433, 468, 437, 472, black) %Creates selection
drawfillbox (93, 468, 97, 472, white) %From here onward--clears other selections
drawfillbox (178, 468, 182, 472, white)
drawfillbox (263, 468, 267, 472, white)
drawfillbox (8, 468, 12, 472, white)
drawfillbox (348, 468, 352, 472, white)
Music.PlayFileStop
end if
exit when mx >= x1 and mx <= y1 and my >= x2 and my <= y2 and mb = 1 or %Declare end loop conditions
mx >= x1 + 85 and mx <= y1 + 85 and my >= x2 and my <= y2 and mb = 1 or
mx >= x1 + 170 and mx <= y1 + 170 and my >= x2 and my <= y2 and mb = 1 or
mx >= x1 + 255 and mx <= y1 + 255 and my >= x2 and my <= y2 and mb = 1 or
mx >= x1 + 340 and mx <= y1 + 340 and my >= x2 and my <= y2 and mb = 1 or
mx >= x1 + 425 and mx <= y1 + 425 and my >= x2 and my <= y2 and mb = 1
end loop
end selecttrack_click
|
It's the first one with the music1 music that I'm trying to understand before I try looping anything else. Basically, if the mouse is at the specified spot, the program will put a black box in a fake checkbox and put white boxes everywhere else to give the illusion of selection. Anyways, the music tracks I've chosen are pretty short--they're the beginnings of random songs. I want to make the song keep playing until I select another track. The problem is that even though I've put down all my 'exit when' situations, the loop won't exit and I am unable to choose any other track. What is wrong with my code? |