Created
November 13, 2018 14:26
-
-
Save trycf/39c082aeaf26f4a28f8b6462c3b41a74 to your computer and use it in GitHub Desktop.
TryCF Gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfset typereport = "Vouchers&www|ee&ggg|pp&xyz|cc|2&Ad Hoc Comms"> | |
<cfset reportArray = typereport.Split("&")> | |
<cfset docType = []> | |
<cfset compensation = []> | |
<cfset pages = []> | |
<cfloop array="#reportArray#" index="idx"> | |
<cfif #ListLen(idx,"|")# EQ '3'> | |
<cfif ListGetAt(idx,3,"|") lte 3> | |
<cfset ArrayAppend(pages,ListGetAt(idx,3,"|"),"true")> | |
<cfelse> | |
<cfset ArrayAppend(pages,"4","true")> | |
</cfif> | |
<cfelseif idx eq "Ad Hoc Comms"> | |
<cfoutput>Ad hoc comms</cfoutput> | |
<cfelse> | |
<cfif idx eq 'Vouchers'> | |
<cfset ArrayAppend(docType,"Vouchers","true")> | |
<cfset ArrayAppend(pages,"1","true")> | |
<cfelseif idx eq 'Vouchers - 2 Pages'> | |
<cfset ArrayAppend(docType,"Vouchers","true")> | |
<cfset ArrayAppend(pages,"2","true")> | |
<cfelseif idx eq 'Vouchers - 3 Pages'> | |
<cfset ArrayAppend(docType,"Vouchers","true")> | |
<cfset ArrayAppend(pages,"3","true")> | |
<cfelseif idx eq 'Vouchers - 4+ Pages'> | |
<cfset ArrayAppend(docType,"Vouchers","true")> | |
<cfset ArrayAppend(pages,"4+","true")> | |
<cfelse> | |
<cfset ArrayAppend(docType,ListGetAt(idx,1,"|"),"true")> | |
<cfset ArrayAppend(compensation,ListGetAt(idx,2,"|"),"true")> | |
</cfif> | |
</cfif> | |
</cfloop> | |
<cfdump var="#docType#"> | |
<cfdump var="#compensation#"> | |
<cfdump var="#pages#"> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment