sorting numbers

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • blakedut2
    New Member
    • Aug 2008
    • 3

    sorting numbers

    I need to sort numbers from lowest to highest. They need to be asociated with a string so when they appeared lowest to highest the string is next to them. I have to do this with 40 numbers and 40 strings. Any help appreciated, plz explain slowly so i can understand!
  • vdraceil
    New Member
    • Jul 2007
    • 236

    #2
    do you mean you hav strings like "99hi","10how", "02are","36you" ..and you want to sort them??
    if so extract the first two characters of each string by "Mid" function and store them in an integer array by using "CInt" function..
    then sort them as usual..

    hope i got u correctly..if not be more clear in specifying your problem.

    Comment

    • blakedut2
      New Member
      • Aug 2008
      • 3

      #3
      No as in, i have save the number in a different variable, for example:
      h1name1 is my string variable and the text in it is:
      fred button
      and h1time1 is my integer variable with:
      12.65
      in it.

      Comment

      • vdraceil
        New Member
        • Jul 2007
        • 236

        #4
        Originally posted by blakedut2
        No as in, i have save the number in a different variable, for example:
        h1name1 is my string variable and the text in it is:
        fred button
        and h1time1 is my integer variable with:
        12.65
        in it.
        so u hav variables like h1name1,h1time1 ,h2name2,h2time 2 and so on..
        on which basis u want to sort?
        pls give an example of all variables u hav and how u like to sort them..

        Comment

        • lotus18
          Contributor
          • Nov 2007
          • 865

          #5
          Originally posted by blakedut2
          and h1time1 is my integer variable with:
          12.65
          in it.
          I doubt that h1time1 can holds 12.65. It may loss its precision. Use double data type instead. : )

          Comment

          Working...