>Thanks Doug. Taking what Charlie sent in as well, it would appear that I
>would not be able to reference variables.headerImages as a struct (even
>though variables would be the struct). Could you replace the
>structkeyexists(variables, "headerImages) line with
>isdefined("variables.headerImages") and see if you still recieve an
>error? It would be greatly appreciated.
>
>Cutter
Hey Cutter. Initially it threw me an error, but only because
variables.standardSideNav didn't exist. I added a cfparam just above the
cfscript to set the missing variable to a boolean value, and it worked with
your code snippet in place, no errors. here's the actual code I tested, fyi:
<cfparam name="variables.standardsidenav" default="false">
<cfscript>
if (not isdefined("variables.headerImages")){
variables.headerImages = arraynew(1);
}
if (not arraylen(variables.headerImages)){
variables.img = structnew();
if (not variables.standardSideNav){
variables.img.filename = "myimage.jpg";
variables.img.alt = "My Image";
variables.img.width = "206";
variables.img.height = "173";
arrayappend(variables.headerImages,structcopy(variables.img));
}
variables.img.filename = "myimage_2.jpg";
variables.img.alt = "My Second Image";
variables.img.width = "407";
variables.img.height = "173";
arrayappend(variables.headerImages,structcopy(variables.img));
}
</cfscript>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four
times a year.
http://www.fusionauthority.com/quarterly
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:252623
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4