Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Apr 2010
    Posts
    125
    Thanks
    6
    Thanked 0 Times in 0 Posts

    How do you create a list of numbers?

    I need to create some lists of numbers.

    e.g. the numbers 1-10,000 in 50s (1, 51, 101, 151 etc.)

    the numbers 10-20,000 in tens (10, 20, 30, 40 etc.)

    How can you do that? All I can find is ways to make sequential numbers (1, 2, 3, 4 etc.)

    Help!

    Thanks
    Mike
    I've been making animations for my daughter. Tell me what you think!

    Pickles and the Bully
    Where are you Pickles!?!

  • #2
    Senior Coder
    Join Date
    Aug 2006
    Posts
    1,402
    Thanks
    11
    Thanked 298 Times in 297 Posts
    It depends on what language you're using, but a "for" loop is the way to do it, and should be basically the same as whatever way you found to do it for sequential numbers.

    C:
    for (i=0 [this is the starting value];
    i<10000 [this is the "until it gets to this"];
    i+=10 [this is the "add this much after each loop"]
    )

  • #3
    Regular Coder
    Join Date
    Apr 2010
    Posts
    125
    Thanks
    6
    Thanked 0 Times in 0 Posts
    Sorry, should've been clearer. Any PHP versions?
    I've been making animations for my daughter. Tell me what you think!

    Pickles and the Bully
    Where are you Pickles!?!

  • #4
    Senior Coder
    Join Date
    Sep 2010
    Posts
    2,451
    Thanks
    17
    Thanked 275 Times in 275 Posts
    Quote Originally Posted by instaunt View Post
    Sorry, should've been clearer. Any PHP versions?
    Just write a for loop in php. Variables just start with a $ symbol. Basic stuff, you need to learn it.
    Welcome to http://www.myphotowizard.net

    where you can edit images, make a photo calendar, add text to images, and do much more.


    When you know what you're doing it's called Engineering, when you don't know, it's called Research and Development. And you can always charge more for Research and Development.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •