How to Press button to just add one thing?
Posted: Sat Aug 04, 2018 5:36 pm
Hello All,
I a working on a Baccarat Training Tool that put old shoes in and allows the person to do one hand at time to play the next hand. I already figured out how to populate it all at once using "Repeat with" statements but I need to put one at a time in and press the button each time to put the next "Dot" in place.
here is the code for the "show complete shoe" and it works perfect. Is there a way to to have the repeat with statements wait for a button press each time or how would i do this one by one. The button sets all the variables and clears the grid as well. Just want to hit it each time and have a dot appear in the right spot. This way the user can see just one hand at a time like playing in a casino.
Thanks again so much. This is the last step and its done except to make it look pretty..lol
Mike
-- Show complete shoe
Put "1" into ShoeColumn
Put "1" into shoeLine
put " " into field "BacCard"
Set the itemDel to space
put "0" into tNoHands
put "0" into tNoBankers
put "0" into tNoPlayers
--set P or B start of Game
put char 1 of fld "ShoeInfoFromList2" into PBstart
delete char 1 of fld"ShoeInfoFromList2"
delete char 1 of fld"ShoeInfoFromList2"
--how many colums are to populate
put the number of items of fld "ShoeInfoFromList2" into tmpcolums
repeat with col = 1 to tmpcolums
Set the itemDel to space
Put item col of fld "ShoeInfoFromList2" into tmpcolums2
repeat with lin = 1 to tmpcolums2
Set the itemDel to tab
put tNoHands +1 into tNoHands
--swith between colors
if PBstart = "B" then
put "1141" into PBColor
put tNoBankers +1 into tNoBankers
else if PBstart = "P" then
put "1142" into PBColor
put tNoPlayers +1 into tNoPlayers
end if
put "1" into of char 1 of item col of line lin of field "BacCard"
set the imagesource of char 1 of item col of line lin of field "BacCard" to PBColor
end repeat
--switch color
if PBstart ="B" then
Put "P" into PBstart
else if PBstart ="P" then
Put "B" into PBstart
end if
end repeat
--populate stats
Put tNoHands into fld "NoHands"
put tNoBankers into fld"NoBankers"
Put tNoPlayers into fld"NoPlayers"
I a working on a Baccarat Training Tool that put old shoes in and allows the person to do one hand at time to play the next hand. I already figured out how to populate it all at once using "Repeat with" statements but I need to put one at a time in and press the button each time to put the next "Dot" in place.
here is the code for the "show complete shoe" and it works perfect. Is there a way to to have the repeat with statements wait for a button press each time or how would i do this one by one. The button sets all the variables and clears the grid as well. Just want to hit it each time and have a dot appear in the right spot. This way the user can see just one hand at a time like playing in a casino.
Thanks again so much. This is the last step and its done except to make it look pretty..lol
Mike
-- Show complete shoe
Put "1" into ShoeColumn
Put "1" into shoeLine
put " " into field "BacCard"
Set the itemDel to space
put "0" into tNoHands
put "0" into tNoBankers
put "0" into tNoPlayers
--set P or B start of Game
put char 1 of fld "ShoeInfoFromList2" into PBstart
delete char 1 of fld"ShoeInfoFromList2"
delete char 1 of fld"ShoeInfoFromList2"
--how many colums are to populate
put the number of items of fld "ShoeInfoFromList2" into tmpcolums
repeat with col = 1 to tmpcolums
Set the itemDel to space
Put item col of fld "ShoeInfoFromList2" into tmpcolums2
repeat with lin = 1 to tmpcolums2
Set the itemDel to tab
put tNoHands +1 into tNoHands
--swith between colors
if PBstart = "B" then
put "1141" into PBColor
put tNoBankers +1 into tNoBankers
else if PBstart = "P" then
put "1142" into PBColor
put tNoPlayers +1 into tNoPlayers
end if
put "1" into of char 1 of item col of line lin of field "BacCard"
set the imagesource of char 1 of item col of line lin of field "BacCard" to PBColor
end repeat
--switch color
if PBstart ="B" then
Put "P" into PBstart
else if PBstart ="P" then
Put "B" into PBstart
end if
end repeat
--populate stats
Put tNoHands into fld "NoHands"
put tNoBankers into fld"NoBankers"
Put tNoPlayers into fld"NoPlayers"