Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Control ($Pos - 1)


Go to End


2 Posts   4273 Views

Avatar
web2works

Community Member, 50 Posts

18 June 2011 at 7:54pm

Hi, I need to $Pos inside a control to start counting at 0. How would I do this without having loads of $Pos == 2 %>1 , $Pos == 3 %>2, etc

Avatar
(deleted)

Community Member, 473 Posts

18 June 2011 at 8:51pm

$Pos(0) should work (the argument is the number to start counting from, defaults to 1).