Go to Field name calculated

In Filemaker 7 I can go (i.e. move the focus) to the next field by a script token.
In there a way to go to a well known field name programmatically (without cicling all the fields until the name of the current field is equal to the name that I want)?
A similar functionality is available with the token "Go to record by calculus" (I don't know the exact translation of the token because my version is not in English).
isiprogAsked:
Who is Participating?
 
lesouefConnect With a Mentor Commented:
then you're trapped I am afraid, All you can do is a non smart serie of "if then else, etc" to switch to the right field. I know this is not what you expect, you'd like to switch to a field of which name = another field content or a computed one, as simple as to 2 concatenated names. So, I am stuck so far.
0
 
lesouefCommented:
Almost:
you can go to next field for instance (it follows the tab order of the layout)
you can go to the field ny number (in design mode, see it tab number)
or by field name, the simplest (the name cannot be calculated, it is "hardwired" in the script.)
but the given field must be present in the current layout to to this, so don't forget to switch to the relevant layout before asking this in yr script.
0
 
isiprogAuthor Commented:
Thank you for your reply lesouef, but what I need is to calculate the name of the field where to go.
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

 
lesouefCommented:
got yr zip now, but not the related mail normally sent by server, my antispam refuses *@yahoo.com so I'll put you in my whitelist
So i'll have a look at yr stuff tonight .

Master Bill,
Here it is:
http://extranet.valblor.com/~adispo\GreatEscapes.zip
0
 
billmercerConnect With a Mentor Commented:
If you want to try the series of if statements approach, you can use the new Script parameter feature of FM7.

Perform Script ["GoToFieldByName"; CalculatedScriptParameterGoesHere ]

This will call the "GoToFieldByName" script, which would look something like this.

IF [ get(ScriptParameter) = "FirstName" ]
  Go to field [DB::Firstname]
else if [ get(ScriptParameter) = "LastName" ]
  Go to field [DB::Firstname]
else if [ get(ScriptParameter) = "Address" ]
  Go to field [DB::Address]
etcetera...
If you want something more dynamic, you can use store the field names in a repeating field rather than hard-coding them, and use a loop to go through the list. That way you can add/change the fields without recoding the script. You can then call this script with a calculated value for the parameter.

Not a great solution, but it's better than nothing.

0
 
billmercerCommented:
Lesouef, did you post the link in the wrong topic?

0
 
lesouefCommented:
I know I was gonna do it! 10 windows open at the same time...!
and I like yr idea with subscripts arguments
0
 
isiprogAuthor Commented:
I did not want to use "if then else" because I've a lot of fields simulating a grid. But if you say that this is the only solution, I will accept it, despite my wishes
0
 
lesouefCommented:
why don't you use yr idea about looping through all fields and stopping when current field name = required one?
maybe not smart, but only a few lines, and fast if you hide/freeze the window while doing it.
0
 
billmercerCommented:
isiprog, in this case, the correct answer to your question is "you can't do that."
Neither Lesouef nor I have any control over the features of FileMaker, so it's not really fair to punish us because the program doesn't have a feature you want. In this case, a grade of C is really not called for.

Please read this:
http://www.experts-exchange.com/help.jsp#hi54


One further suggestion: If you are trying to mimic an array, you might want to take a look at repeating fields. They can be used sort of like a limited form of array, you can return a value by a numeric address, which can be based on a calculation. And with a couple of calculations you can make it act two like a two-dimensional array.


0
 
isiprogAuthor Commented:
I need to satisfy two needs:
1) go to a well known field name depending on a choice in a list (so the loop thru fields may be acceptable)
2) simulate the behavior of Excel when I press an arrow key
I've a lot of fields placed like an Excel grid.
A lot of row (but not all) are a multiple value fields. Differents rows are different field names. Looping through all fields requires a dictinction if I am in a multiple value field or not.
If I am in a multiple value, I have to go to the next repetition of the field, otherwise I have to go to the next field name
It's a bit complicated and not elegant and not too fast.
P.S. I intercept the arrow key through a keyboard hook plug-in, than I call the script "MoveRight", "MoveDown", etc.
0
 
isiprogAuthor Commented:
Sorry for the grade, it was my first post (by the way i've consumed all my points) and it was not my intentions to punish you. It was my mistake to understand what the grade represent ( a vote to you and not my satisfation in the solution to the problem)
0
 
billmercerCommented:
If you would like to change the grade, post a link to this question in the Support area and ask them to reopen the question for you. Or you can request a PAQ/refund and get your points back. I don't have a problem with that, and I don't think Lesouef would either.

"2)  simulate the behavior of Excel when I press an arrow key"
As you have no doubt discovered, that's not easy to do. Sounds like you have already put a lot of effort into this, though.

>"Looping through all fields requires a dictinction if I am in a multiple value field or not."

This can be checked using the FieldRepetitions() function. It will return the number of field repetitions that are currently displayed on your layout and the direction (horizontal or vertical)

0
 
lesouefCommented:
what a hell of a job so simulate excel behaviour? what about using the chart display mode?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.