K1200 Posted May 4, 2011 Posted May 4, 2011 The following 3-step sequence is from a script that had worked for months. It simply populates a repeating field that holds working parameters. But this week I was blindsided by a change in its behaviour that took me hours to isolate and rectify. Even though I've restored the script’s operation, I can find no clear (i.e., documented) explanation of the root cause. Set Field [ Table::Param ; Base::FieldA ] Set Field [ Table::Param[2] ; Base::FieldB ] Set Field [ Table::Param[3] ; Base::FieldC ] But then I changed Init::FieldC to be a repeating field of 3 occurences (a push-down stack, actually -- used to hold prior values). A major runtime process started producing inapproriate results. Since this was a field-proven code, it took me a while to even look at these steps as suspect. The clue, however, was that Param[3] was being set to one of the prior values. I restored proper operation with the following: Set Variable [ $Value ; Base::FieldC ] Set Field [ Table::Param ; Base::FieldA ] Set Field [ Table::Param[2] ; Base::FieldB ] Set Field [ Table::Param[3] ; $Value ] As an experiment, I set the third entry to: Set Field [ Table::Param[3] ; Base::FieldC[1] ] ... and it worked properly, as well. I've concluded that when the Init field was extended to 3 occurences, the Set Field picks up the third value when no index is specificed. BTW, all of these fields are defined as text fields. So I ask: Is this a known syntax rule? ... or a feature? ... or a bug? If it is a rule, are there corresponding rules for If statements? -- or can "no index" still be used to specify the first value? Thanks in advance for any help.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now