A list is simply a delimited string. The delimiter is usually a comma. A
list really isn't an Object in CF, it's more of a concept. I could say
<cfset myVar = "23,42,25,262">
I could then treat myVar as a List if I wanted to, since a list is simply a
delimited string.
So now I could use all the List functions that CF provides on it.
<cfset v = ListFind(myVar, 25)> returns true
The delimiter can be other things besides a comma, so for instance an IP
address could be treated as a list, where the delimiter is a .
<cfset ip = "10.0.1.2">
<cfset ClassC = ListGetAt(ip, 3, ".")> Returns 1
<cfset ClassD = ListGetAt(ip, 4, ".")> Returns 2
Or a unix path name
<cfset path = "/usr/local/sbin/foo">
<cfset Root = ListGetAt(path, 2, "/")> Returns "usr"
______________________________________________
Pete Freitag ([EMAIL PROTECTED])
CFDEV.COM / NETDesign Inc.
ColdFusion Developer Resources
http://www.cfdev.com/
-----Original Message-----
From: Gavin Myers [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 29, 2000 12:11 PM
To: CF-Talk
Subject: ...list...array
okay, i've been getting into lists and arrays but i cant find very much good
reference
1: is a list just a 1d array?
2: how do you carry a list/array through pages? Is the only way to do it via
application.cfm and locking the list/array?
3: i can figgure out how to make a new array, pretty tough arraynew(1) ;),
but how do you make a new list? couldnt find the function for it...
I'm pretty famaliar with arrays, they arent a very tough concept, my main
problem is syntax, wich i can put togethor via developin web applications
(the cf standard book). How to compare them to another when done, how to add
the person picked the letter b on the third question... most of this stuff i
can figgure out by looking at the functions.. my main problem is question
#2.
<cfset myarray = array()>
when i do this:
<cfset myarray[1]="1">
<cfset myarray[2]="2">
<cfset myarray[3]="3">
It bascially does this:
myarray = [1,2,3]
right?
a list really looks & seems to act like a 1d array
----------------------------------------------------------------------------
--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.