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.

String in a Field Name

Featured Replies

  • Newbies

Hi.

 

I have 12 fields with the names Phone1, Phone2, Phone3, ....  I have go through each and do some work on it.  Obviously, I don't want to recreate the same procedure 12 times.  I like to use the field by the count I'm on.

 

Here's the start of the code:

 

set variable [$PHCount; Value: 0 ]

Loop

set variable [$PHCount; Value: $PHCount + 1 ]

 

##### here I'd to set a variable to field Phone and whatever $PHCount is on

##### so if $PHcount is equal to 1 the variable is equal to Phone1

 

End Loop

 

TIA.

 

Boyd

The Phone fields should be separate records in a related table.  That table should contain the fields ID (auto entered serial number), MainID, and Phone.  It should be related to your main table by MainTable::<yourIDfield> = Phones::MainID. Your script would then be:

 

Freeze Window

Go to Related Records[show only related records; From table::Phones;Using layout:Phones]

Go to Record[first]

Loop

#perform your operation

Go to Record[next; Exit after last]

End Loop

  • Author
  • Newbies

Doug:

 

Thanks for the tip.  Not exactly what I did, though.  I decided using a repetition field made a lot more sense.

 

Thanks.

 

Boyd

 I decided using a repetition field made a lot more sense.

 

 

You may change your mind if a) you ever have to create a report based on those phone numbers ("how many are in Area Code 212?") or b ) you have a record with a 13th phone number.

  • Author
  • Newbies

Doug:

 

Deinitely.  But, this was a case of where I ws importing a flat file with multiple phone numbers.  In fact, it was a labeled phone numbers, but had phones and emails in it.  I just needed to massage the data and export it right out.

 

Thanks.

 

Boyd

And if they had been separate records then you would have just performed a simple find operation to separate the email records from the phone records. 

##### here I'd to set a variable to field Phone and whatever $PHCount is on

##### so if $PHcount is equal to 1 the variable is equal to Phone1

 

GetField ( "Phone" & $PHCount )

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.