Page 1 of 1

Problems counting from 0 to 999999999999

Posted: Thu Mar 25, 2010 7:57 pm
by scramblepad
I have been away from q basic for a while and am trying to make a program to count from 0 to 999999999999. Here is what I have so far:
16777216

10 for a=ing(0) to 999999999999 step 1
20 print clng(a)
30 next a
40 end

I have tried several ways but I get an exponet after it gets to 8 digits. When using the clng (a) it counts fine but stops at 16777216

All the time while running the pross. is at 100% [ anyway to take some relief off the 1.6gig pross.?]And yes I know i dont need the line numbers but that is what I am use to.

What I really need it to do is count from 100000000000 to 999999999999 with no exponet values .

Posted: Fri Mar 26, 2010 12:21 pm
by burger2227
What number type are you using? QB defaults to Single values when no suffix or DIM AS statement is used.

Try using DOUBLE values for the variables.

Also you don't need STEP 1 as FOR loops assume that already.