Split string (then) Convert string into Integer

Discussion in 'ASP General' started by news, May 26, 2010.

  1. news

    news Guest

    Hello All;

    I have a string from my database in the form of
    768x1024 (This is an example, the numbers vary depending on the size of the
    image)

    What I am needing to do is the following.
    I need to split the number from the X
    768
    1024

    Then make them into Int
    So I can use them like so:

    <%if VarNum>768 then%>Image has been Resized<%end if%>

    Any help on this would be greately appreciated.
    Thank You

    Wayne
    www.picdrive.net
    news, May 26, 2010
    #1
    1. Advertising

  2. news

    Dan Guest

    "news" <> wrote in message
    news:a900c$4bfd057f$62100a64$...
    > Hello All;
    >
    > I have a string from my database in the form of
    > 768x1024 (This is an example, the numbers vary depending on the size of
    > the image)
    >
    > What I am needing to do is the following.
    > I need to split the number from the X
    > 768
    > 1024
    >
    > Then make them into Int
    > So I can use them like so:
    >
    > <%if VarNum>768 then%>Image has been Resized<%end if%>
    >
    > Any help on this would be greately appreciated.
    > Thank You
    >
    > Wayne
    > www.picdrive.net
    >
    >


    myString = "768x1024"

    arValues = Split(myString,"x")


    If CInt(arValues(0)) > 768 then ...



    arValues(0) will contain 768, arValues(1) will contain 1024.


    --
    Dan
    Dan, May 26, 2010
    #2
    1. Advertising

  3. news

    news Guest

    Thank you Dan.

    <%
    getSize = 600
    myString = "768x1024"
    arValues = Split(myString,"x")
    If CInt(arValues(0)) > getSize then
    'arValues(0) will contain 768, arValues(1) will contain 1024.
    response.Write"Image has been resized"
    else
    response.Write"View Image"
    end if
    %>

    Works like a complete charm.
    Thank you, thank you, thank you,

    Wayne
    www.picdrive.net
    news, May 26, 2010
    #3
    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. Azmie
    Replies:
    12
    Views:
    1,066,528
    Azmie
    Dec 30, 2003
  2. les ander
    Replies:
    4
    Views:
    863
    wes weston
    Oct 5, 2004
  3. Replies:
    0
    Views:
    261
  4. Sam Kong
    Replies:
    5
    Views:
    230
    Rick DeNatale
    Aug 12, 2006
  5. Stanley Xu
    Replies:
    2
    Views:
    592
    Stanley Xu
    Mar 23, 2011
Loading...

Share This Page