[Zope] sequence of numbers

Bill Randle billr@coinet.com
Fri, 12 Mar 1999 18:26:42 -0800


This may be a newbie question, but I've loked thru the doc and didn't
spot any obvious way to do this, short of an External Method.

What I want to do is given a limit number, iterate over a sequence of
DTML commands. This would be an obvious use for #in (which I'm using
elsewhere for other things) except I don't have a sequence - just the
number of items in the sequence, as it were.

In psuedo-code, what I'm after is something like this:
	for (i=0; i < <!--#var max_items-->; i++)
	{
	  // some DTML/HTML code using "i"
	}

Now if, given a #var, I could get a list - e.g.:
	<!--#var max_items--> --> list = [0, 1, 2, ... max_items]
or [1, 2, ... max_items], it doesn't make much difference.
then I could just use:
	<!--#in list-->
	// some stuff using <!--#var sequence-index-->
	<!--#/in-->

Is there an easy way to do this? Is there *any* way to do it?

	-Bill Randle
	Central Oregon Internet
	billr@coinet.com