>Can anyone help me translate the following Visual Basic code to proC?
I assume proC is C of some sort ?
Try this. Warning, not tested and done on the fly without thinking.
int SomeFuncToGetaCheckSum(void)
{
int iCounter;
int iSum;
int iMultiplier = 7;
char sTemp[20];
char *p = sReference;
while (p && *p)
{
if (isdigit(*p)
{
iSum += ((*p) - 48) * iMultiplier;
switch(iMultiplier)
{
case 7 : iMultiplier = 3; break;
case 3 : iMultiplier = 1; break;
case 1 : iMultiplier = 7;
}
} /* end isdigit */
p++;
} /* end while */
iSum %= 10;
iSum -= 10;
_itoa(iSum,sTemp,10);
fReferenceCheckSum = &sTemp[strlen(sTemp) -1];
return fReferenceCheckSum;
}
I think that may do something close. Or not. :)

Signature
Regards, Frank
Mike Williams - 29 Oct 2004 10:47 GMT
> Warning, not tested and done on the fly without thinking.
So what's new ;-)
Mike
Frank Adam - 29 Oct 2004 15:16 GMT
>> Warning, not tested and done on the fly without thinking.
>
>So what's new ;-)
LOL. I meant without drinking. ;-)
No, i meant without actually looking at the problem, it was just a
line by line conversion.

Signature
Regards, Frank
Kenneth Osenbroch - 30 Oct 2004 09:11 GMT
> >Can anyone help me translate the following Visual Basic code to proC?
> >
[quoted text clipped - 33 lines]
>
> I think that may do something close. Or not. :)
Thanks Frank, I'll try it.
Cheers, Kenneth