Putting the new line (of horse and rider information) "after" the field will literally put the data "after" what's already in there - ie at the end.
If you already have data (the time list) in the field then you will have to do something to keep a track of what time slots are available, or use two different fields side by side (that you could maybe group together and scroll together if necessary).
If you want to put the data on the same line as the first free "time slot" then you would need to do something like
Code: Select all
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 the cLineCount of field "Entries" of card "Entries5A" into tLineCount
add 1 to tLineCount
set the cLineCount of field "Entries" of card "Entries5A" to tLineCount
--this keeps a count of the used lines and stores it in a custom property
--of the destination field. You would need to reset it to zero on emptying
--the field.
set the itemDelimiter to tab
put tab & tab & field "HorsesName" & tab & field "RidersName" into item 2 to -1 of line tLineCount of field "Entries" of card "Entries5A"
--this puts the line of data into the second column onwards of the given line
--of course there is no error trapping here to check that the line does not already contain some data, or check availability
else
answer "You have not completed the entry details correctly"
end if
end if
end mouseUp
That's a simple thing to add data to a given line, but you will probably need to look at it a big more "big picture"-wise to get a terribly good result.