[ic] Look ahead at next value in a query/list?

Interchange User interchange at framework.cx
Mon Jul 7 12:27:51 EDT 2003


Hi all,

Is there a way to look ahead at values returned by a [query] to tell if 
there is another record about to be returned in between the 
[list][/list] tags?  For instance, I have the following code, which 
returns a list of authors from a table.  I want to put the comma after 
"[sql-param author]" only if there's another author in the list, but 
not at the end.

------------------------------------------------------------
		  [query
			sql="select author FROM authors where article = '[item-code]' ORDER 
BY authorship"
			type=list
			list=1
			st=db
		  ]
		  [list]
			[sql-param author],
		  [/list]
		  [/query]
------------------------------------------------------------

Currently, I end up with something like

"Johnson J, Nichols RJ, Koch C, Gray J, Will L, Ernst B,"

and I'd like to not put the comma in if I'm at the end of my results 
lists.

Thanks,

Peter



More information about the interchange-users mailing list