It is dark voodoo indeed...

If you put 1 & $c between round brackets and put the mod 10 back where it was you'll see that $T does indeed contain the total...

I noticed that when I removed the brackets I lost the value of $T but because the tests still came up as valid I went with it... and today I found out that it doesn't even need the mod 10 to work...


$T as expected:
 Code:
; begin Luhns Mod
;
;!
Function A($)
Dim $c, $t
	?
	For $c=0 to 15-($<4)
		$A = 0 + right($, 1)
		$t = (1 & $c) * ($A / 5 + $A) + $A + $t
		$ = left($,~)
		$t " "
		If $t mod 10 + $ | 4&$A + 5
			$A = 0
Endfunction


;!
;!
; end Luhns Mod


Voodoo $T:
 Code:
; begin Luhns Mod
;
;!
Function A($)
Dim $c, $t
	?
	For $c=0 to 15-($<4)
		$A = 0 + right($, 1)
		$t = 1 & $c * ($A / 5 + $A) + $A + $t
		$ = left($,~)
		$t " "
		If $t + $ | 4&$A + 5
			$A = 0
Endfunction


;!
;!
; end Luhns Mod


Or maybe I just sold my soul to the devil to win ;-)
_________________________
The Code is out there