Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
ninmonkey committed Jun 5, 2024
1 parent 719d3b1 commit bf4e1d6
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ let
/*
About: Compare different optional parameter types
This is from the post: https://ninmonkeys.com/blog/2024/06/05/power-query-functions-part1-using-optional-parameters
source:

lets call Text.Combine() to test declaring optional parameters

Expand All @@ -12,14 +13,14 @@ let
- always requires you pass 2 parameters
*/
Join_Nullable = (texts as list, separator as nullable text) =>
Text.Combine( texts, separator ),
Text.Combine( texts, separator ),

/*
For this version:
- you can pass a null value for a separator
- you can skip the second parameter
- 'optional' parameters are automatically 'nullable',
so you can drop the 'nullable' part
so you can drop the 'nullable' part

This is how library functions have multiple call signatures
Power Query defines one function
Expand All @@ -29,7 +30,7 @@ let
*/
Join_Optional = (texts as list, optional separator as text) =>
Text.Combine( texts, separator ),

Summary = [
chars = { "a".."h" }, // example array of strings

Expand Down

0 comments on commit bf4e1d6

Please sign in to comment.