Survei Riset: Ceritakan pengalaman Anda dengan Blockly
Mulai survei
blockly > Blokir > removeInput
Hapus input dari blok ini.
Tanda Tangan:
removeInput(name: string, opt_quiet?: boolean): boolean;
Parameter
Parameter |
Jenis |
Deskripsi |
nama |
string |
Nama input. |
opt_quiet |
boolean |
(Opsional) Benar untuk mencegah error jika input tidak ada. |
Hasil:
boolean
True jika operasi berhasil, false jika input tidak ada, dan opt_quiet bernilai true.
Pengecualian
{Error} jika input tidak ada dan opt_quiet tidak benar.
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2024-11-08 UTC.
[null,null,["Terakhir diperbarui pada 2024-11-08 UTC."],[[["The `removeInput()` method is used to delete an input from a Blockly block using the input's name."],["The method optionally takes a boolean, `opt_quiet`, to suppress errors if the specified input is not found."],["`removeInput()` returns `true` if the removal is successful, and `false` if `opt_quiet` is true and the input doesn't exist."],["An error is thrown if the input is not found and `opt_quiet` is not set to `true`."]]],["The `Block.removeInput()` method removes an input from a block using the input's name. It accepts two parameters: `name` (a string specifying the input's name) and an optional `opt_quiet` (a boolean). If `opt_quiet` is true, the method returns false if the input is absent. If `opt_quiet` is false (or omitted) and the input is not found, it throws an error. The method returns `true` if the input is successfully removed.\n"]]