realbasic-nug
[Top] [All Lists]

Re: Checking for string output duplicity...

To: REALbasic Network Users Group <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Checking for string output duplicity...
From: "Joseph J. Strout" <joe at realsoftware dot com>
Date: Wed, 30 Jul 2003 07:20:09 -0700
At 7:37 AM -0400 7/30/03, Rick Davis wrote:

My problem is what to do when I have Michelle Anderson, Michael Anderson and Mickala Anderson all in the same list (real people in a local school). Mac OS X does not allow duplicate short names and they would all be andermic. I would like my app to compare the short name generated and if a duplicate change the last character to a number 1, 2, etc as needed.

Well, you've pretty well described it:

  while NameAlreadyUsed(name)
    name = Left(name, Len(name) - Len(str(num))) + str(num)
    num = num + 1
  wend

Cheers,
- Joe

--
,------------------------------------------------------------------.
|    Joseph J. Strout           REAL Software, Inc.                |
|    joe at realsoftware dot com       http://www.realsoftware.com        |
`------------------------------------------------------------------'

---
A searchable archive of this list is available at:
<http://support.realsoftware.com/listarchives/search.php>

Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>
.


<Prev in Thread] Current Thread [Next in Thread>