Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Unlike many other programming languages, FileMaker uses the semicolon as a separator between parameters to a function. In many cases this will appear as line endings within code. While FileMaker does not use terminating line endings, it can appear as such. The following guidelines are provided in order to increase the readability and interpretation of FileMaker code.

  1. Use Hard Tabs: Calculation code should use hard tabs (not spaces) for better readability within the calculation dialog box.
    When editing code within the calc dialog box you can use Option-Tab (Mac) or Control-Tab (Win) to insert tabs.
  2. Maintain spaces between function names and function parameters. This accommodates the cross-platform aspect of double-clicking to highlight  function names or parameters on Windows.
  3. Line endings with semicolons: Should not include a space when the line of code is considered "complete". This is done in order to provide a "continuation clue" about the code being read. See the following example. Note that line 7 is an If() statement which uses multiple lines. The space after the test parameter of the If () functions indicates that the function has not been "completed" or "closed". Compare this to lines 2-5 where each variable declaration of the Let() function is considered completed.

    Code Block
    linenumberstrue
    Let ( [ 
    	~developers = List ( "" ; "" );
    	~version = Get ( ApplicationVersion );
    	~isGo = PatternCount ( ~version; "Go" ) = True;
    	~versionNumber = GetAsNumber ( Substitute ( ~version ; "," ; "." ) );
    	~extendedPrivileges = 
    		If ( ~isGo or ~versionNumber ? 11 ;
    			Evaluate ( "Get ( AccountExtendedPrivileges )" ) ;
    			/*else*/
    			Evaluate ( "Get ( ExtendedPrivileges )" )
    		)
    ];
    	PatternCount ( ¶& ~developers &¶ ; ¶& Get ( AccountName ) &¶ ) ? 1
    	or PatternCount ( ¶& ~extendedPrivileges &¶ ; ¶& "developer" &¶ ) ? 1
    	or
    	If ( ~isGo or ~versionNumber ? 11 ;
    		Evaluate ( "Get ( AccountPrivilegeSetName )" ) = "[Full Access]" ;
    		/*else*/
    		Evaluate ( "Get ( PrivilegeSetName )" ) = "[Full Access]"
    	)
    )