I'll start by saying I'm new at Crystal but have a lot of experience with VB and VBA.
So, I'm using Basic syntax in 8.5 because that's what I'm familiar with. My problem is that I need to manipulate integers to construct an account number with a check digit at the end and all my numbers wind up with 2 decimal points.
Neither of the functions that I believe should leave me with whole numbers are working.
I start with a text field account number of 6 digits. I then must break out each digit so it can be processed. I convert the original account number to a number array using a loop and the mid function like this:
I guess you can probably figure out the rest of what I'm doing with the code shown. I have a ton of fix functions in there because so far none has worked and I wanted to make sure there were no places decimals could sneak in. As it is now I'm using fix functions because the int() function didn't work either and that's the one I tried first.
I'd sure be grateful for any help!
Thanks, Bear
So, I'm using Basic syntax in 8.5 because that's what I'm familiar with. My problem is that I need to manipulate integers to construct an account number with a check digit at the end and all my numbers wind up with 2 decimal points.
Neither of the functions that I believe should leave me with whole numbers are working.
I start with a text field account number of 6 digits. I then must break out each digit so it can be processed. I convert the original account number to a number array using a loop and the mid function like this:
Code:
for i = 1 to len(strAcctNum)
Redim Preserve x(i)
x(i) = fix(CDbl(mid(strAcctNum, i, 1)))
z(i) = fix(x(i)*y(i))
if z(i) >= 10 then
dim j as number
j = fix(z(i))
z(i) = fix((j mod 10) + (j\10))
end if
strAcctChkNum = strAcctChkNum & " " & fix(z(i))
next
I guess you can probably figure out the rest of what I'm doing with the code shown. I have a ton of fix functions in there because so far none has worked and I wanted to make sure there were no places decimals could sneak in. As it is now I'm using fix functions because the int() function didn't work either and that's the one I tried first.
I'd sure be grateful for any help!
Thanks, Bear