July 19, 201114 yr Good morning. I am building a sports league results listing with a large number of teams. I am trying to use a variable in 'Set Field By Name' to write another variable into a field. My field is a repeating field i.e. MayGro[1]. I use a routine to calculate the first 6 letters of the field name which I call $homeaway and then append the repetition number. My line looks something like - Set Field By Name [$homeaway & "[1]" ; $r1] (where $r1 is a variable holding the home team's points for this game). It doesn't work. I am a real novice at Filemaker and am hoping that someone will be able to see where I am going wrong. Also why does the 'value' step in the Set Variable routine say that the 'Calculated value must be text' although the value I am using is definitely a number. Many thanks Graham Keeley
July 19, 201114 yr Author Hi I've done some reading and it would appear that it's not possible to use a variable in the 'Set Field By Name' script step. What a shame, will turn what was a short script into a very lengthy one. Cheers Graham Keeley
July 19, 201114 yr My line looks something like - Set Field By Name [$homeaway & "[1]" ; $r1] That should work - so most likely, you're not calculating the field name correctly. However, I would suggest - no, make that strongly suggest - you use records in a related table instead of repeating fields. When it comes to sorting and summarizing, repeating fields are impossible to work with. Also why does the 'value' step in the Set Variable routine say that the 'Calculated value must be text' although the value I am using is definitely a number. That's a good question.
July 19, 201114 yr I've done some reading and it would appear that it's not possible to use a variable in the 'Set Field By Name' script step. Get better reading material...
July 19, 201114 yr Author Hi again Well I seem to have cracked it. i have added the table name and the line now looks like this Set Field By Name ["Results_Table::" & $homeaway & "[2]" ; $r2] and that does the trick. Cheers to anyone that looked at the problem. Thanks Graham Keeley
Create an account or sign in to comment