We're looking into other ways to generate unique keys, and we'd like to know if there's a way via LotusScript to generate a Windows Globally Unique Identifier (GUID). I've done some searching and people only talk about them, not how to generate them on the fly. Can you help?
So, IF I created a document, @Unique would generate a key like BMAY-66RH28, where the first segment was generated from my userID and the last part is related to date and time. IF the keys are all generated by an agent and signed by the same ID, the first part is not really relative. Start with a database, or a state identifier, PA, add the timestamp part of @Unique, 66RH28 and an initial differentiator -- 0 to get a possible key of PA-66RH28-0. Check if a document exists with that key, if it does increment the differentiator by one and check again.
In some applications, we change the position of the differentiator and database identifier so that the 0 doesn't always appear at the end of the key. So possible variations of the same unique identifier, PA-66RH28-0, in different formats could be PA66RH280, PA-066RH28, 66RH280PA and 0PA66RH280.
Do you have comments on this Ask the Expert question and response? Let us know.
This was first published in November 2004