dbTalk Databases Forums  

Repeating Fields How to get to the next cell in a script

comp.databases.filemaker comp.databases.filemaker


Discuss Repeating Fields How to get to the next cell in a script in the comp.databases.filemaker forum.



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

Default Repeating Fields How to get to the next cell in a script - 08-10-2003 , 01:39 AM






I read in many of these discussions not to use the repeating field
option.

But I'm thinking of a repeating field as an Array. I have a field
that is a text time repeating field (TTRF) that is empty. The reason
for the TTRF is to have a field with a range of time and with this I
can search to see if a time is in that field.

So, I have two fields with pulldown menus, start time (ST) and end
time (ET) The data on the ST and ET are 8:00 AM, 8:30 AM, 9:00 AM,
9:30 AM....8:30 PM. The time interval are 30 minutes. I would like
a script to copy the ST to the TTRF then fill the TTRF until ET. But,
I can't seem to get started. I don't know how to get to the next
empty field in the TTRF. I try something like:

setfield["TTRF", "ST)"]
setfield["TTRF", "ET)"]

This doesn't work, for the results are still on the first cell of the
TTRF. How do I get to the next empty cell in the TTRF? And when I
figure that out, how does the script know when to stop till the ET
time.

I really don't want to use a text field to represent hours as 1700,
for I have all my scripts using time fields.

Any suggestions, any thing to get started, even how to get to the next
empty field in the TTRF!

thx

Reply With Quote
  #2  
Old   
Bridget Eley
 
Posts: n/a

Default Re: Repeating Fields How to get to the next cell in a script - 08-10-2003 , 02:57 AM






Use a related file instead. Here is the script (ensure that relationship is
set to allow creation of related records):

If [ not IsEmpty(ST) and not IsEmpty(ET) and ET > ST ]
Set Field [ gST, ST ]
Set Field [ gET, ET ]
Loop
Go to Portal Row [ Last, Select entire contents ]
Set Field [ Relationship::TimeField, gST ]
Set Field [ gST, gST + 1800 ]
Exit Loop If [ gST > (gET - 1800) ]
End Loop
Else
Beep
End If

(where g designates a global time field and 1800 = number of second in a
half hour)

Bridget Eley


in article 100820031915010855%helpful_harry (AT) nom (DOT) de.plume.com, Helpful Harry
at helpful_harry (AT) nom (DOT) de.plume.com wrote on 10/8/03 5:15 PM:

Quote:
In article <326151f6.0308092239.1f82b2af (AT) posting (DOT) google.com>,
fsromero (AT) hotmail (DOT) com (Cylurian) wrote:

I read in many of these discussions not to use the repeating field
option.

But I'm thinking of a repeating field as an Array.

Tecnically they are a one-dimensional array, but they cause headaches
and problems (partly due to bugs in FileMaker itself), and FileMaker
Inc. basically keeps them in to retain compatibility with older files -
it's best not to use them.

If you want an array, perhaps use a suite of fields,
eg. 1-dimensional array = MyArray1, MyArray2, MyArray3, etc.

2-dimensional array = MyArray11, MyArray12, MyArray13, etc.
MyArray21, MyArray22, MyArray23, etc.
etc.



I have a field that is a text time repeating field (TTRF) that is
empty. The reason for the TTRF is to have a field with a range of
time and with this I can search to see if a time is in that field.

So, I have two fields with pulldown menus, start time (ST) and end
time (ET) The data on the ST and ET are 8:00 AM, 8:30 AM, 9:00 AM,
9:30 AM....8:30 PM. The time interval are 30 minutes. I would like
a script to copy the ST to the TTRF then fill the TTRF until ET. But,
I can't seem to get started. I don't know how to get to the next
empty field in the TTRF. I try something like:

setfield["TTRF", "ST)"]
setfield["TTRF", "ET)"]

This doesn't work, for the results are still on the first cell of the
TTRF. How do I get to the next empty cell in the TTRF? And when I
figure that out, how does the script know when to stop till the ET
time.

I really don't want to use a text field to represent hours as 1700,
for I have all my scripts using time fields.

Any suggestions, any thing to get started, even how to get to the next
empty field in the TTRF!

If you really want to use repeating fields, then take a look at the
bottom of the window where you choose the field for the Set Field
command (and others). There, next to the Define Fields button, you'll
see an option to specify which repitition to use. If you type in a 2
then the second repitition will be used and the script step will read
as:

Set Field ["TTRF"-2, "ST)"]
Set Field ["TTRF"-3, "ET)"]

where the -x lets you know which repitition is being used.

Unfortunately there's no easy way (as of FileMaker 5.5) to Set Field a
particular repitition X, where X is the value from another field - this
is one of the many problems in using them.
ie. you can't just Set Field ["TTRF"-X, "ST)"]

There's also a bad bug in FileMaker which means that you can't use a
command like:

Set Field ["RepeatFieldA"-3, Get Repitition("RepeatFieldB", "4")]

Instead you have to use a temporary field as a go between,
ie.
Set Field ["TempField", Get Repitition("RepeatFieldB", "4")]
Set Field ["RepeatFieldA"-3, "TempField"]

\



Helpful Harry
"Just trying to help whenever I can." )


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.