@SanfordWhiteman (and for the general amusement and hopefully edification of others),
I've made solid progress. My code is working as expected, and I'm getting to grips with the string maps stuff quite nicely.
The output section at the end is almost 'debug' at the moment, but will go into a nice table shortly.
#set( $allSeminarDetails = {
"GNG" : {
"blurb":"Come to GNG and learn about Poodles",
"date":"5 Aug 2020",
"attendees":0
},
"POY" : {
"blurb":"It's POYsonal Now",
"date":"6 Aug 2020",
"attendees":0
},
"GUL" : {
"blurb" : "GULivers travels have nothing on life here",
"date":"7 Aug 2020",
"attendees":0
},
"WTG" : {
"blurb" : "Waiting Waiting Waiting",
"date":"8 Aug 2020",
"attendees":0
},
"POH" : {
"blurb" : "POH POH POH your boat",
"date":"9 Aug 2020",
"attendees":0
}
} )
#set( $currentSeminarList = $lead.metlifecompetitiondatas2 )
#set( $currentSeminarCodes = $currentSeminarList.split("[|]") )
## this list will hold matched seminars
#set( $currentSeminarDetails = [] )
## find matching seminar in master list
#foreach( $code in $currentSeminarCodes )
#set( $currentRegistration = $code.split("[;]") )
#set( $villageCode = $currentRegistration[0] )
#set( $attendees = $currentRegistration[1] )
#set( $aSeminar = $allSeminarDetails[$villageCode])
#set( $aSeminar.attendees = $currentRegistration[1] )
#set( $void = $currentSeminarDetails.add( $aSeminar ) )
#end
## iterate over matches only
#foreach( $seminar in $currentSeminarDetails )
${seminar.blurb}
${seminar.date}
${seminar.attendees}<BR><BR>
#end
What I'm most curious about is where can I improve what I'm doing. Are their areas of inelegance or inefficiency in here that I could be doing better?
Cheers
Jo
... View more