caseyi Posted January 30, 2001 Share Posted January 30, 2001 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!! Link to comment Share on other sites More sharing options...
BobWeaver Posted January 30, 2001 Share Posted January 30, 2001 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) Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 8481 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 accountSign in
Already have an account? Sign in here.
Sign In Now