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

Cant get counter to work

Featured Replies

Hello everyone

I am having a problem with a counter see example below

Set Field ["Count Field", "Count Field +1"]

If ["Count Field >5"]

Perform Scripts [sub-scripts,"run today"]

Set Field ["Count Field", "0"

End if

All it does is set the count field to "0" and nothing else

if i look in the global field count field it does not go up in number 1,2,3,4,5 it is just set to '0"

All i really want to do is execute a script after the file has been opened a number of times on shut down based on if a certain number has been reached am i on the right track

Thanks for any help i may receive in advance

grin.gif

If I understand correctly you're missing the loop; the below script will increase a global field gCounter till it is more than 5, and will reset it to 0 afterwards:

Loop

Set field (gCounter, gCounter +1)

If (gCounter >5)

Perform script (run today)

End If

Exit loop If (gCounter >5)

End Loop

Set field (gCounter, 0)

What this script does is dependent upon the context in which it is used. You didn't specify what the field type is for "Count Field".

1) If it is a number field, the contents depend upon what record you are on when the script executes.

2) If it is a global number field used with FM Client in a single user environment, it will retain a number between openings and closing of the file.

3) If it is a global number field in a file hosted by FM Server, the number in this field will be the last number stored in this field when the file was closed with FM Client in a single user mode. In this case, global fields are user unique, just like the current found set and sort order and disappear when the file is closed.

A little more context of how you are using this (the big picture) is necessary to explain what is happening.

-bd

  • Author

Ok people this is how i finally got it to work

Set Field["Backup Count Field",Backup Count Field +1"]

If["Backup Count Field >5"]

Perform Script[sub-scripts,"Sub Backup"]

Else

End If

If["Backup CountField >5"]

Set Field ["Backup Count Field","0"]

End If

And this is the Sub Backup Script

Show Message

Save a Copy as

Close

this work perfectly now for me i test it quite a few times

Create an account or sign in to comment

Important Information

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

Account

Navigation

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.