Numbering a tagfield from 1 to 7 repeatedly

I would like to write value X in a tagfield of subsequent mp3 files of a folder with 10.000 mp3 files while:
At start X=0
If X ≠ 7 then X = X+1
else X=1
In case I can achieve this with MP3 tag, how?
Michiel

It can be achieved with %_counter% and some boolean and arithmetic functions: http://help.mp3tag.de/main_scripting.html#boolean

if you use just %_counter%, start would be at 1
$sub(%_counter%,1) starts with 0

$if($eql(%_counter%,7),1,%_counter%)
did I understand you right? strange numbering...

Numbering a tagfield from 1 to 7 repeatedly.
Actiontype 5: Format value
Field: COUNTER
Formatstring: $add($mod($sub(%_COUNTER%,1),7),1)

DD.20101030.1800.CEST