Problems counting from 0 to 999999999999

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
scramblepad
Newbie
Posts: 1
Joined: Wed Mar 24, 2010 1:33 pm

Problems counting from 0 to 999999999999

Post 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 .
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Post 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.
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
Post Reply