Text Field -> Repeating Calculation (Text) Field 
Author Message
 Text Field -> Repeating Calculation (Text) Field

Hi All,

Just looking for suggestions, directions... whatever you can offer.

I have a text field, which always contains 23 characters
("t_MicrofilmRefNo")
I have a repeating text field, with 23 repetitions
("tr_MicrofilmRefNo").

I need to break t_MicroFilmRef into individual characters and place them
in their corresponding repetition.
I have used a Script to do this, but I was wondering whether a Repeating
Calculation could help...

Any suggestions on syntax, or whether it will work?

I tried Middle(t_MicrofilmRefNo, Status(CurrentRepetitionNumber), 1) but
that didn't work.

Thanks
Luke



Tue, 28 Sep 2004 11:47:09 GMT
 Text Field -> Repeating Calculation (Text) Field

Define a global repeating field (number) called gRepetitionNo with 23
repetitions and manually enter the correct repetition number in each
repetition.

Now you can set your repeating tr_MicrofilmRefNo to be a calc =
        middle(extend(t_MicrofilmRefNo), gRepetitionNo, 1)

Quote:

> Hi All,

> Just looking for suggestions, directions... whatever you can offer.

> I have a text field, which always contains 23 characters
> ("t_MicrofilmRefNo")
> I have a repeating text field, with 23 repetitions
> ("tr_MicrofilmRefNo").

> I need to break t_MicroFilmRef into individual characters and place them
> in their corresponding repetition.
> I have used a Script to do this, but I was wondering whether a Repeating
> Calculation could help...

> Any suggestions on syntax, or whether it will work?

> I tried Middle(t_MicrofilmRefNo, Status(CurrentRepetitionNumber), 1) but
> that didn't work.

> Thanks
> Luke

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Schlossberg              (818) 321-5176
FM Pro Solutions       Los Angeles, California
Associate Member, FileMaker Solutions Alliance


Tue, 28 Sep 2004 12:14:59 GMT
 Text Field -> Repeating Calculation (Text) Field
Hi Howard,

Thanks for the reply.

At present, I have a Script which runs something like:
SetField ["tr_MicrofilmRefNo"; "Middle(t_MicrofilmRefNo, 01, 1)"]
SetField ["tr_MicrofilmRefNo", -2; "Middle(t_MicrofilmRefNo, 02, 1)"]
SetField ["tr_MicrofilmRefNo", -3; "Middle(t_MicrofilmRefNo, 03, 1)"]
SetField ["tr_MicrofilmRefNo", -4; "Middle(t_MicrofilmRefNo, 04, 1)"]
etc...

I did try and use a Global Number to increment the Start Position for the
Middle function, but, as the Repetition number of the field to set cannot be
a calculated value, nor the value from a field, this was actually more labour
intesive than manually incrementing both the repetition number and the start
position when writing the script.

What I was looking for was a function that I could set the Repeating Field
with, whereby each repetion would grab the character that relates to them.
i.e. Create "cr_MicrofilmRefNo" (c = Calculation)
Have Repetition 1 take character 1 of t_MicrofilmRefNo,
Have Repetition 2 take character 2 of t_MicrofilmRefNo,
Have Repetition 3 take character 3 of t_MicrofilmRefNo, etc.

My other (dreaded) option is to use individual calculated field for each
character, rather than a repeating field.
I would rather use a repeating field though, simply for ease of use, and to
avoid cluttering the solution.
Another reason for the repeating fields is that I am using this database to
fill out forms, which have those character boxes for the user to write in
each number/character., and a repeating field, with borders on all sides but
the top, looks just like them.

Anyway, has anyone seen a function that can do this?
(Unless I get a script that actually goes from repetition to repetition and
uses the Status(CurrentRepetition) function, and Paste Calculated....)

Quote:

> Define a global repeating field (number) called gRepetitionNo with 23
> repetitions and manually enter the correct repetition number in each
> repetition.

> Now you can set your repeating tr_MicrofilmRefNo to be a calc =
>         middle(extend(t_MicrofilmRefNo), gRepetitionNo, 1)


> > Hi All,

> > Just looking for suggestions, directions... whatever you can offer.

> > I have a text field, which always contains 23 characters
> > ("t_MicrofilmRefNo")
> > I have a repeating text field, with 23 repetitions
> > ("tr_MicrofilmRefNo").

> > I need to break t_MicroFilmRef into individual characters and place them
> > in their corresponding repetition.
> > I have used a Script to do this, but I was wondering whether a Repeating
> > Calculation could help...

> > Any suggestions on syntax, or whether it will work?

> > I tried Middle(t_MicrofilmRefNo, Status(CurrentRepetitionNumber), 1) but
> > that didn't work.

> > Thanks
> > Luke

> --
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Howard Schlossberg              (818) 321-5176
> FM Pro Solutions       Los Angeles, California
> Associate Member, FileMaker Solutions Alliance



Wed, 29 Sep 2004 07:19:26 GMT
 Text Field -> Repeating Calculation (Text) Field
<< Anyway, has anyone seen a function that can do this? >>

Luc,

Howard was on the money before. What he was talking about was creating a road
map for your repeater calc. Personally, if the repeater is going to remain as a
calc, I'd create the equivalent of Howard's global repeater, as a regular
number field repeater, and look it up to itself, so each record remains
independent. I call this "Index", so Howard's calc for "tr_MicrofilmRefNo"
becomes:

Middle(Extend(t_MicrofilmRefNo), Index, 1)

this is the field definition, not a script step. Populate Index with its
corresponding rep number; 1, 2, 3,...etc. in the first record, and make it a
lookup based on a constant relationship in the file (the same field to itself
on both sides). If the repeater need to be editable for some reason, you can
use an auto enter calc based on the same calculation, just add an extra
condition trigger for safe keeping.

If you want to script it, set the tab order down the reps, and then:

Go to Field, ("tr_MicrofilmRefNo")
Set Field, ("", [ Middle(Extend(t_MicrofilmRefNo),
Status(CurrentRepetitionNumber), 1) ] )
Loop
Go to Next Field
Exit Loop If (Status(CurrentFieldName) <> "tr_MicrofilmRefNo")
Set Field, ("", [ Middle(Extend(t_MicrofilmRefNo),
Status(CurrentRepetitionNumber), 1) ] )
End Loop

The first argument in the SetField means no field is selected, only the Middle
calc is used in the specify box. It's pretty straight forward once you
understand how FMP maps repeaters. Good luck.

Sincerely,

        Roger E. Grodin
        REDWING FINANCIAL GROUP
        "Where OUR business is the ultimate database for YOUR business"

        ==========================================================



Wed, 29 Sep 2004 10:24:32 GMT
 Text Field -> Repeating Calculation (Text) Field
I was thinking that your tr_MicrofilmRefNo would be a calc repeater
field, so that you wouldn't need the script...unless thee's some reason
why you need it to be a text repeater.

Quote:

> Hi Howard,

> Thanks for the reply.

> At present, I have a Script which runs something like:
> SetField ["tr_MicrofilmRefNo"; "Middle(t_MicrofilmRefNo, 01, 1)"]
> SetField ["tr_MicrofilmRefNo", -2; "Middle(t_MicrofilmRefNo, 02, 1)"]
> SetField ["tr_MicrofilmRefNo", -3; "Middle(t_MicrofilmRefNo, 03, 1)"]
> SetField ["tr_MicrofilmRefNo", -4; "Middle(t_MicrofilmRefNo, 04, 1)"]
> etc...

> I did try and use a Global Number to increment the Start Position for the
> Middle function, but, as the Repetition number of the field to set cannot be
> a calculated value, nor the value from a field, this was actually more labour
> intesive than manually incrementing both the repetition number and the start
> position when writing the script.

> What I was looking for was a function that I could set the Repeating Field
> with, whereby each repetion would grab the character that relates to them.
> i.e. Create "cr_MicrofilmRefNo" (c = Calculation)
> Have Repetition 1 take character 1 of t_MicrofilmRefNo,
> Have Repetition 2 take character 2 of t_MicrofilmRefNo,
> Have Repetition 3 take character 3 of t_MicrofilmRefNo, etc.

> My other (dreaded) option is to use individual calculated field for each
> character, rather than a repeating field.
> I would rather use a repeating field though, simply for ease of use, and to
> avoid cluttering the solution.
> Another reason for the repeating fields is that I am using this database to
> fill out forms, which have those character boxes for the user to write in
> each number/character., and a repeating field, with borders on all sides but
> the top, looks just like them.

> Anyway, has anyone seen a function that can do this?
> (Unless I get a script that actually goes from repetition to repetition and
> uses the Status(CurrentRepetition) function, and Paste Calculated....)


> > Define a global repeating field (number) called gRepetitionNo with 23
> > repetitions and manually enter the correct repetition number in each
> > repetition.

> > Now you can set your repeating tr_MicrofilmRefNo to be a calc =
> >         middle(extend(t_MicrofilmRefNo), gRepetitionNo, 1)


> > > Hi All,

> > > Just looking for suggestions, directions... whatever you can offer.

> > > I have a text field, which always contains 23 characters
> > > ("t_MicrofilmRefNo")
> > > I have a repeating text field, with 23 repetitions
> > > ("tr_MicrofilmRefNo").

> > > I need to break t_MicroFilmRef into individual characters and place them
> > > in their corresponding repetition.
> > > I have used a Script to do this, but I was wondering whether a Repeating
> > > Calculation could help...

> > > Any suggestions on syntax, or whether it will work?

> > > I tried Middle(t_MicrofilmRefNo, Status(CurrentRepetitionNumber), 1) but
> > > that didn't work.

> > > Thanks
> > > Luke

> > --
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > Howard Schlossberg              (818) 321-5176
> > FM Pro Solutions       Los Angeles, California
> > Associate Member, FileMaker Solutions Alliance

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Schlossberg              (818) 321-5176
FM Pro Solutions       Los Angeles, California
Associate Member, FileMaker Solutions Alliance


Wed, 29 Sep 2004 12:28:00 GMT
 Text Field -> Repeating Calculation (Text) Field
Gentlemen,

At last, the light has clicked on above my head, and I have finally understood the
logic behind your solution.

I did exactly as Howard suggested initially (but I was either too tired, or too
ignorant to understand at the time) and it is working perfectly.
Add to that the fact that the Repetition Index means that I can use the same
format for the other fields I was wanting to perform the same extrapolation on.

Thank you, Howard & Roger(Redwing), for your patience in helping me with this
issue.

Luke

Quote:

> I was thinking that your tr_MicrofilmRefNo would be a calc repeater
> field, so that you wouldn't need the script...unless thee's some reason
> why you need it to be a text repeater.


> > Hi Howard,

> > Thanks for the reply.

> > At present, I have a Script which runs something like:
> > SetField ["tr_MicrofilmRefNo"; "Middle(t_MicrofilmRefNo, 01, 1)"]
> > SetField ["tr_MicrofilmRefNo", -2; "Middle(t_MicrofilmRefNo, 02, 1)"]
> > SetField ["tr_MicrofilmRefNo", -3; "Middle(t_MicrofilmRefNo, 03, 1)"]
> > SetField ["tr_MicrofilmRefNo", -4; "Middle(t_MicrofilmRefNo, 04, 1)"]
> > etc...

> > I did try and use a Global Number to increment the Start Position for the
> > Middle function, but, as the Repetition number of the field to set cannot be
> > a calculated value, nor the value from a field, this was actually more labour
> > intesive than manually incrementing both the repetition number and the start
> > position when writing the script.

> > What I was looking for was a function that I could set the Repeating Field
> > with, whereby each repetion would grab the character that relates to them.
> > i.e. Create "cr_MicrofilmRefNo" (c = Calculation)
> > Have Repetition 1 take character 1 of t_MicrofilmRefNo,
> > Have Repetition 2 take character 2 of t_MicrofilmRefNo,
> > Have Repetition 3 take character 3 of t_MicrofilmRefNo, etc.

> > My other (dreaded) option is to use individual calculated field for each
> > character, rather than a repeating field.
> > I would rather use a repeating field though, simply for ease of use, and to
> > avoid cluttering the solution.
> > Another reason for the repeating fields is that I am using this database to
> > fill out forms, which have those character boxes for the user to write in
> > each number/character., and a repeating field, with borders on all sides but
> > the top, looks just like them.

> > Anyway, has anyone seen a function that can do this?
> > (Unless I get a script that actually goes from repetition to repetition and
> > uses the Status(CurrentRepetition) function, and Paste Calculated....)


> > > Define a global repeating field (number) called gRepetitionNo with 23
> > > repetitions and manually enter the correct repetition number in each
> > > repetition.

> > > Now you can set your repeating tr_MicrofilmRefNo to be a calc =
> > >         middle(extend(t_MicrofilmRefNo), gRepetitionNo, 1)


> > > > Hi All,

> > > > Just looking for suggestions, directions... whatever you can offer.

> > > > I have a text field, which always contains 23 characters
> > > > ("t_MicrofilmRefNo")
> > > > I have a repeating text field, with 23 repetitions
> > > > ("tr_MicrofilmRefNo").

> > > > I need to break t_MicroFilmRef into individual characters and place them
> > > > in their corresponding repetition.
> > > > I have used a Script to do this, but I was wondering whether a Repeating
> > > > Calculation could help...

> > > > Any suggestions on syntax, or whether it will work?

> > > > I tried Middle(t_MicrofilmRefNo, Status(CurrentRepetitionNumber), 1) but
> > > > that didn't work.

> > > > Thanks
> > > > Luke

> > > --
> > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > Howard Schlossberg              (818) 321-5176
> > > FM Pro Solutions       Los Angeles, California
> > > Associate Member, FileMaker Solutions Alliance

> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Howard Schlossberg              (818) 321-5176
> FM Pro Solutions       Los Angeles, California
> Associate Member, FileMaker Solutions Alliance



Fri, 01 Oct 2004 04:49:28 GMT
 
 [ 6 post ] 

 Relevant Pages 

1. need to align a single text field with a repeating Number field

2. <beginner> Text field calculations/summaries

3. Can calculation fields be repeating fields?

4. I need to get all values of Repeating field from calculation fields

5. Problem with updating from TEXT field into TEXT field

6. SQL Query problem concat text field from mulitple rows into one text field

7. Webpage won't show text field but will show calc of text field

8. Exporting repeating text fields

9. Counting entries in repeating text field?

10. Text Calculation field modifiable?

11. Formatted text in a calculation field

12. Text Attributes in calculation field and export to MS Word


 
Powered by phpBB® Forum Software