The FieldNames function will give you a list of all fields on a layout. There is a similar way to get a list of all fields in a table using ExecuteSQL. It is slightly different than looping over records. I'm not sure what you're trying to accomplish but it sounds like you're just trying to go through each field on a layout so this should work. You will have to loop through the list using a counter and GetValue, then read the value using GetField function and set values using Set Field By Name. Unfortunately this cannot be combined with Go to Field as there is no way to specify a field name by calculation in that script step.
Hope this helps.
Thanks for the prompt answer. I never expected to find something in the design area. With the help of your suggestions i think i will manage; your 'unfortunately' remark should be a message for Filemaker. However, thanks a lot!
If you are on a layout and want to go to a specific field, give it an object name and use Go To Object script step.
So what is it you are trying to do with your script? For Set Field or Set Field by name, the field does not have to appear on the layout. In cases were I have to do fair amount of work on a record or a large record set, I'll use a blank layout. This speeds up processing time and can reduce the amount of data FileMaker server sends to the client.
fieldnames(Get ( FileName ); Get ( LayoutName )) will return you the names of fields that are in tabs and popovers, too.
Maybe you don't want that to happen...
It's important to know - as other contributors have pointed out - what your goal is. You might be better served with exporting the record, specific fields, for example.
Fields don't have a natural order, they're just fields. You may be trying to use a layout to set that order, and loop through the fields on a layout, but that's not really how FM works.
So many reactions, beautiful, thanks.
The functionality i was looking for, ist quite simple. In my case, i was not thinking in 'views' or 'layouts'. On source-basis (see the table-relations scheme), a table is a 2-level matrix holding data, that can be worked on. On 'record' level -vertically- Filemaker offers adequate looping functions; why not on horizontal 'field' level too?
Thanks to you all, I guess how i should address my 'problem' in an Apple way. The actual discussion may be closed.