Xbasic
UniqueNameGet Function
Syntax
Result_Name as C = UniqueNameGet(C existing ,C suggested )
Arguments
- Result_Name
The resulting unique name.
- existing
A CR-LF delimited list of names for comparison.
- suggested
The base name to make unique.
Description
Takes a CRLF delimited list of existing names and a suggested name and increments a counter at end of suggested name until it is unique.
Discussion
The UniqueNameGet() function takes a CR-LF delimited list of existing names and a suggested name and increments a counter at end of suggested name until it is unique.
Example
Dim existingNames as C existingNames = comma_to_crlf("Firstname, Firstname1, Firstname2") ? UniqueNameGet(existingNames, "Firstname") ="Firstname3" existingNames = comma_to_crlf("Firstname3, Firstname1, Firstname2") ? UniqueNameGet(existingNames, "Firstname") = "Firstname"
See Also