February 1, 200125 yr I would like to test the contents of each field in a layout. I can get the names of the fields by using the FieldNames function. I can separate them out in sequence. But then I am stuck about how to use those names to access the contents of each field.
February 2, 200125 yr There is no way to use the field name as a variable. You will need to explicitly test each field. What are you trying to do? There is probably a different way to do it in FM. Some of the classical programming thinking doesn't really apply to FM. -bd
February 2, 200125 yr There is actually a rather convoluted way to do this using a script. It involves going from field to field and checking the current field name. Like so: code: Set Field [gFieldCount, 1] Go to Field [AnyField] Loop If [(Status(CurrentFieldName)=gSearchFieldName)] Copy[] Paste[gResult] Exit Loop If [1] End If Set Field [gFieldCount, gFieldCount + 1] Exit Loop If [(gFieldCount > 20)] Go to Next Field End Loop If you enter the name of a field into gSearchFieldName and then run the script, that field's contents will be pasted into gResult.
February 2, 200125 yr I can think of an even more convoluted way of doing it with "copy all records", BUT I'm guessing that this whole need is based upon an approach to the problem that needs to be altered! -bd
February 2, 200125 yr Author quote: Originally posted by LiveOak: There is no way to use the field name as a variable. You will need to explicitly test each field. What are you trying to do? There is probably a different way to do it in FM. Some of the classical programming thinking doesn't really apply to FM. -bd I am trying to get the contents of the current set of find requests and put them into a global text field in the header of a column layout. This kind of information is available on printouts of scripts but I cannot find a way to make it easily accessible to users. I want to cycle through the fields of the request set and put the contents of the non-blank fields into a text field.
February 2, 200125 yr The usual way to approach this is to have the user enter find requests into global fields in Browse mode. Then the informatin is already available for display, use in report titles, etc. The script transfers to Find mode and fills the actual request fields. With creative scripting you can implement everything that you can enter in find mode with this approach. -bd [This message has been edited by LiveOak (edited February 02, 2001).]
Create an account or sign in to comment