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.

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   3016 Views


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


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).