Survei Riset: Ceritakan pengalaman Anda dengan Blockly
Mulai survei
blockly > Block > setOutput
Metode Block.setOutput()
Tetapkan apakah blok ini menampilkan nilai.
Tanda Tangan:
setOutput(newBoolean: boolean, opt_check?: string | string[] | null): void;
Parameter
Parameter |
Jenis |
Deskripsi |
newBoolean |
boolean |
Benar jika ada output. |
opt_check |
string | string[] | null |
(Opsional) Jenis yang ditampilkan atau daftar jenis yang ditampilkan. Null atau undefined jika jenis apa pun dapat ditampilkan (misalnya, variabel get). |
Hasil:
void
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-30 UTC.
[null,null,["Terakhir diperbarui pada 2024-11-30 UTC."],[[["The `setOutput` method determines if a block produces a value or not."],["It takes a boolean argument (`newBoolean`) indicating the output status and an optional `opt_check` for specifying the output type(s)."],["Calling `setOutput` does not return any value (void)."]]],["The `Block.setOutput()` method determines if a block returns a value. It accepts a boolean `newBoolean`: `true` indicates an output exists, `false` otherwise. An optional `opt_check` parameter specifies the type or types returned, using a string or string array. If `null` or `undefined`, any type is acceptable. The method's return type is `void`. The key actions are setting and defining the parameters of a block's output status and its type.\n"]]