stann Posted February 18, 2004 Posted February 18, 2004 Hello I need to make a formula that gives us a unique number with a range. The fields are "lownumber" highnumber" and "RANDOMNUMBER" SO if the low number is 001 and the high number is 999 it needs to pick a random number that hasn't been used , I was thinking of adding a field called "USEDNUMBERS" and wondered if somehow it could probe that field and choose. I need help with this one. Thanks Stan
Fenton Posted February 18, 2004 Posted February 18, 2004 I don't think it can be done with just a calculation. This is a little file I made, for my local Mac user group, to do raffles. It can do more than one at once, because they may be giving tickets out from different rolls with discontinous numbers. You just need the basic Pick New Number Only script. The others are for the discontinous rolls. RafflesSer.zip
stann Posted February 18, 2004 Author Posted February 18, 2004 Thanks so much, That is what I need to get mine to work. But I am not quite clear if it probes the field to search it to see it the number already exists so as not to duplicate it. I can't duplicate the numbers because this is for making a badge for each person so they have a unique number at every event on a badge they wear. It is important that I get a unique number. thanks Stan
Fenton Posted February 18, 2004 Posted February 18, 2004 That's what the "not PatternCount()" clause is doing, seeing if the "new" number produced by the Random function exists already in the multi-line global field holding the already picked numbers. If you want to keep those already picked numbers over a period of time, or do this on a network, you should change that field to a regular text field.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now