-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
30 additions
and
49 deletions.
There are no files selected for viewing
49 changes: 0 additions & 49 deletions
49
md/5_writing_ops/dev_creating_ports/dev_dynamic_ports/dev_dynamic_ports.md
This file was deleted.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
md/5_writing_ops/dev_creating_ports/dev_multi_ports/dev_multi_ports.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# MultiPorts | ||
|
||
Ports that can have a user defined number of sub ports. | ||
|
||
`op.inMultiPort("Numbers", CABLES.OP_PORT_TYPE_NUMBER)` | ||
|
||
|
||
## Example | ||
|
||
This op can have multiple connections ior manually set number of ports. The output will be the sum of all those number ports. | ||
|
||
```javascript | ||
|
||
const | ||
nums=op.inMultiPort("Numbers", CABLES.OP_PORT_TYPE_NUMBER), | ||
outSum=op.outNumber("Sum"); | ||
|
||
nums.onChange= () => | ||
{ | ||
let n=0; | ||
for(let i=0;i<nums.ports.length;i++) | ||
{ | ||
n+=nums.ports[i].get(); | ||
} | ||
|
||
outSum.set(n); | ||
}; | ||
|
||
``` | ||
|