Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trycf/168d777d0955fdaa198ac3e64374feb9 to your computer and use it in GitHub Desktop.
Save trycf/168d777d0955fdaa198ac3e64374feb9 to your computer and use it in GitHub Desktop.
TryCF Gist
<cfscript>
arr = ArrayNew(1);
arr[1] = '';
arr[2] = 'category B';
stc["Item One"] = arr;
arr[1] = 'category A';
arr[2] = '';
stc["Item Two"] = arr;
arr[1] = 'category A';
arr[2] = 'category B';
stc["Item Three"] = arr;
writedump(stc);
for (element in stc) {
WriteOutput(element & '<br>');
// The next line produces:
// Object of type class java.lang.String cannot be used as an array
for (i=1; i<=ArrayLen(stc[element]); i+=1) {
writedump(stc[element]);
}
}
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment