>Bom dia...
>
>O contador é definido assim
>
>sele itempedi
>goto bott
>m.conta=Val(numeitem)+1
>m.item=Strtan(str(m.conta,2)," ","0")
>
>*este numeitem é C - 2
>
>repl numeitem with m.item
Acho que isto está bom, em principio. Agora, para multi-lojas, pode combinar com um número único que asigna a cada loja, e ussar isto como chave primária:
bintoc(numero_loja, 2) + bintoc(numeitem)
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)