blockly > Block > setPreviousStatement
Metoda Block.setPreviousStatement()
Określ, czy ten blok może być połączony z dolnym blokiem.
Podpis:
setPreviousStatement(newBoolean: boolean, opt_check?: string | string[] | null): void;
Parametry
Parametr |
Typ |
Opis |
newBoolean |
wartość logiczna |
Wartość Prawda, jeśli może istnieć poprzednie stwierdzenie. |
opt_check |
string | string[] | null |
(Opcjonalnie) Typ oświadczenia lub lista typów oświadczeń. Wartość null/undefined, jeśli można podłączyć dowolny typ. |
Zwroty:
nieważne
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2024-11-30 UTC.
[null,null,["Ostatnia aktualizacja: 2024-11-30 UTC."],[[["The `setPreviousStatement` method determines if a block can connect to the bottom of another block."],["It accepts a boolean argument indicating whether a previous connection is allowed and an optional argument to specify accepted connection types."],["Calling this method affects how blocks are visually presented and logically connected in Blockly workspaces."]]],["The `setPreviousStatement` method determines if a block can connect to the bottom of another. It accepts a boolean (`newBoolean`) to enable or disable this chaining capability. An optional parameter (`opt_check`) allows specifying allowed statement types, either as a single string or an array of strings; omitting this permits any type. The method modifies the block's properties and does not return any value.\n"]]