🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.mac.databases
3 messages
3 total messages Started by William Matthew Beaver Thu, 05 Nov 1992 21:45
4D: Assigning Unique Integers
#375
Author: William Matthew Beaver
Date: Thu, 05 Nov 1992 21:45
15 lines
1201 bytes
Is there a way to assign a unique integer to a field outside of the #N
comand in the layout editor?  I have no problem creating the Unique
number with #N in the default value box for the field in the layout. 
The problem occurs when I create a record in a script, assign different
values, save the record, and then display it with Display record.  The
value doesn't get asigned in default if I save the record beore I
display it.  I cannot do the assignment in the script either.  I get an
error when I say [Project]Project_Num:=(#N). Is there another comand for
this?

Any ideas are very welcome.

Thanks in advance,
William Beaver
Carnegie Mellon University
Re: 4D: Assigning Unique Integers
#373
Author: Mike Hennahane
Date: Fri, 06 Nov 1992 00:50
19 lines
1502 bytes
William Matthew Beaver <wb1o+@andrew.cmu.edu> writes:

>Is there a way to assign a unique integer to a field outside of the #N
>comand in the layout editor?  

the "standard" :-) way to do this is to have an extra file in your
database called Constants or Sequences. your sequence file has 2
fields: sequence name, and next number.  to get the next number all
you have to do is search for the correct sequence by name (or you can
number them if you prefer) and then use the contents of the next
number field;  before you unlock the record, you should increment the
next number for the next time you want one. the next number is always
unique for that sequence as long as you increment it each time it is
used. you may have different sequences for each file in your database,
and multiuser issues are not a problem (if you can't load the record,
you know someone else is using it. just wait until it becomes availale
again to get the next number).

--mike
Re: 4D: Assigning Unique Integers
#389
Author: Mats Johnson
Date: Fri, 06 Nov 1992 12:01
8 lines
888 bytes
What about the builtin function "sequence number([File])? I think I
remember reading it has some multiuser problems, but that ought to be
solvable, for example by start/end transaction?

--
Mats Johnson, CMD, Uppsala University, Laegerhyddsvaegen 18, S-752 37 UPPSALA
Mats.Johnson@CMD.UU.SE
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads