I’m probably missing something simple here, but I need to be able to refer to a property of a record as a variable
theList → contains a list of integers ranging from 0 to 2
theTeam → contains a record with the properties that are the same as the values for “theKey” in the statsDisplayKeys
property statsDisplayKeys : {{theKey:"conference", theTitle:"Conf"}, {theKey:"division", theTitle:"Div"}, {theKey:"displayWinsLosses", theTitle:"Rec"}, {theKey:"winPercent", theTitle:"Win%"}, {theKey:"homeRoadRecord", theTitle:"H/R Rec"}, {theKey:"displayConWinsLosses", theTitle:"C Rec"}, {theKey:"displayNonConWinsLosses", theTitle:"NC Rec"}, {theKey:"displayDivWinsLosses", theTitle:"D Rec"}, {theKey:"displayLast5WinsLosses", theTitle:"Last 5"}, {theKey:"winStreak", theTitle:"Streak"}, {theKey:"netPoints", theTitle:"Net Pts"}, {theKey:"touchDowns", theTitle:"TDs"}, {theKey:"off3rdDownsPercent", theTitle:"Off 3rd %"}, {theKey:"off4thDownsPercent", theTitle:"Off 4th %"}, {theKey:"turnOvers", theTitle:"TOs"}, {theKey:"def3rdDownsPercent", theTitle:"Def 3rd %"}, {theKey:"def4thDownsPercent", theTitle:"Def 4th %"}}
.
.
.
repeat with x from 1 to count of theList
if theList's item x = 2 as integer then -- add to stats text
set currentKey to statsDisplayKeys's item x's theKey -- this is the line that is giving me trouble
set currentStat to theTeam's currentKey
.
.
.
end if
end repeat
Thanks in advance,
Brad