Function Scripting - A Powerful Scripting TechniquePosted by: Editor / Friday, October 20, 2006 – 7:00pm
27
minutes
FileMaker is an easy environment to work in. It's mostly point and click for a lot of things. It allows you to start simply then grow more complex as you learn while you develop. The work you do, however, can either become very complex or stay simple - from the start. There's always a balance to be attained when trying to build a complex solution. Code readability is the topic I'm talking about. The goal is powerful, and often necessary, complexity, yet a level of obvious simplicity - for the sake of future understanding and possible collaboration. In this video, I present a new method for naming your scripts and defining script variables. It's a very elegant combination of three custom functions from two VERY smart developers. I'm pleased to provide this powerful scripting technique. I've personally never seen anything like it and I love it! Details: Released - 10/20/2006 / Size - 23.1 MB / Length - 27 min
Filed under: videos | Subscribers Only
. Extra Functions.
. Chuck said this on Thursday, July 10, 2008 - 2:15am.
. I neglected to send the code for two custom functions I use to iterate through lists: FirstListItem and RestOfList FirstListItem( TheList ) // Returns the first value in a list, including the ending paragraph mark. Often used to loop through a list of items. Returns the item // without the trailing carriage return. // // Written by Charles Ross Let( [ RawValue = LeftValues( TheList; 1 ) ]; Left( RawValue; Length( RawValue ) - 1 ) ) RestOfList( TheList ) // Returns the list without the first item. Usually used to loop through a list of items. // // Written by Charles Ross RightValues( TheList; ValueCount( TheList ) - 1 ) Also, I build parameters by using the following Param( VarName; ParamValue ) function. // Encapsulates the building of parameter/value pairs used by the AssignParams function. // // Written by Charles Ross. VarName & " = " & Quote( ParamValue ) & "; " Multiple parameters are sent by using the "&" text concatenation operator between calls to Param. . |
Be Notified!Let us tell you when a new video is posted. We'll send you an email with a direct link right to your email inbox.
Make sure and whitelist (or add to your address book editor@filemakermagazine.comFileMaker Reference Tool
* $29.99 is the FMPug member price for a printed copy. |
Another variation on - ADMIN POSTED THIS
Another variation on AssignParams
Charles Ross wrote in to tell me the following...
While I love the idea, and found the execution worked, I didn't enjoy that I found the original AssignParams function so convoluted. I rewrote it for my own personal use because I didn't like the format it required for the script names. I prefer to enclose the entire parameter list in parentheses and enclose the optional parameters in square braces. A minor difference, yes, but I've been using that format for quite some time, albeit without the validation functionality that [the original] AssignParams gives. Finally, I don't like functions that are so long they can't fit on my screen. In order to rewrite it, I had to understand it fairly well, so I took it apart today and rewrote it using sub-custom functions and hopefully better commenting.
AssignParams
SetAssignParamVars
ParamToVars