Results 1 to 5 of 5

Thread: Sorting names need help!!!!

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Dec 2002
    Posts
    20

    Sorting names need help!!!!

    OK i have this program, attached below. And when the user clicks the "Last, First" button the names show up in the last, First way. I know i gotta use like Instr and stuff like that but its gotten confusing!?!?!?!


    Thanks for any help,

    -Chaos
    Attached Files Attached Files

  2. #2
    Hyperactive Member
    Join Date
    Nov 2001
    Location
    Albany, NY
    Posts
    489
    You are loading from a text file.

    Put everything into a 2D array with Firstname
    and lastname in separate elements. Then it
    will be easy to resort them. Thats at least how
    I would approach it. Oh yeah, the array must be
    global or static to live through the life of the form.

  3. #3
    Addicted Member
    Join Date
    Jun 2002
    Posts
    211
    OK Try this

    Define a flex grid with three columns

    1st column = First name
    2nd Column = Last Name
    3rd Column = First name

    colwidth of 3rd is 0

    press button and toggle between colwidth 1st 0 and 3rd 0

    Simon

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Dec 2002
    Posts
    20
    Hey all that stuff sounds kool, but i just wanna make something really easy. It for a school project. thanks for the help but i just need something small!!

  5. #5
    Hyperactive Member
    Join Date
    Nov 2001
    Location
    Albany, NY
    Posts
    489
    If the format is alwasy
    First name SPACE Last Name
    Then you can Instr(The_Name, " ") will give the location
    of the space.

    So FirstName is at position:
    Left(The_Name, Instr(The_Name, " ") - 1)

    LastName is at position:
    Right(The_Name, Len(The_Name) - Instr(The_Name, " "))

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