Slobey Posted April 4, 2005 Posted April 4, 2005 Hi everyone, I am creating a stand alone solution that has serial numbers for access purposes. I have a global field (gSerial Pool) with all acceptable serial numbers in it. For now they are separated with a comma. I have another global field (gSerial Number) that is an entry field. the user enters a serial number and I have a third field, (gAccount Name) that will check if the number is in the list. the current calc looks like this: If( PatternCount (gSerial Pool ;gSerial Number); "Customer"; "Trial" ) I am using this so I can distribute the software for trial with limited access, if they register, they get a serial number which will open up all records. The problem I have is that the pattern count doesn't seem to work. If I have a serial number of "123456" then entering any number from 1 thru 6 works and I want it to work only if they enter all of them. Any suggestions?
comment Posted April 4, 2005 Posted April 4, 2005 Try: Case ( Position ( "," & gSerialPool & "," ; gSerialNumber ; 1 ; 1 ) ; "Customer" ; "Trial" )
Slobey Posted April 4, 2005 Author Posted April 4, 2005 Thanks for your reply, Unfortunately, that didn't work either.
comment Posted April 5, 2005 Posted April 5, 2005 No, of course not. Sorry, don't know what happened here - I pasted it from my test file, then somehow managed to mangle it when changing the field names to yours. Anyway, this should do the job: Case ( Position ( "," & gSerialPool & "," ; "," & gSerialNumber & "," ; 1 ; 1 ) ; "Customer" ; "Trial" )
Slobey Posted April 5, 2005 Author Posted April 5, 2005 Well That worked better, but only the first seial number in the gSerialPool worked, the rest didn't. In other words I filled gSerial with 12, 13, 14, and when I entered 1 in gSerialNumber it didn't authorize and when I entered 12 it did, which was great. But it didn't authorize 13 or 14.
comment Posted April 5, 2005 Posted April 5, 2005 Well, when you say comma separated - I am thinking comma separated. Not comma-and-space separated. OK, let's see: Let ( [ list = "," & TrimAll ( gSerialPool ; 0 ; 3 ) & "," ; this = "," & gSerialNumber & "," ] ; Case ( Position ( list ; this ; 1 ; 1 ) ; "Customer" ; "Trial" ) )
Slobey Posted April 5, 2005 Author Posted April 5, 2005 I think I got it. I eliminated the gSerialPool field and made a value list of serial numbers and changed the calculation to read: Case ( Position ( "
comment Posted April 5, 2005 Posted April 5, 2005 Seems OK to me. In ver.7, you can drop the commas around a single
Recommended Posts
This topic is 7241 days old. Please don't post here. Open a new topic instead.
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