Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 8685 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I have the following scripts set up to generate numbers 1-15 automatically - (eg., XXXX-1, XXXX-2....XXXX-15)???

set field["gCounter", "gCounter=1"]

loop

duplicate record/request

set field["gCounter", "gCounter+1"]

set field["number of forms",'gCounter"]

set field["agency and number", "numToText(AgencyID &- "-"&number of form"]

Exit loop if {"gCounter=15"]

End loop

How should I change the script so that for first 1-15 numbers (gCounter), 1 to 9 will start with a leading 0 (ie, 01,02,03...09) and no leading 0 from 10-15?

I'm quite new to FMP, so will need specific directions and scripts. Thanks!!

Posted

Use the following whenever you want leading zeroes:

Right("00" & NumToText(gCounter),2)

So, your whole calculation would be:

AgencyID & "-" & Right("00" & NumToText(gCounter),2)

This topic is 8685 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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