January 30, 200124 yr 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!!
January 30, 200124 yr 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)
Create an account or sign in to comment