Results 1 to 9 of 9
  1. #1

    User list in Alphabetic Order

    User Phil Mitchell (philmitchellsoftware@hotmail.com.nospam) posted:


    ive got a list of 4 users. could someone give some info on how i can ensure
    all users are displayed on the User list in Alphabetic Order.I've done this
    about a year ago but can't remember it and its driving me mad.


    __________________________________________________ _______________
    Send and receive Hotmail on your mobile device: http://mobile.msn.com

  2. #2

    Re: User list in Alphabetic Order

    If you are talking about a listbox, you may write a function to check whether the listbox items are ordered properly.

    public function Is_Listbox_In_Order(in listbox, in order)

    where the parameter "order" can be either ASC or DESC.

    To implement the function, you need to get the count of the listbox and construct a loop to compare adjacent items pair by pair. Use list_get_item ( list, item_num, out_value ) to iterate through the listbox. Alternate the string compare operator of "<" and ">" to adapt to ASC and DESC order.


  3. #3

    Re: User list in Alphabetic Order

    User Phil Mitchell (philmitchellsoftware@hotmail.com.nospam) posted:

    Steve et al,

    I've come up with the following:

    table = "d:\\xxx\\xxx.xls";
    rc = ddt_open(table, DDT_MODE_READ);
    if (rc!= E_OK && rc != E_FILE_OPEN)
    pause("Cannot open table.");
    for(table_Row = 1; table_Row <= table_RowCount; table_Row ++)

    # I could do with some help on the compare statement i need to put in
    # here. i want to compare the first letter of 4 usernames and make sure #
    they appear in alphabethical order in the aut and as per data table.


    __________________________________________________ _______________
    MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx

  4. #4

    Re: User list in Alphabetic Order

    User Sriram Gopalan (sriram.gopalan@divine.com.nospam) posted:

    Content-Type: text/plain;
    Content-Transfer-Encoding: 7bit


    Use ascii(), this will return the ASCII code of the first character in a
    string. I remember using this function for alphabetical order check..

    Store those 4 username in an array.


    not wrong..

    Let me know if it works


  5. #5

    Re: User list in Alphabetic Order

    I posted some array functions at:

    One of them is a sorting function, which you might be able to use as is, or extract the logic to create your own. Enjoy!

    Charles Reace

    my @email = qw(charles reace verizon net);
    printf("%s.%s@%s.%s\n", $email[0], $email[1], $email[2], $email[3]);
    web site | [url=http://www.ebookworm.us/[/url]

    [i]...Sound trumpets! Every trumpet in the host! / Sixty thousand, on these words, sound, so high the mountains sound, and the valleys resound.</i] (The Song of Roland)

  6. #6

    Re: User list in Alphabetic Order

    User Irlbeck, James (james.irlbeck@htc.com.nospam) posted:

    Content-Type: text/plain;

    This harkens back to my college FORTRAN days when one of our assignments was
    to insert names into an array in alpha order. If my recollection serves me
    correctly the 'best" implementation was to convert the alpha string of the
    chars into numeric using a reference, or lookup table. After that it's
    simply a matter of doing a greater than - less that check.

    So, in tsl you could write a Switch statement with 26 cases that converts A
    - Z to 1 -26. Then use a ltrim command to grab the first letter and find
    the proper array location, then loop for each subsequent letter until the
    fourth position has been determined.

    Good luck and hey, post the code when you're done!!

  7. #7

    Re: User list in Alphabetic Order

    User Irlbeck, James (james.irlbeck@htc.com.nospam) posted:

    Content-Type: text/plain;

    Binary tree is indeed the optimal solution. Switch is the non programmers,
    programming method.

  8. #8
    Junior Member
    Join Date
    Aug 2002
    Bangalore,Karnataka, India

    Re: User list in Alphabetic Order

    User Lurdu Matha Reddy K (lurdumr@aztec.soft.net.nospam) posted:

    Content-Type: text/plain;

    The best solution is Binary Search Tree ( Use array implementation , ).

  9. #9

    Re: User list in Alphabetic Order

    User Steve Mathisen (scmathisen@hotmail.com.nospam) posted:

    <div style='background-color:'><DIV>

    <!-- |**|begin egp html banner|**| -->

    Steve Mathisen
    Quality is the result of a carefully constructed cultural environment. It has to be the fabric of the organization, not part of the fabric.
    Philip Crosby



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 05:58 PM.

Copyright BetaSoft Inc.