 |
|
 |
|
|
 |
Help copying repeating field to global repeating field |
 |
 |
|
|
02-04-05 10:45 PM
For each record in an FMP 6 DB I have a numeric repeating field with 8
repetitions.
I also a Global numeric repeating field also with 8 repetitions.
How can I copy the data from the record into the global?
A simple Set Field only copies the first repetition.
I want them all to be copied.
TIA for your help
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: Help copying repeating field to global repeating field |
 |
 |
|
|
02-05-05 01:45 AM
In article <noone-3A6BAA.14135404022005@news.isp.giganews.com>, Peter
Teeson <noone@nowhere.com> wrote:
> For each record in an FMP 6 DB I have a numeric repeating field with 8
> repetitions.
>
> I also a Global numeric repeating field also with 8 repetitions.
>
> How can I copy the data from the record into the global?
>
> A simple Set Field only copies the first repetition.
> I want them all to be copied.
>
> TIA for your help
As you've just found out, Repeating fields are often more of a
hidderance than they are useful. Instead of trying to circumvent the
shortcomings of Repeating fields, you're probably best to simply use a
set of eight normal Global fields.
Although, you may not have an option if you're using that Global field
in calculations with other Repeating Fields. If this is the case then
there is a work-around to achieve the functionality of the missing 'Set
Repitition [X, Data] command, but it's fairly long-winded and not worth
going into unless you really need it.
Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: Help copying repeating field to global repeating field |
 |
 |
|
|
02-05-05 07:45 AM
In article <050220051533515091%helpful_harry@nom.de.plume.com>,
Helpful Harry <helpful_harry@nom.de.plume.com> wrote:
> In article <noone-3A6BAA.14135404022005@news.isp.giganews.com>, Peter
> Teeson <noone@nowhere.com> wrote:
>
>
> As you've just found out, Repeating fields are often more of a
> hidderance than they are useful. Instead of trying to circumvent the
> shortcomings of Repeating fields, you're probably best to simply use a
> set of eight normal Global fields.
>
> Although, you may not have an option if you're using that Global field
> in calculations with other Repeating Fields. If this is the case then
> there is a work-around to achieve the functionality of the missing 'Set
> Repitition [X, Data] command, but it's fairly long-winded and not wort
h
> going into unless you really need it.
>
>
>
> Helpful Harry
> Hopefully helping harassed humans happily handle handiwork hardships ;o)
Every record in the DB has a repeating field R with 8 reps.
I need to propogate the data in the R field of record A into a different
record Q (in the same table).
There is information in record A in a different field that will allow me
to do a Find for record Q. I cannot use a self-relationship because
there are only occasionally links between records.
So I want to save the data of field R of record A,
do the Find of record Q,
set the field R in record Q to the saved values and
then return to the original record A.
Why do it this way? Because this is an addon to an existing system that
has the repeating field already there and in use for many years.
Do I have to loop using the GetRepetition function? OK not too bad for 8
items but where is the SetRepetition function? How do I set the got
value?
Seems illogical to me to have a GetRepetition without a SetRepetition.
TIA...
Peter
TIA
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: Help copying repeating field to global repeating field |
 |
 |
|
|
02-05-05 07:45 AM
I made an example that does it.
But I couldn't send it to you personally as your adress is
noone@nowhere.com.
Remi-Noel
"Peter Teeson" <noone@nowhere.com> a écrit dans le message de news:
noone-AFFAC4.23402504022005@news.isp.giganews.com...
> In article <050220051533515091%helpful_harry@nom.de.plume.com>,
> Helpful Harry <helpful_harry@nom.de.plume.com> wrote:
>
>
> Every record in the DB has a repeating field R with 8 reps.
> I need to propogate the data in the R field of record A into a different
> record Q (in the same table).
> There is information in record A in a different field that will allow me
> to do a Find for record Q. I cannot use a self-relationship because
> there are only occasionally links between records.
>
> So I want to save the data of field R of record A,
> do the Find of record Q,
> set the field R in record Q to the saved values and
> then return to the original record A.
>
> Why do it this way? Because this is an addon to an existing system that
> has the repeating field already there and in use for many years.
>
> Do I have to loop using the GetRepetition function? OK not too bad for 8
> items but where is the SetRepetition function? How do I set the got
> value?
>
> Seems illogical to me to have a GetRepetition without a SetRepetition.
>
> TIA...
>
> Peter
>
> TIA
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: Help copying repeating field to global repeating field |
 |
 |
|
|
02-05-05 10:45 PM
In article <420452ca$0$23518$626a14ce@news.free.fr>,
"RN Menegaux" <rnmenegaux@free.fr> wrote:
> I made an example that does it.
> But I couldn't send it to you personally as your adress is
> noone@nowhere.com.
> Remi-Noel
>
Yes I do that to cut down on spam.
Perhaps you would be so kind as to type it here in the news group so
everyone could benefit.
I am assuming that you are using GetRepetition.
But what script step or function are you using to set the result?
>
> "Peter Teeson" <noone@nowhere.com> a écrit dans le message de news:
> noone-AFFAC4.23402504022005@news.isp.giganews.com...
>
>
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: Help copying repeating field to global repeating field |
 |
 |
|
|
02-05-05 10:45 PM
You have to create a script looping through all records, and then setting
each repetition.
Set Field, Click the FIELD button, Highlight the field you need to be SET.
Under the box called: REPETITION, manually enter the repetition you want to
set (Normaly this is 1). Button SPECIFY enter
GETREPETITION(MySourceField;RepetitonNee
ded)
Both repetition numbers should be the same.
If at all possible: Revamp your solution and get rid of thoose repeating
fields. They are a pain in the bum.
Ursus
----- Original Message -----
From: "Peter Teeson" <noone@nowhere.com>
Newsgroups: comp.databases.filemaker
Sent: Friday, February 04, 2005 8:13 PM
Subject: Help copying repeating field to global repeating field
> For each record in an FMP 6 DB I have a numeric repeating field with 8
> repetitions.
>
> I also a Global numeric repeating field also with 8 repetitions.
>
> How can I copy the data from the record into the global?
>
> A simple Set Field only copies the first repetition.
> I want them all to be copied.
>
> TIA for your help
"Peter Teeson" <noone@nowhere.com> schreef in bericht
news:noone-3A6BAA.14135404022005@news.isp.giganews.com...
> For each record in an FMP 6 DB I have a numeric repeating field with 8
> repetitions.
>
> I also a Global numeric repeating field also with 8 repetitions.
>
> How can I copy the data from the record into the global?
>
> A simple Set Field only copies the first repetition.
> I want them all to be copied.
>
> TIA for your help
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: Help copying repeating field to global repeating field |
 |
 |
|
|
02-05-05 10:45 PM
In article <noone-AFFAC4.23402504022005@news.isp.giganews.com>, Peter
Teeson <noone@nowhere.com> wrote:
<SNIP>
> Do I have to loop using the GetRepetition function? OK not too bad for 8
> items but where is the SetRepetition function? How do I set the got
> value?
>
> Seems illogical to me to have a GetRepetition without a SetRepetition.
Nope. Repeating Fields have been in FileMaker since (near) the
beginning and there's never been a Set Repetition command that allows
you to specify the repetition via the data in another field. That's one
of the many reasons Repeating Fields are fairly useless.
You would have thought it was an obvious command to have included when
they added Get Repetition, but six releases later and we're still
waiting. :o\
Another useful addition to Repeating Fields would sometimes be
multi-dimensional fields (ie. arrays, MyField(2,5) or MyField(2,5,3).
Part of the reason is that some of the functions Repeating Fields were
used for have been replaced by Relationships using other files /
tables.
Best advice to to not use Repeating Fields for anything but simple
storage - if you're going to want to do any mildly complicated
scripting or calculation, then don't use them otherwise you usually
find yourself stuck or using a long-winded work-arounds.
Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: Help copying repeating field to global repeating field |
 |
 |
|
|
02-07-05 12:45 PM
> Yes I do that to cut down on spam.
> Perhaps you would be so kind as to type it here in the news group so
> everyone could benefit.
>
> I am assuming that you are using GetRepetition.
> But what script step or function are you using to set the result?
Hi Peter,
it's interesting to see how almost everytime somebody asks a solution for a
repeating field problem, (the same) people jump in to tell them to use
something else, because in their book, repeating fields are the root of all
evil.
Sure, they have serious limitations and I wouldn't use them for any fields
even remotely likely to be used in calculations, sorting, summaries etc.
But for temporary storage, such as in your case, I don't see any harm.
Now, to answer your question, there is no SetRepetition function which
could use the value of another (loop counter) field. I don't see the logic
of having GetRepetition without a SetRepetition any more than you do, but
that's just the way it is. A popular work around is to use the Tab order of
the fields : make a layout specifically intended for your script and set
the tab order for the repeating fields to be consecutive (i.e. rep 1 = tab
1, rep 2 = tab 2 etc.).
Now you can loop through the repetitions by using the "Go to Next Field"
Script step. So, in your case you could do something like :
Set Field [ gCounter, 1 ]
Go to Field [ gStorage ]
Loop
Exit Loop If [ gCounter > 8 ]
Set Field [ gTemp, GetRepetition(Field ; gCounter) ]
Insert Calculated Result [ Select, gTemp ]
[ Select entire contents ]
Go to Next Field
Set Field [ gCounter, gCounter + 1 ]
End Loop
where "gStorage" is your temporary repeating storage field, "Field" your
standard repeating field holding the data you wish to copy and "gTemp" a
temporary field to hold the data of GetRepetition(Field;gCounter) which is
then inserted in the active repetition of gStorage.
Somehow, using "Insert Calculated Result [ Select,
GetRepetition(Field;gCounter)]" does not work directly, that's why you need
the extra step.
Make sure that you do *not* specify a target field with the Insert
Calculated Result step.
HTH,
Peter
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: Help copying repeating field to global repeating field |
 |
 |
|
|
02-07-05 10:45 PM
In article <1g9rbtyiw3bdl$.1fms168dvtu67$.dlg@40tude.net>, Peter
<nospam@homeorwork.tnx> wrote:
>
> Hi Peter,
>
> it's interesting to see how almost everytime somebody asks a solution for
a
> repeating field problem, (the same) people jump in to tell them to use
> something else, because in their book, repeating fields are the root of al
l
> evil.
>
> Sure, they have serious limitations and I wouldn't use them for any fields
> even remotely likely to be used in calculations, sorting, summaries etc.
> But for temporary storage, such as in your case, I don't see any harm.
Yes, repeating fields can be useful in some circumstances. I personally
often use them for things like Address and Phone Number fields that are
only ever stored or printed.
Some people use them to store the different states of a button (for
example), but I find it easier and more understandable to use separate
fields.
eg. Set Field [MyButton, Get Repetition(ButtonStates, -2)]
is far easier for someone later to understand if it instead is
Set Field [MyButton, Button On]
There's even one person who uses pixel-sized repeating fields to create
pixel graphics within FileMaker for graphs, etc.
The only "harm" is that you have to use complicated workarounds to get
many things done with them - one great example is the missing Set
Repetition command. It's often easier to simply not use them at all,
especially if you plan to do any calculations or scripting with the
field.
Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: Help copying repeating field to global repeating field |
 |
 |
|
|
02-08-05 10:45 PM
In article <1g9rbtyiw3bdl$.1fms168dvtu67$.dlg@40tude.net>,
Peter <nospam@homeorwork.tnx> wrote:
<snip>
> Now you can loop through the repetitions by using the "Go to Next Field"
> Script step. So, in your case you could do something like :
>
> Set Field [ gCounter, 1 ]
> Go to Field [ gStorage ]
> Loop
> Exit Loop If [ gCounter > 8 ]
> Set Field [ gTemp, GetRepetition(Field ; gCounter) ]
> Insert Calculated Result [ Select, gTemp ]
> [ Select entire contents ]
> Go to Next Field
> Set Field [ gCounter, gCounter + 1 ]
> End Loop
>
Thanks for your professional reply.
The other folks who answered must have missed my pointing out that I was
doing an addon to an existing table that has been using the repeating
field for years. So I hod no choice in altering the design but had to
use what was already there.
In fact since there were only 8 reps I ended up doing 8 pairs of:
Set Field [tempnumber, GetRepetition(SourceRepeatingField,x)]
Set Field [DestinationRepeatingField-x,tempnumber]
The last Set Field above has the choice of setting the repetition number
in the dialog window that opens when selecting the field.
I also discovered that it cannot be done in one statement but requires
the interim save of the GetRep.
Anyway my thanks to everyone for your advice and help.
respect....
Peter
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
|
Sponsored Links |
 |
 |
|
|
 |
All times are GMT. The time now is 09:02 AM. |
 |
|
|
 |
|
 |
|
|
 |
|
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
|
|
|
|
|
 |
|
 |
|