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.

Add 1 to a field by pressing a button?

Featured Replies

I have to keep track of shots on goal in a hockey game. I want to be able to have a field count up by one every time I press a button. Is that possible?

Create this script and attach it to a button:

Set Field [ game::score; game::score + 1]

  • Author

Thank you.

I don't think I know as much about FM as you may think! If I create this script and attach it to a button, where does the counting happen? How do I direct the "+1" to a field?

I suggest you read these two previous threads:

http://fmforums.com/forum/showtopic.php?tid/216178/post/362915/#362915

http://fmforums.com/forum/showtopic.php?tid/213573/

  • Author

Sorry, I read them but I don't get it. Maybe the solution is beyond me. I need a simple outcome - a field whose value increases by 1 every time I press a button - but it seems the path to it is quite complex.

No, it is very simple - but I suggested you read those threads in order to understand that this would not be a good solution. There are also demo files in these threads and perhaps you should take more than 10 minutes to peruse them.

  • Author

I did take the time but I don't follow what they are saying. I get that it may seem simple to you, but I am not a natural programmer so what they are saying is over my head. If there is a step by step solution somewhere, I am happy to follow it.

Like this.

Score.fp7.zip

No, not like this - like this:

Score.zip

  • Author

This worked perfectly. And so simple! Thank you Bruce.

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.