Skip to content
Tako Lee edited this page Mar 3, 2024 · 34 revisions

image

  • gfmtopt.BEStyle_Function_leftBEOnNewline, type of boolean, default is false

  • gfmtopt.BEStyle_Function_leftBEIndentSize, type of integer, default is 0

  • gfmtopt.BEStyle_Function_rightBEOnNewline, type of boolean, default is false

  • gfmtopt.BEStyle_Function_rightBEIndentSize, type of integer, default is 0

  • gfmtopt.Parameters_Style, type of TAlignStyle, default is stacked

  • gfmtopt.Parameters_Comma, type of TLinefeedsCommaOption, default is after comma

  • gfmtopt.BEStyle_Function_FirstParamInNewline, type of boolean,, default is false

  • gfmtopt.Parameters_align_datatype, type of boolean, default is true

  • gfmtopt.functioncall_Parameters_Style, type of TAlignStyle, default is wrapped

  • gfmtopt.functioncall_Parameters_Comma, type of TLinefeedsCommaOption, default is after comma

1. Parameter declaration

1.1 Parameter style
  • Fit into one line

    Option: fmt151_parameter_list_style = fit_into_one_line, type: TFmtListStyle.

    CREATE FUNCTION dbo.Fn_gettoporders(@custid AS INT,@n AS INT, @test AS CHAR)  
    RETURNS TABLE  
    AS  
      RETURN  
        SELECT TOP(@n) *  
        FROM   sales.salesorderheader  
        WHERE  customerid = @custid  
        ORDER  BY totaldue DESC  
    
    GO        
  • Stacked

    Option: fmt151_parameter_list_style = stacked, type: TFmtListStyle.

    CREATE FUNCTION dbo.Fn_gettoporders(
       @custid AS INT,
       @n AS INT, 
       @test AS CHAR)  
    RETURNS TABLE  
    AS  
      <function body>  
    GO        
    • Comma at the end of line

      Option: fmt152_parameter_list_comma_option = after_item, type: TFmtCommaOption.

      CREATE FUNCTION dbo.Fn_gettoporders(
         @custid AS INT,
         @n AS INT, 
         @test AS CHAR)  
      RETURNS TABLE  
      AS  
        <function body>  
      GO        
    • Comma at the begin of line

      Option: fmt152_parameter_list_comma_option = before_item, type: TFmtCommaOption.

      CREATE FUNCTION dbo.Fn_gettoporders(
         @custid AS INT
         ,@n AS INT 
         ,@test AS CHAR)  
      RETURNS TABLE  
      AS  
        <function body>  
      GO        
    • Comma at the begin of line, align parameters.

      Option: fmt152_parameter_list_comma_option = before_item_outside_list, type: TFmtCommaOption.

      CREATE FUNCTION dbo.Fn_gettoporders(
          @custid AS INT
         ,@n AS INT 
         ,@test AS CHAR)  
      RETURNS TABLE  
      AS  
        <function body>  
      GO        
    • Comma at the begin of line, align parameters, space between comma and space is 1 or n

      Option: fmt152_parameter_list_comma_option = before_item_outside_list_with_n_space, type: TFmtCommaOption.

      Option: fmt153_parameter_list_comma_space = n, type: int.

      CREATE FUNCTION dbo.Fn_gettoporders(
            @custid AS INT
         ,  @n AS INT 
         ,  @test AS CHAR)  
      RETURNS TABLE  
      AS  
        <function body>  
      GO        
1.2 Parameter list block

Option: fmt154_parameter_list_start_parenthesis_in_newline = true, type: TFmtBoolean.

Option: fmt155_parameter_list_start_parenthesis_indent = n, type: int.

Option: fmt156_parameter_list_end_parenthesis_in_newline = true, type: TFmtBoolean.

Option: fmt157_parameter_list_end_parenthesis_indent = n, type: int.

Option: fmt158_parameter_list_first_item_in_newline = true, type: TFmtBoolean.

Option: fmt159_parameter_list_first_item_indent = n, type: int.

CREATE FUNCTION dbo.Fn_gettoporders
  (
    @custid AS INT,
    @n      AS INT, 
    @test   AS CHAR
  )  
RETURNS TABLE  
AS  
  <function body>  
GO        
1.3 Parameter align data type

Option: fmt160_parameter_list_align_data_type = true, type: TFmtBoolean.

CREATE FUNCTION dbo.Fn_gettoporders(
    @custid AS INT,
    @n      AS INT, 
    @test   AS CHAR)  
RETURNS TABLE  
AS  
  <function body>  
GO        

2. Parameter in function call

Clone this wiki locally