Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
magicseteditor
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
magicseteditor
Commits
377aaa7f
Commit
377aaa7f
authored
Aug 01, 2007
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Documented 'length' function
parent
86e9a2fd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
2 deletions
+37
-2
doc/function/index.txt
doc/function/index.txt
+2
-1
doc/function/length.txt
doc/function/length.txt
+22
-0
doc/function/number_of_items.txt
doc/function/number_of_items.txt
+8
-1
doc/function/position.txt
doc/function/position.txt
+5
-0
No files found.
doc/function/index.txt
View file @
377aaa7f
...
@@ -29,7 +29,8 @@ These functions are built into the program, other [[type:function]]s can be defi
...
@@ -29,7 +29,8 @@ These functions are built into the program, other [[type:function]]s can be defi
! [[type:list|Lists]] <<<
! [[type:list|Lists]] <<<
| [[fun:position]] Find the position of an element in a list.
| [[fun:position]] Find the position of an element in a list.
| [[fun:number_of_items]] Find the number of items in a list.
| [[fun:length]] Return the number of items in a list.
| [[fun:number_of_items]] Return the number of items in a list.
| [[fun:sort_list]] Sort a list.
| [[fun:sort_list]] Sort a list.
| [[fun:filter_list]] Filter a list, keeping only elements that match a predicate.
| [[fun:filter_list]] Filter a list, keeping only elements that match a predicate.
...
...
doc/function/length.txt
0 → 100644
View file @
377aaa7f
Function: length
--Usage--
> length(some_collection)
Returns the number of items in a list or the number of characters in a string.
Note: This function is exactly the same as [[fun:number_of_items]].
--Parameters--
! Parameter Type Description
| @input@ [[type:list]] or [[type:map]] or [[type:set]] or [[type:string]]
Object to determine the number of items of.
When it is a set, returns the number of cards.
When it is a string, returns the number of characters.
--Examples--
> length(["x", "y", "z"]) == 3
> length("pink") == 4
--See also--
| [[fun:number_of_items]] Return the number of items in a list.
doc/function/number_of_items.txt
View file @
377aaa7f
...
@@ -3,7 +3,9 @@ Function: number_of_items
...
@@ -3,7 +3,9 @@ Function: number_of_items
--Usage--
--Usage--
> number_of_items(in: some_collection)
> number_of_items(in: some_collection)
Returns the position of an item in a list or characters in a string.
Returns the number of items in a list or the number of characters in a string.
Note: This function is exactly the same as [[fun:length]].
--Parameters--
--Parameters--
! Parameter Type Description
! Parameter Type Description
...
@@ -21,3 +23,8 @@ Returns the position of an item in a list or characters in a string.
...
@@ -21,3 +23,8 @@ Returns the position of an item in a list or characters in a string.
>
>
> # the number of red cards in the set
> # the number of red cards in the set
> number_of_items(in: set, filter: { card.color == "red" } )
> number_of_items(in: set, filter: { card.color == "red" } )
--See also--
| [[fun:length]] Return the number of items in a list.
| [[fun:sort_list]] Sort a list.
| [[fun:filter_list]] Filter a list, keeping only elements that match a predicate.
doc/function/position.txt
View file @
377aaa7f
...
@@ -24,3 +24,8 @@ If the item is not found in the list, returns @-1@.
...
@@ -24,3 +24,8 @@ If the item is not found in the list, returns @-1@.
>
>
> # The position of the card in the list of red cards, ordered by name
> # The position of the card in the list of red cards, ordered by name
> postion(of: card, in: set, order_by: {card.name}, filter:{card.color == "red"})
> postion(of: card, in: set, order_by: {card.name}, filter:{card.color == "red"})
--See also--
| [[fun:length]] / [[fun:number_of_items]] Return the number of items in a list.
| [[fun:sort_list]] Sort a list.
| [[fun:filter_list]] Filter a list, keeping only elements that match a predicate.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment