Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script step to insert 'date' into next space of a repeating field

Status
Not open for further replies.

davidmelville

Technical User
Jan 27, 2005
3
0
0
GB
I need to insert the current date into the next step of a repeating field.
I can insert text into the field but it overwites the first repeat, I need it to go to the first empty repeat and insert the current date.

Help appreciated!
 
This will work in lower than 7, maybe also in FM7, or with minor changes, the technique is the same:

You need a script to 'find' the first empty repetition.
This can be done by bringing the script in a loop to find the first empty rep field.
If you script the insert for your date, you need something along these lines:

Script 'Find first empty repetition'.

Go to field (your repetitionfield)
Loop
Exit Loop If (IsEmpty(GetRepetition(Repeating; Status(CurrentRepetitionNumber))) or FieldRepetitions(Status(CurrentFileName); Status(CurrentLayoutName); Status(CurrentFieldName)) = Status(CurrentRepetitionNumber)
Go to next field
End loop

See what this can do for you, where you end up (in which field) and add your insert date step.

Substitute the FM6 statusfunctions by the FM 7 statusfunctions if needed.
HTH

JW
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top