Increments by 10, 20, 30

Discussion in 'ASP General' started by someone, Dec 30, 2004.

  1. someone

    someone Guest

    Hi All,

    I need a function that only allows Increments by 10, 20, 30.....

    How do I achieve this in VB Script?

    Any help is appreciated.

    TIA,

    Santosh
     
    someone, Dec 30, 2004
    #1
    1. Advertising

  2. "someone" <> wrote in message
    news:...
    > Hi All,
    >
    > I need a function that only allows Increments by 10, 20, 30.....
    >
    > How do I achieve this in VB Script?
    >
    > Any help is appreciated.
    >
    > TIA,


    Public Function Inc10(inVal)
    Inc10 = inVal + 10
    End Function

    Public Function Inc20(inVal)
    Inc20 = inVal + 20
    End Function

    Public Function Inc30(inVal)
    Inc30 = inVal + 30
    End Function

    --
    compatible web farm Session replacement for Asp and Asp.Net
    http://www.nieropwebconsult.nl/asp_session_manager.htm


    > Santosh
    >
    >
     
    Egbert Nierop \(MVP for IIS\), Dec 30, 2004
    #2
    1. Advertising

  3. someone

    Evertjan. Guest

    someone wrote on 30 dec 2004 in microsoft.public.inetserver.asp.general:

    > I need a function that only allows Increments by 10, 20, 30.....
    >
    > How do I achieve this in VB Script?
    >


    function myIncrBy(x,y)
    if y=10 or y=20 or y=30 then x = x + y
    myIncr = x
    end function

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
     
    Evertjan., Dec 30, 2004
    #3
  4. someone

    thorpe Guest

    if your going to use it with a 'for' loop you can use step.

    example;

    for i = 0 to 80 step 10
    response.write(i) & "<br />"
    next

    "someone" <> wrote in message
    news:...
    > Hi All,
    >
    > I need a function that only allows Increments by 10, 20, 30.....
    >
    > How do I achieve this in VB Script?
    >
    > Any help is appreciated.
    >
    > TIA,
    >
    > Santosh
    >
    >
     
    thorpe, Dec 31, 2004
    #4
  5. someone

    Lance Wynn Guest

    Also,

    Function Increment(base, additive)
    if additive mod 10 = 0 and additive > 0 then
    increment = base+additive
    end if
    end function

    might work...

    "someone" <> wrote in message
    news:...
    Hi All,

    I need a function that only allows Increments by 10, 20, 30.....

    How do I achieve this in VB Script?

    Any help is appreciated.

    TIA,

    Santosh
     
    Lance Wynn, Jan 2, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nicolla MacPherson
    Replies:
    4
    Views:
    410
    Karl Heinz Buchegger
    Aug 13, 2003
  2. Replies:
    10
    Views:
    530
    Dennis Lee Bieber
    Jun 26, 2005
  3. 4ward.com

    Loop with float increments (frange)?

    4ward.com, Apr 14, 2006, in forum: Python
    Replies:
    3
    Views:
    469
    Tim Peters
    Apr 14, 2006
  4. M
    Replies:
    6
    Views:
    384
  5. Richard

    UDB and pointer increments and decrements

    Richard, Sep 23, 2008, in forum: C Programming
    Replies:
    10
    Views:
    489
    Tim Rentsch
    Oct 9, 2008
Loading...

Share This Page