That'll work too, though this is a much better way to get the keys back out
of the struct:

<cfset myList = structKeyList(tmpStruct) />

  -----Original Message-----
  From: Darron J. Schall [mailto:[EMAIL PROTECTED]
  Sent: Thursday, October 09, 2003 4:51 PM
  To: CF-Talk
  Subject: Re: Hashtable in CF?

  You can treat structs as HashTable...

  Something like this should work (not tested)

  <cfset myList = "2,2,1,3,4,1,2,1">

  <cfset tmpStruct = StructNew()>

  <cfloop list="#myList#" delimiters="," index="current">
  <cfset tmpStruct[current] = true>  <!--- add the number to the hash
table --->
  </cfloop>

  <cfset myList = ""> <!--- re-set the list and rebuild it! --->
  <cfloop collection="#tmpStruct#" item="current">
  <cfset myList = ListAppend(myList, current)>
  </cfloop>

  -d

[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to