James,
I am attaching a CFX tag I wrote that will do what you need.  It's called
ListGetChunk and it allows you to extract a portion of a list.
You could use it like this:

<cfset MyList = "23,24,27,30,543,675,980">
<cfset Start = ListFind(MyList, 543) - 1>
<cfset Max = 3>
<cfx_ListGetChunk List="#MyList#" Start="#Start#" Max="#Max#"
NewList="NewList">
<!--- NewList would now contain 30,543,675 --->
<cfset First = ListFirst(NewList)>
<cfset Last = ListLast(NewList)>

Hope that helps,
Chris

----------------------------------------------
Original Message
From: "James Maltby"<[EMAIL PROTECTED]>
Subject: Find position in a list
Date: Fri, 23 Mar 2001 14:28:16 -0000

>Hi
>
>Let's imagine I've got a list of id numbers and a specific id number within
>this list.  How could I output the "next" id number in the list and the
>"previous" id number in the list, depending on the id number I have?
>
>e.g. List = 23,24,27,30,543,675,980 AND id=543 - I need to get either 30 or
>675, then if I get 675 I need to get 543 or 980, etc. etc.
>
>TIA
>
>James
>
>"The Force is strong in this one..."
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to