Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

ColdFusion - Structures

Thread Tools
 
Search this Thread
 
Old 12 September 2002, 06:15 PM
  #1  
DazV
Scooby Regular
Thread Starter
 
DazV's Avatar
 
Join Date: Jun 2000
Posts: 3,783
Likes: 0
Received 0 Likes on 0 Posts
Post

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]
Old 13 September 2002, 02:40 PM
  #2  
Darren (M3)
Scooby Regular
 
Darren (M3)'s Avatar
 
Join Date: Jun 2002
Posts: 194
Likes: 0
Received 0 Likes on 0 Posts
Post

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]
Old 13 September 2002, 03:27 PM
  #3  
RichB
Scooby Regular
 
RichB's Avatar
 
Join Date: Apr 1999
Location: Bore Knee Muff
Posts: 3,666
Likes: 0
Received 0 Likes on 0 Posts
Post




...i've sent the question...
Old 13 September 2002, 03:46 PM
  #4  
Darren (M3)
Scooby Regular
 
Darren (M3)'s Avatar
 
Join Date: Jun 2002
Posts: 194
Likes: 0
Received 0 Likes on 0 Posts
Post

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 ?

Old 13 September 2002, 04:07 PM
  #5  
RichB
Scooby Regular
 
RichB's Avatar
 
Join Date: Apr 1999
Location: Bore Knee Muff
Posts: 3,666
Likes: 0
Received 0 Likes on 0 Posts
Thumbs up

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

BTW - We can host Cold Fusion sites, not sure if you knew that...
Old 09 December 2002, 09:11 PM
  #6  
DazV
Scooby Regular
Thread Starter
 
DazV's Avatar
 
Join Date: Jun 2000
Posts: 3,783
Likes: 0
Received 0 Likes on 0 Posts
Post

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]
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
JimBowen
ICE
5
02 July 2023 01:54 PM
Doofus
Computer & Technology Related
1
18 March 2003 01:58 PM
paulwadams_my99
Drivetrain
20
23 August 2002 04:44 PM
Damaja
Computer & Technology Related
1
14 February 2002 03:51 PM
Lee
Non Scooby Related
1
06 January 2001 12:20 PM



Quick Reply: ColdFusion - Structures



All times are GMT +1. The time now is 11:42 PM.