Using variable values within other variables (Language Help)

by Jim ⌂ @, Russell, KY, Friday, June 15, 2012, 14:59 (2648 days ago) @ Lockjaw

Sorry it took a few days to respond.

Under UBUNTU/LINUX the code works just as you like it. As an old programmer I do not trust the modulo operator if either side is a floating point. :) I guess there could be a rounding or floating point problem.

I would implement this as a string of digits so there would be no way of getting all "floaty" on us.

# wcheck = 44444444
# wcheck$ = string(wcheck) # different variable - same name almost but a string
# or
wcheck$ = "21312312312345342341234324"

dcsum = 0
for i = 1 to length(wcheck$)
dcsum = dcsum + int(mid(wcheck$,i,1))
next i
print dcsum

Complete thread:

 RSS Feed of thread

powered by my little forum