Thanks
Thanks for your suggestions, you are right I learned programming in the 70's-80's and have been picking it up again as a hobby. I used pocketC for a couple of years then renewed my interest when I discovered basic4ppc. You have put me back on the right track.
My app is a game. It is a series of soccer matches. The matches are divided into 90 minutes (not really minutes, actually about 50ms), with a minute counter displayed. At random minutes, the minute counter stops and an "incident" is played. An "incident" consists of a series of actions eg
Hunt wins possession
Sends in a cross
Doyle powers a header
Just over the bar
The incident is displayed using labels and a sound "ooh" "aah" is played at the same time. The above commentary appears line by line with a half second or so delay between each line. The heavy processing is generating each line, working out what is going to happen next, doing string substitution to randomize some of the words etc. The user can press a button to interrupt the play to change tactics and substitute players. I stop the minute timer while they do this.
Code similar to...
App_Start
minute=0
tmrminute.interval=50
tmrMinute.tick
end sub
Sub tmrMinute_tick
tmrMinute.enabled=false 'stop the timer while we play an incident
labelminute.text=minute
if minute=90 then
'match over, update league tables etc
else if <user pressed tactics button during incident> then
'deal with user interaction, substitutions and so on
else if rnd(0,10)=0 then 'in other words not every minute has an incident
playincident 'at the end of the incident I increment the minute variable and start the timer again
else
minute=minute+1 'for display
tmrMinute.enabled=true
end if
end sub
Now I will work on restructuring the playincident along the line you suggest.
Steve
Sorry for the bad formatting, didnt quite come out as intended