Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7493 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I am trying to get the first 40 records of the field "id" into a new field "id_numbers". I bulit a script to do this with loop and set field for id_numbers but I do not know how to script or define a calculation that would take the first 40 records and put it into a new field then grab the next 40 records and put it into the next id_numbers record. I have been trying the omit multiple and then delete all records but how to get the 40 records into the one record is beyond my FMP level. Any help would be greatly appreciated. Thank you

Posted

What do you mean, "get the 40 records into the one record" -- you mean you want the contents of ALL the fields into one field in one record? Or just the id_number? Or you want e.g. every record's field A into a single record's field A, every record's field B into a single record's field B, etc. ? Are we talking about just two groups of 40, or an indeterminite number? Are you doing this all in one file or multiple files? What's the ultimate goal?

Posted

FItch,

Sorry for the vague question. First of all Im using one file. I only want to extract the "id" field from the first 40 records, then the id field from the next 40 records starting with record 41 looping until all the records have been gone through. The script holds the 40 records in a text field called id_numbers. The goal is to export all the id_numbers fields so that I can create a html doc that has static links to each of my records broken up by each id_numbers field. This would create individual files that have 40 links each to keep the file size below 20k. I hope this helps clear up my question.

Posted

Here is a method to put the id's of each group of 40 records into a field in the 40th record of each group. If there are fewer than 40 in the last group, the last record is set with the remainder:

First create a global field, gText.

In this Script, "P" means a paragraph symbol, or it could be a comma or whatever you want:

Loop

. Set Field ( gText, gText & "P" & ID )

. If ( PatternCount( gText, "P" ) > 39 )

. . Set Field ( id_numbers, Right( gText, Length( gText ) - 1 )

. . Set Field ( gText, "" )

. End If

. Go to record (Next, Exit after last)

End Loop

Set Field ( id_numbers, Right( gText, Length( gText ) - 1 )

Set Field ( gText, "" )

Posted

What's behind all this? What are you really trying to accomplish?

Posted

What I am trying to accomplish is to export all the id_numbers fields so that I can create multiple html docs that have 40 static links one for each record.

  • 2 weeks later...

This topic is 7493 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.