dbTalk Databases Forums  

Adding info to repeating fields

comp.databases.filemaker comp.databases.filemaker


Discuss Adding info to repeating fields in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
pcourterelle
 
Posts: n/a

Default Adding info to repeating fields - 11-24-2005 , 08:03 PM






Working in FM6 (ok, I know, time to upgrade eh?)

I am creating a table of publication names using a repeating field with 20
repetitions. This table will then be the source for a value list in a
related file. Works great, just like it's suppose to. The repeating field
currently uses 5 out of the 20 repetitions.

I've used a related file for a couple of reasons. FM 6 does not support
repetitions on global fields. Adding the repeating fields to the main
document doesn't work because when the info is added it stays with a
specific record, thus there is no permanence to the information. The record
could be deleted. Placing this info a separate file and then relating it to
the main document also fits with the general database model. I can also
secure it.

I am working on a script that will allow users to add publications to the
repeating field. Is there a way to tell FM 6 to use a specific repetitions
within the repeating field or table? When you use the SetField function on a
repeating field you can determine which repetion to use but can this be done
dynamically?

For example,

text field 'publications' = repeating field with 20 reptitions.
Repetitions 1-3 contain data.
I want to add new data to Reptition 4.
If I tell FM to use repeation 1, 2, or 3, it will overwrite the existing
data.

Any thoughts would help.

Thanks

phil



Reply With Quote
  #2  
Old   
FP
 
Posts: n/a

Default Re: Adding info to repeating fields - 11-24-2005 , 09:30 PM






If you're still at the design stage then my suggestion to you is to get
rid of the repeating fields.
Yes, FileMaker supports them but they are difficult to work with eg.
show me a filtered value list of specific types of publications

No, there is no way to dynamically tell FM which repetition to use
unless you script it something along the lines;
If (isempty(rep1)
Set rep1 to the data
If (isempty(rep2)
Set rep1 to the data
endif
end if


Reply With Quote
  #3  
Old   
Helpful Harry
 
Posts: n/a

Default Re: Adding info to repeating fields - 11-24-2005 , 11:16 PM



In article <4iuhf.130636$S4.105175@edtnps84>, "pcourterelle"
<someone (AT) ms (DOT) com> wrote:

Quote:
Working in FM6 (ok, I know, time to upgrade eh?)

I am creating a table of publication names using a repeating field with 20
repetitions. This table will then be the source for a value list in a
related file. Works great, just like it's suppose to. The repeating field
currently uses 5 out of the 20 repetitions.

I've used a related file for a couple of reasons. FM 6 does not support
repetitions on global fields.
Really?!?!? FileMaker 5.5 does. If you're right then they must have
taken it out, which is more proof that repeating fields are best
avoided.



Quote:
Adding the repeating fields to the main
document doesn't work because when the info is added it stays with a
specific record, thus there is no permanence to the information. The record
could be deleted. Placing this info a separate file and then relating it to
the main document also fits with the general database model. I can also
secure it.

I am working on a script that will allow users to add publications to the
repeating field. Is there a way to tell FM 6 to use a specific repetitions
within the repeating field or table? When you use the SetField function on a
repeating field you can determine which repetion to use but can this be done
dynamically?

For example,

text field 'publications' = repeating field with 20 reptitions.
Repetitions 1-3 contain data.
I want to add new data to Reptition 4.
If I tell FM to use repeation 1, 2, or 3, it will overwrite the existing
data.
I'm not sure I follow all that, but repeating fields aren't usually a
good choice. It might be better to have the related file use a separate
record for each value, then the user can simply add / delete records to
change the value list - that's normally how this sort of thing is done.

There's no way to set a variable repetition of a repeating field
(another reason not to use them), so that means you're stuck with a
long set of nested If-Then statements:

If (IsEmpty(GetRepetition(RepeatField, 1)))
Set Field (RepeatField -1, MyData)
Else If (IsEmpty(GetRepetition(RepeatField, 2)))
Set Field (RepeatField -2, MyData)
Else If ...
...
Else If (IsEmpty(GetRepetition(RepeatField, 20)))
Set Field (RepeatField -20, MyData)
End If
End If
...
End If

There are other more complicated ways involving the Extend function to
set a particular repetition, but they're really not worth the hassle.


Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)


Reply With Quote
  #4  
Old   
Bill Marriott
 
Posts: n/a

Default Re: Adding info to repeating fields - 11-25-2005 , 12:10 AM



FileMaker 6 certainly *DOES* allow you to create globals with repetitions.

Bill

"Helpful Harry" <helpful_harry (AT) nom (DOT) de.plume.com> wrote

Quote:
In article <4iuhf.130636$S4.105175@edtnps84>, "pcourterelle"
someone (AT) ms (DOT) com> wrote:

Working in FM6 (ok, I know, time to upgrade eh?)

I am creating a table of publication names using a repeating field with
20
repetitions. This table will then be the source for a value list in a
related file. Works great, just like it's suppose to. The repeating field
currently uses 5 out of the 20 repetitions.

I've used a related file for a couple of reasons. FM 6 does not support
repetitions on global fields.

Really?!?!? FileMaker 5.5 does. If you're right then they must have
taken it out, which is more proof that repeating fields are best
avoided.



Adding the repeating fields to the main
document doesn't work because when the info is added it stays with a
specific record, thus there is no permanence to the information. The
record
could be deleted. Placing this info a separate file and then relating it
to
the main document also fits with the general database model. I can also
secure it.

I am working on a script that will allow users to add publications to the
repeating field. Is there a way to tell FM 6 to use a specific
repetitions
within the repeating field or table? When you use the SetField function
on a
repeating field you can determine which repetion to use but can this be
done
dynamically?

For example,

text field 'publications' = repeating field with 20 reptitions.
Repetitions 1-3 contain data.
I want to add new data to Reptition 4.
If I tell FM to use repeation 1, 2, or 3, it will overwrite the existing
data.

I'm not sure I follow all that, but repeating fields aren't usually a
good choice. It might be better to have the related file use a separate
record for each value, then the user can simply add / delete records to
change the value list - that's normally how this sort of thing is done.

There's no way to set a variable repetition of a repeating field
(another reason not to use them), so that means you're stuck with a
long set of nested If-Then statements:

If (IsEmpty(GetRepetition(RepeatField, 1)))
Set Field (RepeatField -1, MyData)
Else If (IsEmpty(GetRepetition(RepeatField, 2)))
Set Field (RepeatField -2, MyData)
Else If ...
...
Else If (IsEmpty(GetRepetition(RepeatField, 20)))
Set Field (RepeatField -20, MyData)
End If
End If
...
End If

There are other more complicated ways involving the Extend function to
set a particular repetition, but they're really not worth the hassle.


Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)



Reply With Quote
  #5  
Old   
Bill Marriott
 
Posts: n/a

Default Re: Adding info to repeating fields - 11-25-2005 , 12:46 AM



(The reason why he can't use the global repeating field for his value list
is that global fields are not indexed. Values from a field must be indexed.
Has nothing to do with the fact it's repeating.)

There's really no justification in using a repeating field in this instance.

1) Create a New file, "theValues.fp5"
2) Create a single field, "valueItem" (text) non-repeating.
3) Populate the database with the publication names, one per record.
4) Switch over to your original file
5) Format the field to use a Value List and "Define Value Lists"
6) Specify to use values from another file, "theValues.fp5."
7) Since theValues doesn't have any lists yet, you'll be able to create one
from within this dialog, to use values from a Field, in this case,
"ValueItem"
8) Click OK a few times and you will be back to layout mode.

Switch to Browse mode and you will see that you now have a popup list with
all the items from theValues.

You may administer the adding of items to the value list by having users
switch to theValues and adding records, etc. (You cannot do this simply by
adding an "other.." item to the popup list/menu in the field formatting.)

Bill

"Helpful Harry" <helpful_harry (AT) nom (DOT) de.plume.com> wrote

Quote:
In article <4iuhf.130636$S4.105175@edtnps84>, "pcourterelle"
someone (AT) ms (DOT) com> wrote:

Working in FM6 (ok, I know, time to upgrade eh?)

I am creating a table of publication names using a repeating field with
20
repetitions. This table will then be the source for a value list in a
related file. Works great, just like it's suppose to. The repeating field
currently uses 5 out of the 20 repetitions.

I've used a related file for a couple of reasons. FM 6 does not support
repetitions on global fields.

Really?!?!? FileMaker 5.5 does. If you're right then they must have
taken it out, which is more proof that repeating fields are best
avoided.



Adding the repeating fields to the main
document doesn't work because when the info is added it stays with a
specific record, thus there is no permanence to the information. The
record
could be deleted. Placing this info a separate file and then relating it
to
the main document also fits with the general database model. I can also
secure it.

I am working on a script that will allow users to add publications to the
repeating field. Is there a way to tell FM 6 to use a specific
repetitions
within the repeating field or table? When you use the SetField function
on a
repeating field you can determine which repetion to use but can this be
done
dynamically?

For example,

text field 'publications' = repeating field with 20 reptitions.
Repetitions 1-3 contain data.
I want to add new data to Reptition 4.
If I tell FM to use repeation 1, 2, or 3, it will overwrite the existing
data.

I'm not sure I follow all that, but repeating fields aren't usually a
good choice. It might be better to have the related file use a separate
record for each value, then the user can simply add / delete records to
change the value list - that's normally how this sort of thing is done.

There's no way to set a variable repetition of a repeating field
(another reason not to use them), so that means you're stuck with a
long set of nested If-Then statements:

If (IsEmpty(GetRepetition(RepeatField, 1)))
Set Field (RepeatField -1, MyData)
Else If (IsEmpty(GetRepetition(RepeatField, 2)))
Set Field (RepeatField -2, MyData)
Else If ...
...
Else If (IsEmpty(GetRepetition(RepeatField, 20)))
Set Field (RepeatField -20, MyData)
End If
End If
...
End If

There are other more complicated ways involving the Extend function to
set a particular repetition, but they're really not worth the hassle.


Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)



Reply With Quote
  #6  
Old   
pcourterelle
 
Posts: n/a

Default Re: Adding info to repeating fields - 11-29-2005 , 02:42 PM




"FP" <ab (AT) pottnerconsulting (DOT) ca> wrote

Quote:
If you're still at the design stage then my suggestion to you is to get
rid of the repeating fields.
Yes, FileMaker supports them but they are difficult to work with eg.
show me a filtered value list of specific types of publications

No, there is no way to dynamically tell FM which repetition to use
unless you script it something along the lines;
If (isempty(rep1)
Set rep1 to the data
If (isempty(rep2)
Set rep1 to the data
endif
end if
A loop works better than nested if statements everytime.

Thanks for the input.

p




Reply With Quote
  #7  
Old   
charly
 
Posts: n/a

Default Re: Adding info to repeating fields - 12-03-2005 , 11:54 AM




pcourterelle wrote:
Quote:
Working in FM6 (ok, I know, time to upgrade eh?)

I am creating a table of publication names using a repeating field with 20
repetitions. This table will then be the source for a value list in a
related file. Works great, just like it's suppose to. The repeating field
currently uses 5 out of the 20 repetitions.

I've used a related file for a couple of reasons. FM 6 does not support
repetitions on global fields. Adding the repeating fields to the main
document doesn't work because when the info is added it stays with a
specific record, thus there is no permanence to the information. The record
could be deleted. Placing this info a separate file and then relating it to
the main document also fits with the general database model. I can also
secure it.

I am working on a script that will allow users to add publications to the
repeating field. Is there a way to tell FM 6 to use a specific repetitions
within the repeating field or table? When you use the SetField function on a
repeating field you can determine which repetion to use but can this be done
dynamically?

For example,

text field 'publications' = repeating field with 20 reptitions.
Repetitions 1-3 contain data.
I want to add new data to Reptition 4.
If I tell FM to use repeation 1, 2, or 3, it will overwrite the existing
data.

Any thoughts would help.

Thanks

phil


Reply With Quote
  #8  
Old   
charly
 
Posts: n/a

Default Re: Adding info to repeating fields - 12-03-2005 , 12:04 PM



Don't worry, be happy. In FM 8 it's yet impossible to use dinamic
subindex for repeting fields. Worst.......... The EXTEND function
isn't working anymore. I have the same problem. I have read hundreds
of articles and some books and I've found in all of these, without
exception!!! the same comment "Is better not to use repeating fields"
In the real world, specifically speaking, Programming world, there is
something called ARRAY (Unidimensional, Bidimensional, N-dimensional,
wow!) Apparently FM has no notice about it..... yet.

I want to ask to all those people that recomend using relations instead
of repeting fields, how you can solve a problem where you want to
display a kind of a grid where columns are internal users of the system
(not FM security users) and rows are menu items (internal items). Each
user has a unique field defined with 1000 repetitions and the
"Authorization Layout"shows 30 different users plus the 1000 menu
items. How can I put those 30 columns with 1000 rows each using
relations? And when I have all the "clicks" in each repetition and I
want to copy them back to the original field, I can't because extend
function doesn't work anymore ............

Are someone working now to promise that in FM 15.0 we will have arrays
(and in memory please!!!!!!!!!!!!!! not in global fields)

thanks, sorry my english


Reply With Quote
  #9  
Old   
42
 
Posts: n/a

Default Re: Adding info to repeating fields - 12-03-2005 , 12:43 PM



In article <1133633078.563130.214170 (AT) g49g2000cwa (DOT) googlegroups.com>,
carlosmenemthefirst (AT) ubbi (DOT) com says...
Quote:
Don't worry, be happy. In FM 8 it's yet impossible to use dinamic
subindex for repeting fields. Worst.......... The EXTEND function
isn't working anymore. I have the same problem. I have read hundreds
of articles and some books and I've found in all of these, without
exception!!! the same comment "Is better not to use repeating fields"
In the real world, specifically speaking, Programming world, there is
something called ARRAY (Unidimensional, Bidimensional, N-dimensional,
wow!) Apparently FM has no notice about it..... yet.
Tables are functionally equivalent to arrays. Technically tables can do
more than arrays. You can build n-dimensional structures within tables,
you can even build ragged structures...

Quote:
I want to ask to all those people that recomend using relations instead
of repeting fields, how you can solve a problem where you want to
display a kind of a grid where columns are internal users of the system
(not FM security users) and rows are menu items (internal items). Each
user has a unique field defined with 1000 repetitions and the
"Authorization Layout"shows 30 different users plus the 1000 menu
items. How can I put those 30 columns with 1000 rows each using
relations? And when I have all the "clicks" in each repetition and I
want to copy them back to the original field, I can't because extend
function doesn't work anymore ............
For starters I doubt anyone would consider a 30x1000 grid a good UI.

But it could be done with a portal, parent table users, child
relationship to 'menu items'.

After you've mucked around setting all the menu items, you want to "copy
them back to the original field"... not entirely sure that means, and
even less sure why you'd want to put 1000 fields worth of data into a
single field? Why wouldn't you just leave them in their related
fields... its probably easier to just access directly there.

But if for some reason you actually needed to you *could* easily enough
by defining a value list on the relationship, and using the get value
list design function.

Quote:
Are someone working now to promise that in FM 15.0 we will have arrays
(and in memory please!!!!!!!!!!!!!! not in global fields)
memory vs globals? huh!?

Quote:
thanks, sorry my english



Reply With Quote
  #10  
Old   
Howard Schlossberg
 
Posts: n/a

Default Re: Adding info to repeating fields - 12-03-2005 , 01:13 PM



charly wrote:
Quote:
Don't worry, be happy. In FM 8 it's yet impossible to use dinamic
subindex for repeting fields. Worst.......... The EXTEND function
isn't working anymore. I have the same problem. I have read hundreds
of articles and some books and I've found in all of these, without
exception!!! the same comment "Is better not to use repeating fields"
In the real world, specifically speaking, Programming world, there is
something called ARRAY (Unidimensional, Bidimensional, N-dimensional,
wow!) Apparently FM has no notice about it..... yet.
I don't think arrays were meant for display and GUI editing purposes in
any language. As far as memory goes, yes, FM8 does have the equivalent
of uni-dimensional arrays.

FM8 allows you to specify repetitions of a variable so that, in effect,
you have an array. You can set variables with repetitions using the Set
Variable script step, or by using the Let() function in a variety of
places. For example:

Let([repetition = 9; $variable[repetition] = value ];
"The result might be " & $variable[repetition] & " or " $variable[2] )


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Schlossberg (818) 883-2846
FM Pro Solutions Los Angeles, California

FileMaker 7 Certified Developer
Associate Member, FileMaker Solutions Alliance


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.