AnsweredAssumed Answered

How to prevent duplicates from scripted password generator?

Question asked by the_engineeer on Jul 10, 2017
Latest reply on Jul 11, 2017 by the_engineeer

Hello all!

I've recently started using Filemaker again, and I realize that much has happened since version 4... :-)

Some memory loss on my part may also be to blame.

 

However, I need a script that generates an unique 3-character "password" for every record in the database. My script as of now looks like this:

 

If [ Length ( MyDatabase::Password ) = 3 ]

Halt Script

End If

Clear [Select; MyDatabase::Password]

Loop

Set Field [ MyDatabase::Password; MyDatabase::Password & Middle ("abdefhimnrtABCDEFGHJKMNPQRSTUVWXYZ1234567890"; Int

(Random * 44); 1)

Exit Loop If [ Length ( MyDatabase::Password ) = 3 ]

End Loop

 

This script generates passwords just fine, but how do I add a function that checks that no duplicates are created?

/Thanks for any help!

Outcomes