Using variable values within other variables (Language Help)

by Lockjaw, Friday, June 08, 2012, 17:08 (1845 days ago) @ Jim

Brilliant! Hadn't thought of that!

On the same note, here's a bit of an anomaly I've discovered. When I run this bit of code:

wcheck = 11148470
t = float(wcheck)/10^8
dcsum = 0
for ddi = 1 to 7
t=float(t*10)
dcsum = dcsum + t%10
t = t-(t%10)
if t>0 then
next ddi
endif
print dcsum

it treats the 4 as a 3. So if wcheck = 44444444, it gives me a 31 instead of 32. It does the same thing if I use a 3 in the fourth position, it treats it as a 2. All other digits are okay. Any idea why this is happening? I've run it on WinNT, XP & 7 with the same result.


Complete thread:

 RSS Feed of thread

powered by my little forum