home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / sys / mac / database / 1408 < prev    next >
Encoding:
Text File  |  1992-11-06  |  1.4 KB  |  31 lines

  1. Newsgroups: comp.sys.mac.databases
  2. Path: sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!sun-barr!ames!agate!stanford.edu!CSD-NewsHost.Stanford.EDU!Xenon.Stanford.EDU!michaelh
  3. From: michaelh@Xenon.Stanford.EDU (Mike Hennahane)
  4. Subject: Re: 4D: Assigning Unique Integers
  5. Message-ID: <michaelh.721011036@Xenon.Stanford.EDU>
  6. Sender: news@CSD-NewsHost.Stanford.EDU
  7. Organization: CS Department, Stanford University, California, USA
  8. References: <IeyNLli00UhW05rJoR@andrew.cmu.edu>
  9. Date:  6 Nov 92 00:50:36 GMT
  10. Lines: 19
  11.  
  12. William Matthew Beaver <wb1o+@andrew.cmu.edu> writes:
  13.  
  14. >Is there a way to assign a unique integer to a field outside of the #N
  15. >comand in the layout editor?  
  16.  
  17. the "standard" :-) way to do this is to have an extra file in your
  18. database called Constants or Sequences. your sequence file has 2
  19. fields: sequence name, and next number.  to get the next number all
  20. you have to do is search for the correct sequence by name (or you can
  21. number them if you prefer) and then use the contents of the next
  22. number field;  before you unlock the record, you should increment the
  23. next number for the next time you want one. the next number is always
  24. unique for that sequence as long as you increment it each time it is
  25. used. you may have different sequences for each file in your database,
  26. and multiuser issues are not a problem (if you can't load the record,
  27. you know someone else is using it. just wait until it becomes availale
  28. again to get the next number).
  29.  
  30. --mike
  31.