mzimmers Posted February 4, 2006 Posted February 4, 2006 ...for the first time (almost). How does one execute functions within a script? I'm thinking specifically about the let and copy functions. They don't appear in the list of script steps, and ScriptMaker won't let me manually type them in. I've tried going through the help, but can't find anything. What am I doing wrong or missing? Thanks...
RalphL Posted February 4, 2006 Posted February 4, 2006 Use the setfield script step. You specify the field and define the calculation.
LaRetta Posted February 4, 2006 Posted February 4, 2006 There are many script-steps (in addition to Set Field[]) which allow/require a calculation within them. The Let[] function would be used within one of these calculations. Copy is NOT a function and can't be defined within a calculaton. It is a script-step which can be found under the Editing section (to copy a field value) and under the Records section for copying one or more records. Copy puts data on the User clipboard so should be used sparingly. A script step is the action to perform. A calculation (within a script step) is used to specify the desired outcome. And functions drive the calculation. Example: You want to set a field with a value of today's date + 5 days. Here's how it goes - Script step: Set Field[ ]. Which field to set? Specify that in the Set Field Options button. Set the field with what? Calculated Result button reveals calculation box. Calculation syntax to set the field would be: Get(CurrentDate) + 5 The function being used here is Get(CurrentDate) and the '+' is the Operator. Just start creating test scripts and putting stuff in them. You'll pick it up very quickly! Always back up before running them though. And NEVER ... EVER ... turn Allow User Abort to OFF (particularly if you use a loop) until you are sure your script is perfect. Open your FM Help (F1) and search for: Copy Script Step, Let[] function etc ... it covers all the basics and even provides example scripts to play with. LaRetta
comment Posted February 4, 2006 Posted February 4, 2006 Uhm.. off topic: that F1 thing is for Windows. The Mac keyboard has a dedicated help key, or you can use Command+?. Highly recommended though, I agree.
Recommended Posts
This topic is 6870 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