ScoobyNet.com - Subaru Enthusiast Forum

ScoobyNet.com - Subaru Enthusiast Forum (https://www.scoobynet.com/)
-   Computer & Technology Related (https://www.scoobynet.com/computer-and-technology-related-34/)
-   -   ColdFusion - Structures (https://www.scoobynet.com/computer-and-technology-related-34/131124-coldfusion-structures.html)

DazV 12 September 2002 06:15 PM

Anyone got any good articles (html) that I can have a look at.

I'm wanting to create something to hold a session based structure of the form:

<cfset session.cart.item=1>
<cfset session.cart.item.color=5>
<cfset session.cart.item.row=231>

etc...

But its giving me errors. I've seen examples similar to this, so I'm wondering where I'm going wrong.

Eventually I want 'color' and 'row' fields to be arrays, but first things first!

-DV

[Edited by DazV - 9/12/2002 8:56:26 PM]

Darren (M3) 13 September 2002 02:40 PM

Seem to have things sussed now. All I need to know is how to append an array onto a structure

eg. I want:
cart.item[].qty

At the moment I have:
item[].qty

I need to know the instruction that can append
item[].qty onto the cart structure to make cart.item[].qty

[Edited by Darren (M3) - 9/13/2002 2:41:11 PM]

RichB 13 September 2002 03:27 PM

:rolleyes:


...i've sent the question... ;)

Darren (M3) 13 September 2002 03:46 PM

Cheers Rich, you're a lifesaver! The answer your man gave me was perfect for what I need to know.

What did you say your internet hosting company was again ?

:)

RichB 13 September 2002 04:07 PM

No problem, Datacenta but I won't post a link just in case I get accused of advertising! :rolleyes: ;)

BTW - We can host Cold Fusion sites, not sure if you knew that...

DazV 09 December 2002 09:11 PM

Ok, finally managed to track something down on the net.
Stuctures within structures, arrays within structures, etc...

Out of interest, could anyone tell me how to setup this...

#cart.item[1].qty#

I did it like this but I'm not sure about the line in bold type

<!--- Step1. Define the variables --->
<CFSET var_qty=15>
<CFSET var_merchID=246>

<!--- Step2 Create a structure 'struct_item' to contain those variables --->
<CFSET struct_item=StructNew()>
<CFSET stuct_item.merchID=var_merchID>
<CFSET struct_item.qty=var_qty>

<!--- Step3 Define the array 'array_item' --->
<CFSET array_item=ArrayNew(1)>
<CFSET array_item[1]=struct_item>
<CFSET array_item[2]=struct_item>

Are those last two lines in bold correct ? I was hoping to simply replace them with one line which reads:

<CFSET array_item=struct_item>

[Edited by DazV - 9/12/2002 11:40:35 PM]


All times are GMT +1. The time now is 02:31 AM.


© 2024 MH Sub I, LLC dba Internet Brands