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

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

Recommended Posts

Posted

Hi all,

Since I gleaned so much useful info from the terrific responses from forum members in my Local Vs. Global Variables topic, I was hoping to gain some more knowledge on the topic of repetitions in script variables.

Basically what I'd like to know is if anyone is using this feature, and why. Are repetitions of variables any more (or less) useful than repetitions of fields? I was actually a bit surprised to see repetitions as an option when FM8 introduced script variables, considering the already limited use of field repetitions by many experienced developers. After I "discovered" field repetitions and went through the "wow, look how you can write an entire solution with one field" stage (and then abruptly found myself painted into a corner), I find myself using field repetitions for very few things outside of storing graphics (which obviously won't work in variables).

So, what's the deal? I'm interested in hearing anyone's take on this subject!

Thanks in advance!

Posted

reps in variables are immensely valuable. It's as close to arrays you can get in FileMaker. Arrays are collections of similar data. Instead of declaring a bunch of variables, each one to store a record ID for instance, you can declare one variable with many reps for it.

A cool fact about variable reps is that they can be non-continuous: they don't need a value for each repetition. You can have

myVar[1] = someValue

myVar[3] = someOtherValue

and myVar[2] without any value at all

Posted

Thanks for the reply, Wim!

One thing I think I'm getting from your response is that the number of repetitions in variables isn't static (as compared to a predefined number of repetitions for fields). So, to use your example, if recordID's need to be stored in a variable, the number of repetitions can be defined on the fly with a calculation without ever worrying about exceeding the limit of predefined repetitions.

Is that assessment accurate?

This topic is 6908 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.