I have a field called Private_Label_Barcode that I need to read each digit and decided if odd or even. all the odd digits are to be added together, and all the even digits added together. I know that I will need to use a loop. I can't figure how to use the value of the digit found in each pass of the loop. Here is what I have so far. The words 'odd' and 'even' are place holders for the code I need to figure out.
Local NumberVar Even_Num := 0;
Local NumberVar Odd_Num := 0;
Local NumberVar strLen := Length ({Private_Label_Barcode});
Local NumberVar i;
For i := 1 To strLen Do
(
if ToNumber (Left ({{Private_Label_Barcode}, 1)) Mod 2 = 0
then 'even'
else 'odd'
);
Odd_Num + (Even_Num * 3) //Check Digit Result
Thanks in advance for assistance!!!
Local NumberVar Even_Num := 0;
Local NumberVar Odd_Num := 0;
Local NumberVar strLen := Length ({Private_Label_Barcode});
Local NumberVar i;
For i := 1 To strLen Do
(
if ToNumber (Left ({{Private_Label_Barcode}, 1)) Mod 2 = 0
then 'even'
else 'odd'
);
Odd_Num + (Even_Num * 3) //Check Digit Result
Thanks in advance for assistance!!!