i need to workout, how to put riders into the draw on several different horses, in several different tests, at several different times.
this is my times button script (you have a field for start time, finish times, the time luch starts, and for how long lunch goes for)
the time sequence is on each of the 60 cardson mouseUp
local tStartTime, tEndTime
--clear the field
put empty into field "Time1"
--get the first session time limits
put field "StartTime" into tStartTime
put field "LunchTime" into tEndTime
--if there is a lunchbreak specified
if tEndTime is not empty then
--fetch the entry times list by calling the function
--and telling it what the start and end time limits are
put fnGetEntriesList (tStartTime, tEndTime) into field "Time1"
--then work out how long the lunch break is
--and make a new start and stop time range
put field "LunchTime" into tStartTime
--dateItems are a comma delimited list of year, month, day, hour, minute, second, day of week
convert tStartTime to dateItems
--so the fourth in the list is hours
add field "LunchLength" to item 5 of tStartTime
--convert it back to a meaningful time
convert tStartTime to short time
--get the last entry time for the afternoon session
put field "LastEntry" into tEndTime
--call the function again with the new range for the
--afternoon session
put fnGetEntriesList (tStartTime, tEndTime) after field "Time1"
--if there wasn't a lunchbreak then go straight through from
--start to finish
else
put field "LastEntry" into tEndTime
--fetch the entries list by passing the start and stop
--times to the function
put fnGetEntriesList (tStartTime, tEndTime) into field "Time1"
end if
end mouseUp
function fnGetEntriesList pStartTime, pEndTime
local tEntriesList
--do some basic checking
put fnCheckValidTime (pStartTime) into pStartTime
put fnCheckValidTime (pEndTime) into pEndTime
--the checking function returns the time converted
--to seconds, so that it is easy to tell when it is more
--than the end time
repeat while pStartTime < pEndTime
--convert it back to something we can use in the field
convert pStartTime to short time
put pStartTime & cr after tEntriesList
--convert it back to that comma delimited list
--so that it is easy to add on 8 minutes
convert pStartTime to dateItems
add 8 to item 5 of pStartTime
--convert it back to seconds so that the loop
--can tell when the end time is exceeded
convert pStartTime to seconds
--go back and do it again (as long as the end time is not exceeded)
end repeat
--send back the list of entry times to be put into the field for viewing
return tEntriesList
end fnGetEntriesList
function fnCheckValidTime pTime
--this checks that each value given to it
--can be interpreted as a time
--and converts it to seconds for
--easy mathematical comparison
convert pTime to seconds
if pTime is not a date then
answer error "Check the times have been input correctly"
exit to top
else
return pTime
end if
end fnCheckValidTime
on the opening card, i have where you enter all the competitors details, name, horses name, and what tests they are doing. you enter all details, and tick the check boxes of the different tests.
i have over 60 check boxes, with this script
so for this script, the "Entries1" changes all the way upto "Entries60".on mouseUp
local theCardName
if the hilite of me is true then
put "Entries" into theCardName
put the label of me after theCardName
if (field "HorsesName" is not empty) and (field "RidersName" is not empty) then
put field "BridleNumber" & tab & field "HorsesName" & tab & field "RidersName" & return after field "Entries" of card "Entries1"
else
answer "You have not completed the entry details correctly"
end if
end if
end mouseUp
now the problem i am having, is working out how to do this. (this is so hard to explain sorry)
so i enter the details, and the rider and horse are put into the first available row in each selected test.
now this means, they are riding the one horse at the same TIME in all five tests (which of course is impossible to do)
so how do work out, that they go into different tests at different times ??
now my other problem is.
one rider may have 2 different horses (or more), so how do i get the link, so the riders name is also acknowledged ??
example
jodie foster, riding blacky in test P1, P2, P.1 and P,2
jodie foster, riding whitey in test P.1, P.2, N.1 and N.2
how can i enter them so they go into these tests, 1 hour apart, throughout all tests.
most likely lost you by now havnt i sturgis ???