Page 1 of 1

Scripting an Indirect Reference

PostPosted: Mon Nov 21, 2005 4:46 am
by Jerry
I’ve run across a perplexing little stumbling block in FileMaker. It seems like there ought to be a simple solution, but I can’t quite see it.

Here’s the question: Suppose I have a table with the following three fields:

Field X Text
gField Name Text Global
gField Value Text Global

Assume that "gField Name" contains the string “Field X” and
"gField Value" contains the string “ABC” :)

Is there a way through scripting to update the field specified in the global variable “gField Name” (currently containing the value “Field X”) with the value specified in the global variable “gField Value” (currently containing the value “ABC”)?

In other words, I want to update a field (“Field X “) that is specified by the contents of another field (“gField Name”). Any thoughts on implementing this "indirect reference"?

Cheers,

Jerry

Need one layout also...

PostPosted: Mon Nov 21, 2005 5:07 am
by Court Bowman
Jerry,

There is, but you need one more element you didn't mention. A layout with all the fields in the given table on it.

You can then loop through all the fields with "Go To Next Field" script step. Test, and when you land on the field you want, paste a calculated result.

Hope this is clear, and helpful. Let me know if it isn't.

If anyone else can come up with another solution, I'd love to hear a better way to do this.

Court