Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Can I use the name name of a field to access its contents

Featured Replies

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.

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

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.

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! wink.gif

-bd

Sometimes I have way too much time on my hands.

  • 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.

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

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.