h = gcbh()
| Parameter | Description |
|---|---|
| Parameter | Description |
|---|---|
| h | a numeric handle for the current block, or the empty matrix [] when no block is selected. |
gcbh returns a numeric handle for the current block, the block selected in the editor (the same block gcb reports as a path).
The handle is a reference-style value that can be passed to get_param and set_param in place of the block path. It stays valid until the block is deleted or its model is closed.
gcbh returns the empty matrix [] when no block is selected or no editor is active, mirroring gcb, which returns the empty string in that case.
new_system('demo');
add_block('nflow/math/gain', 'demo/Gain');
set_param('demo/Gain', 'Gain', '2');
% In the editor, gcbh() returns the handle of the selected block.
% The same handle is available by path with get_param(path, 'Handle'):
h = get_param('demo/Gain', 'Handle')
get_param(h, 'Gain')
bdclose('demo');
| Version | Description |
|---|---|
| 1.0.0 | initial version |