Results 1 to 8 of 8

Thread: Given range of numbers??

  1. #1

    Thread Starter
    Lively Member PatOls's Avatar
    Join Date
    Oct 2000
    Posts
    99

    Lightbulb

    How do you create a given range of numbers, i.e.
    1 ,2 ,3 ,4 ?

    anyone have a clue

    thx in advance

  2. #2
    Guest
    Is this what you want?

    Code:
    For i = 0 to 10 'count 0 to 10
    Debug.Print i 'print 0-10
    Next i 'loop

  3. #3
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105
    looks more like

    for i=1 to 4
    string = string & i & ","
    next i
    string =left(string, len(string)-1)

  4. #4

    Thread Starter
    Lively Member PatOls's Avatar
    Join Date
    Oct 2000
    Posts
    99
    what i meant was (maybe a little unclear on this), I want
    to give each order in my ordersystem a number that follows
    a range, like -

    the first order 1
    the second order 2
    the hundred order 100
    the thousand order 1000
    the 4thousandAND6th order 4006

    /patrick

  5. #5
    Guest
    I still don't understand. Please elaborate further.

    Did you mean an array?
    Code:
    Dim MyArray(1 To 4006) As Byte
    
    MyArray(5) = "ABC"
    MyArray(105) = "DEF"
    MyArray(2042) = "GHI"

  6. #6

    Thread Starter
    Lively Member PatOls's Avatar
    Join Date
    Oct 2000
    Posts
    99

    Smile

    ok...maybe an Array can accomplish this, but anyway this
    is how I intended at first :

    user x orders 4 articles in the database, to complete the
    order he must specify an ordernr for this order - as it is
    now im using the randomize engine to give the user a random number, but for statistic reasons and other I would like to give this user a given number range...

    user x orders 4 articles - randomize.... - gets 53664

    instead of this I would like the user to get 12 if that is the next number in the range...

    next time the user places an order he should get the number
    13 instead of a randomized number

    the 89 time someone places an order he/she should get the next number in the range (hopefully 89), catch my drift?

    /thx for the interest - Patrick

  7. #7
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105
    In your database, store the order number by customer number, then increment the stored value whenever the customer places an order.

    tbl CustOrder
    fields:
    Customernumber longint
    Ordernumber longint

  8. #8

    Thread Starter
    Lively Member PatOls's Avatar
    Join Date
    Oct 2000
    Posts
    99

    thx

    yeah, that was a great tip .... (with a little hazzzzzle it worked)

    thx man

Posting Permissions

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



Click Here to Expand Forum to Full Width