Sequential Part Number Generator...with a twist

Mike Palandri palandri@4j.lane.edu
Fri, 18 Feb 2000 09:39:37 -0800


We have a number of these in various systems.  Our approach is to store the next number to be used in a control file (really just an record in a multi-purpose code table).  In preupdate, the screen locks the code table, reads the sequence number record, increments it, writes it back, and unlocks the code-table.  If another instance of the screen tries to update the code table record at the same time, PH is smart enough  to wait till it is unlocked.  The file is only locked for as long as it takes to read and write the record.

Perhaps you could use this technique to retrieve a similar control record from a field procedure in your screen.


At 12:00 PM 02/18/2000 -0500, Chris Gassett wrote:
>The users would like a sequentially generated field.  The field is split
>into two sections  XXXXX-XXX (Ex.   000012, 000013-001, 000014, 000014-001,
>etc.)  and is handled with three variables.  The first 5 characters is the
>field that is generated sequentially.  In entry mode the user would hit the
>enter key and the next number would be generated automatically and the
>cursor would move to the last three digits and the dash in between would be
>displayed or the user can enter up to 5 digits of a previous record to
>append to the end of it with three additional characters.  The user has the
>option to enter up to three characters or hit the enter key.  If the enter
>key is pressed without entering data the dash disappears and the second
>field is left blank.  My problem is if two people are accesssing this screen
>at one time two or more users can grab the same sequentially generated
>number.  What I need to do is do commit the record after the second field of
>three characters is passed.  If anyone knows of something remotely close to
>what I am attempting to do I would greatly appreciate the feedback.  Thanks,
>Chris
>= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
>Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
>Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
>This list is closed, thus to post to the list, you must be a subscriber.
>

Mike