You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

  • Let functions with only one variable declaration can be defined on one line
    Let ( ~someVar = FunctionalArea » Tablename::fieldName ; If ( ~someVar = "Active"; True; False ) )
    
  • Example Let function with indenting
    Let (
            [
                ~privateVariable = List ( "one" ; "two" ; "three" );
                $localVariable = Substitute ( ~privateVariable ; [ ¶ ; "," ] );
                $$globalVariableTopValue = GetValue ( ~privateVariable ; 1 )
            ];
                "Your Let function result is " & $localVariable
    )
    
  • Let functions with multiple variables use both opening and closing brackets on their own lines
    Note: both opening and closing brackets should be indented to stand out.
    Let (
            [
                variable = expression
            ];
                "result is indented 2 tabs"
    )
    

    good

    Let ( [

    bad

    Let (
    [
    

    bad

  • Closing Let variable declarations end on their own line. This indicates the start of the result.
    ];

    good

    endOfFunction ) ];

    bad

  • Calculation scoped variables use camelCase and are identified by a preceding variable indicator of ~ (tilde). The ~ character in these standards represents the private scope.
    This makes it easy to distinguish calculation variables from custom function arguments, $variables, and Table::fieldNames
    ~someVariable

    good

    someVariable

    bad

  • Use present tense verbs or adjectives to indicate Boolean variable status on both calculation and locally scoped variables.
    $hasReturns
    ~isTrailing
    $containsSpaces
    not ~containsEmailAddress
    
  • No labels