Hello Petros,
i not exactly sure what algorithm you mean, but it could be the following,
the locals are named in german but i think you'll get the concept
FUNCTION modulo11
LPARAMETERS pcZiffer
IF TYPE('pcZiffer') = 'N'
pcZiffer = STR(pcZiffer,11)
ENDIF
LOCAL xj, lnGewichtung, lnNumber, lnZwischenProdukt, lnEndProdukt, lnRest, ;
lnPruefZiffer
m.lnGewichtung = 7
m.lnNumber = 0
m.lnZwischenProdukt = 0
m.lnEndProdukt = 0
FOR m.xj = 1 TO 11
m.lnGewichtung = m.lnGewichtung - 1
IF m.lnGewichtung = 1
m.lnGewichtung = 7
ENDIF
m.lnNumber = VAL(SUBSTR(pcZiffer,m.xj,1))
m.lnZwischenProdukt = m.lnNumber * m.lnGewichtung
m.lnEndProdukt = m.lnEndProdukt + m.lnZwischenProdukt
ENDFOR
m.lnRest = MOD(m.lnEndProdukt,11)
m.lnPruefZiffer = 11 - m.lnRest
IF m.lnPruefZiffer = 10 OR m.lnPruefZiffer = 11
m.lnPruefZiffer = 0
ENDIF
m.lnPruefZiffer = ALLTRIM(STR(m.lnPruefZiffer))
RETURN m.lnPruefZiffer
ENDFUNC
Regards
Christian