blockly > Block > getInputWithBlock
Return the input that connects to the specified block.
Signature:
getInputWithBlock(block: Block): Input | null;
Parameters
Parameter |
Type |
Description |
block |
Block |
A block connected to an input on this block. |
Returns:
Input | null
The input (if any) that connects to the specified block.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[null,null,["Last updated 2024-09-18 UTC."],[[["This method helps you find the input on a block that is connected to a specific other block."],["It needs the connected block as an argument and returns the matching input, or null if there's no connection."],["`getInputWithBlock` is part of the `Block` class in Blockly and works with `Input` objects."]]],["The `getInputWithBlock()` method, part of the `Block` class, identifies the input connected to a given block. It accepts a `Block` as a parameter, representing a block connected to an input. The method then returns an `Input` object if a connection exists, otherwise, it returns `null`. This method's core function is to determine and return the specific input on a block that links to another specified block.\n"]]