🚀 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 Jason Andrew Herman Fri, 30 Oct 1992 03:06
4th D File Relationships
#18
Author: Jason Andrew Herman
Date: Fri, 30 Oct 1992 03:06
11 lines
854 bytes
Hello all:

Normally when you set up an automatic relation between two files, 4th D
asks you in the middle of your parent layout if you want to create the
related field or try again.  Now the question is, is there a way to have
4th D automatically make the new related file without prompting the
user??

Many thanks in advance,

Jason
Re: 4th D File Relationships
#29
Author: ST25370
Date: Sun, 01 Nov 1992 17:34
34 lines
1562 bytes
In article <8ew_OQy00UhW88KlpV@andrew.cmu.edu>
Jason Andrew Herman <jh62+@andrew.cmu.edu> writes:
 
>Hello all:
>
>Normally when you set up an automatic relation between two files, 4th D
>asks you in the middle of your parent layout if you want to create the
>related field or try again.  Now the question is, is there a way to have
>4th D automatically make the new related file without prompting the
>user??
>
>Many thanks in advance,
>
>Jason
 
Through code, yes.  Make the relation manual, and execute:
 
relate one ([File]Field])
if (records in selection([related file])=0)
   create record([related file])
   /* insert values */
   save record([related file])
end if
 
from the object in question.  Of course, this will require that you 'fix' all
the code that depends on the automatic relation by executing the relate one
or many whenever you need the relation active.
You will also have to support the automatic lookup I assume you are using
through code as well, but this is tedious rather than difficult.
 
 
Bill Jamison
rwj@engr.latech.edu
st25370@vm.cc.latech.edu
Re: 4th D File Relationships
#32
Author: Charles B. Wilber
Date: Mon, 02 Nov 1992 21:05
16 lines
1258 bytes
Jason:  I haven't actually done what you asked about but I would think
it could be accomplished procedurally. In the input layout of the first
file you would need a procedure (perhaps a script attached to the
lonking field?) which would search the linked file for matching
records. If the search returns no matching records in the linked file,
the procedure would branch to a "Create Record" routine. You would need
to include some sort of field-incrementing routine in the create
procedure since linking fields must be unique in at least one of the
files.

If you send me a structure file in which you would like this to happen
I would be glad to cobble up some sample code for you.

Regards,
Charles B. Wilber
Dartmouth College
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