Skip to content

Commit

Permalink
multiport docs
Browse files Browse the repository at this point in the history
  • Loading branch information
pandrr committed Nov 5, 2024
1 parent 4fc5344 commit f618d64
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 49 deletions.

This file was deleted.

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);
};

```

0 comments on commit f618d64

Please sign in to comment.